You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add methods geetest_v4, lemin, turnstile and amazon_waf to TwoCaptcha class. (#51)
* Add methods geetest_v4, lemin, turnstile and amazon_waf
* Update methods geetest_v4, lemin, turnstile, amazon_waf. Add examples in README
* use url instead of pageurl
* add geetest v4 example
* add geetest_v4 test
* add lemin example
* use the save env variable in examples
* add lemin test
* add turnstile example
* add turnstile test
* added amazon_waf example
* added amazon_waf test
---------
Co-authored-by: 2captcha <support@2captcha.com>
|server|`2captcha.com`|API server. You can set it to `rucaptcha.com` if your account is registered there|
62
-
|softId|-|your software ID obtained after publishing in [2captcha sofware catalog]|
63
-
|callback|-|URL of your web-sever that receives the captcha recognition result. The URl should be first registered in [pingback settings] of your account|
64
-
|defaultTimeout|120|Polling timeout in seconds for all captcha types except ReCaptcha. Defines how long the module tries to get the answer from `res.php` API endpoint|
65
-
|recaptchaTimeout|600|Polling timeout for ReCaptcha in seconds. Defines how long the module tries to get the answer from `res.php` API endpoint|
66
-
|pollingInterval|10|Interval in seconds between requests to `res.php` API endpoint, setting values less than 5 seconds is not recommended|
|server|`2captcha.com`|API server. You can set it to `rucaptcha.com` if your account is registered there|
71
+
|softId| - |your software ID obtained after publishing in [2captcha sofware catalog]|
72
+
|callback| - |URL of your web-sever that receives the captcha recognition result. The URl should be first registered in [pingback settings] of your account|
73
+
|defaultTimeout|120|Polling timeout in seconds for all captcha types except ReCaptcha. Defines how long the module tries to get the answer from `res.php` API endpoint|
74
+
|recaptchaTimeout|600|Polling timeout for ReCaptcha in seconds. Defines how long the module tries to get the answer from `res.php` API endpoint|
75
+
|pollingInterval| 10 |Interval in seconds between requests to `res.php` API endpoint, setting values less than 5 seconds is not recommended|
67
76
68
77
> **IMPORTANT:** once `callback` is defined for `TwoCaptcha` instance, all methods return only the captcha ID and DO NOT poll the API to get the result. The result will be sent to the callback URL.
69
78
To get the answer manually use [getResult method](#send--getresult)
@@ -72,17 +81,17 @@ To get the answer manually use [getResult method](#send--getresult)
72
81
When you submit any image-based captcha use can provide additional options to help 2captcha workers to solve it properly.
73
82
74
83
### Captcha options
75
-
|Option|Default Value|Description|
76
-
|---|---|---|
77
-
|numeric|0|Defines if captcha contains numeric or other symbols [see more info in the API docs][post options]|
78
-
|minLength|0|minimal answer lenght|
79
-
|maxLength|0|maximum answer length|
80
-
|phrase|0|defines if the answer contains multiple words or not|
81
-
|caseSensitive|0|defines if the answer is case sensitive|
82
-
|calc|0|defines captcha requires calculation|
83
-
|lang|-|defines the captcha language, see the [list of supported languages]|
84
-
|hintImg|-|an image with hint shown to workers with the captcha|
85
-
|hintText|-|hint or task text shown to workers with the captcha|
|numeric| 0 |Defines if captcha contains numeric or other symbols [see more info in the API docs][post options]|
87
+
|minLength| 0 |minimal answer lenght|
88
+
|maxLength| 0 |maximum answer length|
89
+
|phrase| 0 |defines if the answer contains multiple words or not|
90
+
|caseSensitive| 0 |defines if the answer is case sensitive|
91
+
|calc| 0 |defines captcha requires calculation|
92
+
|lang| - |defines the captcha language, see the [list of supported languages]|
93
+
|hintImg| - |an image with hint shown to workers with the captcha|
94
+
|hintText| - |hint or task text shown to workers with the captcha|
86
95
87
96
Below you can find basic examples for every captcha type. Check out [examples directory] to find more examples with all available options.
88
97
@@ -147,6 +156,48 @@ result = solver.hcaptcha(sitekey='10000000-ffff-ffff-ffff-000000000001',
147
156
148
157
```
149
158
159
+
### GeeTest v4
160
+
Use this method to solve GeeTest v4. Returns the response in JSON.
161
+
```python
162
+
result = solver.geetest_v4(captcha_id='e392e1d7fd421dc63325744d5a2b9c73',
163
+
url='https://www.site.com/page/',
164
+
param1=..., ...)
165
+
166
+
```
167
+
168
+
169
+
### Lemin Cropped Captcha
170
+
Use this method to solve hCaptcha challenge. Returns JSON with answer containing the following values: answer, challenge_id.
171
+
```python
172
+
result = solver.lemin(captcha_id='CROPPED_1abcd2f_a1234b567c890d12ef3a456bc78d901d',
173
+
div_id='lemin-cropped-captcha',
174
+
url='https://www.site.com/page/',
175
+
param1=..., ...)
176
+
177
+
```
178
+
179
+
180
+
### Cloudflare Turnstile
181
+
Use this method to solve Cloudflare Turnstile. Returns JSON with the token.
182
+
```python
183
+
result = solver.turnstile(sitekey='0x1AAAAAAAAkg0s2VIOD34y5',
184
+
url='http://mysite.com/',
185
+
param1=..., ...)
186
+
187
+
```
188
+
189
+
### Amazon WAF
190
+
Use this method to solve Amazon WAF Captcha also known as AWS WAF Captcha is a part of Intelligent threat mitigation for Amazon AWS. Returns JSON with the token.
191
+
```python
192
+
result = solver.amazon_waf(sitekey='0x1AAAAAAAAkg0s2VIOD34y5',
0 commit comments