Unofficial async wrapper for interacting with hCaptcha
Project description
AsyncHcaptcha
Installing
Python 3.7 or higher and chrome with chromedriver are required
pip install async-hcaptcha
Example
from async_hcaptcha import AioHcaptcha
from async_hcaptcha.utils import getUrl
async def getAnswers(question, tasklist):
answers = {}
tl = {str(i): list(tasklist.keys())[i] for i in range(len(tasklist.keys()))}
for i, k in tl.items():
with open(f"captcha_images/{i}.jpg", "wb") as f:
f.write(await getUrl(tasklist[k], False))
print(question)
print("Answer with true/false or 1/0:")
for i, uuid in tl.items():
ans = input(f"{i}? ").lower()
if ans in ("1", "true"):
answers[uuid] = "true"
else:
answers[uuid] = "false"
return answers
async def main():
solver = AioHcaptcha("a5f74b19-9e45-40e0-b45d-47ff91b7a6c2", "https://accounts.hcaptcha.com/demo", getAnswers,
{"executable_path": "chromedriver.exe"})
resp = await solver.solve()
print(resp)
if __name__ == "__main__":
from asyncio import get_event_loop, sleep as asleep
get_event_loop().run_until_complete(main())
Automatically solved example
from async_hcaptcha import AioHcaptcha
async def main():
solver = AioHcaptcha("a5f74b19-9e45-40e0-b45d-47ff91b7a6c2", "https://accounts.hcaptcha.com/demo",
{"executable_path": "chromedriver.exe"})
resp = await solver.solve()
print(resp)
if __name__ == "__main__":
from asyncio import get_event_loop, sleep as asleep
get_event_loop().run_until_complete(main())
TODO
- Make hsw solving without selenium
- Add custom parameters support (captcha_rqdata)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
async-hcaptcha-1.0.0b5.tar.gz
(13.3 kB
view hashes)
Built Distribution
Close
Hashes for async_hcaptcha-1.0.0b5-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 811b308f50c8221099c98729f51ad4bd3e94ee0aed7aa83c6ee320f3f620d3a9 |
|
MD5 | 2e8d61fa1257be90018e19c92e32a311 |
|
BLAKE2b-256 | 80d9a162cbf4197d516a7ba764bcaf903b7ff85d9b43dc9f29bd256d00b6bc03 |