forked from AdminAnticaptcha/anticaptcha-python
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhcaptcha_proxyless_example.py
39 lines (33 loc) · 1.18 KB
/
hcaptcha_proxyless_example.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
from anticaptchaofficial.hcaptchaproxyless import *
# Non-Enterprise version
solver = hCaptchaProxyless()
solver.set_verbose(1)
solver.set_key("YOUR_KEY")
solver.set_website_url("https://website.com")
solver.set_website_key("SITE_KEY")
solver.set_user_agent("YOUR FULL USER AGENT HERE")
# Specify softId to earn 10% commission with your app.
# Get your softId here: https://anti-captcha.com/clients/tools/devcenter
solver.set_soft_id(0)
g_response = solver.solve_and_return_solution()
if g_response != 0:
print("g-response: "+g_response)
else:
print("task finished with error "+solver.error_code)
# Enterprise version
solver = hCaptchaProxyless()
solver.set_verbose(1)
solver.set_key("YOUR_KEY")
solver.set_website_url("https://website.com")
solver.set_website_key("SITE_KEY")
solver.set_user_agent("YOUR FULL USER AGENT HERE")
solver.set_enterprise_payload({
"rqdata": "rq data value from target website",
"sentry": True,
# ... etc, see https://anti-captcha.com/apidoc/task-types/HCaptchaTaskProxyless for more
})
g_response = solver.solve_and_return_solution()
if g_response != 0:
print("g-response: "+g_response)
else:
print("task finished with error "+solver.error_code)