Skip to content

Commit 5a94186

Browse files
committed
- Updated parameter values in the examples folder for hcaptcha, keycaptcha, lemin, recaptcha
- Added comments about dynamic parameters for geetest and amazon Signed-off-by: Maxim S <poplers24@gmail.com>
1 parent aaa3e6a commit 5a94186

10 files changed

Lines changed: 49 additions & 32 deletions

examples/amazon_waf.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@
1515

1616
solver = TwoCaptcha(api_key)
1717

18+
"""
19+
Important: the values of the 'iv' and 'context' parameters are dynamic, for every request to our API you need to get new values.
20+
The values 'iv' and 'context' need to be looked for in the page code.
21+
"""
22+
1823
try:
1924
result = solver.amazon_waf(
2025
sitekey='AQIDAHjcYu/GjX+QlghicBgQ/7bFaQZ+m5FKCMDnO+vTbNg96AFsClhVgr5q0UFRdXhhHEwiAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMLMbH8d6uQSrYTraoAgEQgDvtSNxdEyG7Zu393cHyPdWNCZgeIB52+W7fCTI8U5z15z1NdPUdnB1ZHoK7ewpwoSMm5mzkJJld0cnvGw==',

examples/amazon_waf_options.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,11 @@
2626

2727
solver = TwoCaptcha(**config)
2828

29+
"""
30+
Important: the values of the 'iv' and 'context' parameters are dynamic, for every request to our API you need to get new values.
31+
The values 'iv' and 'context' need to be looked for in the page code.
32+
"""
33+
2934
try:
3035
result = solver.amazon_waf(sitekey='AQIDAHjcYu/GjX+QlghicBgQ/7bFaQZ+m5FKCMDnO+vTbNg96AGIqvS8v6ScFa8ZpNRrlQgKAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMx9gxoe10Zg35PWhzAgEQgDvUtMMkqkFQByMLK2329D8iX4mjvaTuUhU70LD4vLp54v3+4K1nYY2hB+OM1hMbncnMbP63y4UOrY77jg==',
3136
iv='CgAGVTNd9JAAAAnB',

examples/geetest.py

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,21 @@
1515

1616
solver = TwoCaptcha(api_key)
1717

18-
resp = requests.get("https://www.mysite.com/distil_r_captcha_challenge")
19-
challenge = resp.content.decode('utf-8').split(';')[0]
18+
"""
19+
Important: the value of the 'challenge' parameter is dynamic, for each request to our API you need to get a new value.
20+
"""
21+
22+
resp = requests.get("https://2captcha.com/api/v1/captcha-demo/gee-test/init-params")
23+
challenge = resp.json()['challenge']
2024

2125
try:
22-
result = solver.geetest(gt='f3bf6dbdcf7886856696502e1d55e00c',
23-
apiServer='api-na.geetest.com',
26+
result = solver.geetest(gt='81388ea1fc187e0c335c0a8907ff2625',
27+
apiServer='http://api.geetest.com',
2428
challenge=challenge,
25-
url='https://www.mysite.com/distil_r_captcha.html')
29+
url='https://2captcha.com/demo/geetest')
2630

2731
except Exception as e:
2832
sys.exit(e)
2933

3034
else:
31-
sys.exit('result: ' + str(result))
35+
sys.exit('result: ' + str(result))

examples/geetest_options.py

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,19 @@
1515

1616
solver = TwoCaptcha(api_key, defaultTimeout=300, pollingInterval=10)
1717

18-
resp = requests.get("https://www.mysite.com/distil_r_captcha_challenge")
19-
challenge = resp.content.decode('utf-8').split(';')[0]
18+
"""
19+
Important: the value of the 'challenge' parameter is dynamic, for each request to our API you need to get a new value.
20+
"""
21+
22+
resp = requests.get("https://2captcha.com/api/v1/captcha-demo/gee-test/init-params")
23+
challenge = resp.json()['challenge']
2024

2125
try:
2226
result = solver.geetest(
23-
gt='f3bf6dbdcf7886856696502e1d55e00c',
24-
apiServer='api-na.geetest.com',
27+
gt='81388ea1fc187e0c335c0a8907ff2625',
28+
apiServer='http://api.geetest.com',
2529
challenge=challenge,
26-
url='https://www.mysite.com/distil_r_captcha.html',
30+
url='https://2captcha.com/demo/geetest',
2731
# proxy={
2832
# 'type': 'HTTPS',
2933
# 'uri': 'login:password@IP_address:PORT'
@@ -34,4 +38,4 @@
3438
sys.exit(e)
3539

3640
else:
37-
sys.exit('result: ' + str(result))
41+
sys.exit('result: ' + str(result))

examples/hcaptcha.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
try:
1919
result = solver.hcaptcha(
20-
sitekey='3ceb8624-1970-4e6b-91d5-70317b70b651',
20+
sitekey='41b778e7-8f20-45cc-a804-1f1ebb45c579',
2121
url='https://2captcha.com/demo/hcaptcha?difficulty=easy',
2222
)
2323

examples/keycaptcha.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@
1717

1818
try:
1919
result = solver.keycaptcha(
20-
s_s_c_user_id=15,
21-
s_s_c_session_id='faa8cc1697c962ad4b859aa472f5d992',
22-
s_s_c_web_server_sign='4f84e4fe41cf688d8d94361489ecd75c-pz-',
23-
s_s_c_web_server_sign2='a9af97bb0a645eec495f2527e431a21b',
24-
url='https://www.keycaptcha.com/products/')
20+
s_s_c_user_id=184015,
21+
s_s_c_session_id='e34ddd2c72e67593ac0b4ca8e4f44725',
22+
s_s_c_web_server_sign='a5ebd41ae22348b2cdbdc211792e982d',
23+
s_s_c_web_server_sign2='29255689423dd92990f8d06de50560d0',
24+
url='https://2captcha.com/demo/keycaptcha')
2525

2626
except Exception as e:
2727
sys.exit(e)

examples/keycaptcha_options.py

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,14 @@
2727
solver = TwoCaptcha(**config)
2828

2929
try:
30-
result = solver.keycaptcha(s_s_c_user_id = 184015,
31-
s_s_c_session_id = 'c32c9934c68b2968bee0332b9346da42',
32-
s_s_c_web_server_sign = 'c93c8d136d5ee6ee6fe27ab2be54901d',
33-
s_s_c_web_server_sign2 = 'eec85fcfeda28bffd7764d712d4089e7',
34-
url = 'https://2captcha.com/ru/demo/keycaptcha'
35-
# proxy = {
36-
# 'type': 'HTTPS',
37-
# 'uri': 'login:password@IP_address:PORT'}
38-
)
30+
result = solver.keycaptcha(s_s_c_user_id=184015,
31+
s_s_c_session_id='e34ddd2c72e67593ac0b4ca8e4f44725',
32+
s_s_c_web_server_sign='a5ebd41ae22348b2cdbdc211792e982d',
33+
s_s_c_web_server_sign2='29255689423dd92990f8d06de50560d0',
34+
url='https://2captcha.com/demo/keycaptcha',
35+
# proxy = {'type': 'HTTPS',
36+
# 'uri': 'login:password@IP_address:PORT'}
37+
)
3938

4039

4140
except Exception as e:

examples/lemin.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
solver = TwoCaptcha(api_key)
1616

1717
try:
18-
result = solver.lemin(captcha_id='CROPPED_3dfdd5c_d1872b526b794d83ba3b365eb15a200b',
18+
result = solver.lemin(captcha_id='CROPPED_5a29582_ca114c2f3314482c84cd32fc7d2feb63',
1919
div_id='lemin-cropped-captcha',
2020
url='https://2captcha.com/demo/lemin')
2121

examples/recaptcha_v2.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717

1818
try:
1919
result = solver.recaptcha(
20-
sitekey='6LfDxboZAAAAAD6GHukjvUy6lszoeG3H4nQW57b6',
21-
url='https://2captcha.com/demo/recaptcha-v2-invisible?level=low')
20+
sitekey='6LdO5_IbAAAAAAeVBL9TClS19NUTt5wswEb3Q7C5',
21+
url='https://2captcha.com/demo/recaptcha-v2-invisible')
2222

2323
except Exception as e:
2424
sys.exit(e)

examples/recaptcha_v2_options.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@
2828

2929
try:
3030
result = solver.recaptcha(
31-
sitekey='6LfDxboZAAAAAD6GHukjvUy6lszoeG3H4nQW57b6',
32-
url='https://2captcha.com/demo/recaptcha-v2-invisible?level=low',
31+
sitekey='6LdO5_IbAAAAAAeVBL9TClS19NUTt5wswEb3Q7C5',
32+
url='https://2captcha.com/demo/recaptcha-v2-invisible',
3333
invisible=1,
3434
enterprise=0
3535
# proxy={

0 commit comments

Comments
 (0)