2captcha-python 1.2.3__tar.gz → 1.2.4__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {2captcha-python-1.2.3 → 2captcha-python-1.2.4}/2captcha_python.egg-info/PKG-INFO +36 -21
- {2captcha-python-1.2.3 → 2captcha-python-1.2.4}/2captcha_python.egg-info/SOURCES.txt +1 -0
- {2captcha-python-1.2.3 → 2captcha-python-1.2.4}/PKG-INFO +36 -21
- {2captcha-python-1.2.3 → 2captcha-python-1.2.4}/README.md +35 -20
- 2captcha-python-1.2.4/tests/test_atb_captcha.py +31 -0
- {2captcha-python-1.2.3 → 2captcha-python-1.2.4}/twocaptcha/__init__.py +1 -1
- {2captcha-python-1.2.3 → 2captcha-python-1.2.4}/twocaptcha/solver.py +21 -1
- {2captcha-python-1.2.3 → 2captcha-python-1.2.4}/2captcha_python.egg-info/dependency_links.txt +0 -0
- {2captcha-python-1.2.3 → 2captcha-python-1.2.4}/2captcha_python.egg-info/requires.txt +0 -0
- {2captcha-python-1.2.3 → 2captcha-python-1.2.4}/2captcha_python.egg-info/top_level.txt +0 -0
- {2captcha-python-1.2.3 → 2captcha-python-1.2.4}/LICENSE +0 -0
- {2captcha-python-1.2.3 → 2captcha-python-1.2.4}/setup.cfg +0 -0
- {2captcha-python-1.2.3 → 2captcha-python-1.2.4}/setup.py +0 -0
- {2captcha-python-1.2.3 → 2captcha-python-1.2.4}/tests/test_amazon_waf.py +0 -0
- {2captcha-python-1.2.3 → 2captcha-python-1.2.4}/tests/test_canvas.py +0 -0
- {2captcha-python-1.2.3 → 2captcha-python-1.2.4}/tests/test_capy.py +0 -0
- {2captcha-python-1.2.3 → 2captcha-python-1.2.4}/tests/test_coordinates.py +0 -0
- {2captcha-python-1.2.3 → 2captcha-python-1.2.4}/tests/test_cutcaptcha.py +0 -0
- {2captcha-python-1.2.3 → 2captcha-python-1.2.4}/tests/test_friendly_captcha.py +0 -0
- {2captcha-python-1.2.3 → 2captcha-python-1.2.4}/tests/test_funcaptcha.py +0 -0
- {2captcha-python-1.2.3 → 2captcha-python-1.2.4}/tests/test_geetest.py +0 -0
- {2captcha-python-1.2.3 → 2captcha-python-1.2.4}/tests/test_geetest_v4.py +0 -0
- {2captcha-python-1.2.3 → 2captcha-python-1.2.4}/tests/test_grid.py +0 -0
- {2captcha-python-1.2.3 → 2captcha-python-1.2.4}/tests/test_hcaptcha.py +0 -0
- {2captcha-python-1.2.3 → 2captcha-python-1.2.4}/tests/test_keycaptcha.py +0 -0
- {2captcha-python-1.2.3 → 2captcha-python-1.2.4}/tests/test_lemin.py +0 -0
- {2captcha-python-1.2.3 → 2captcha-python-1.2.4}/tests/test_mtcaptcha.py +0 -0
- {2captcha-python-1.2.3 → 2captcha-python-1.2.4}/tests/test_normal.py +0 -0
- {2captcha-python-1.2.3 → 2captcha-python-1.2.4}/tests/test_recaptcha.py +0 -0
- {2captcha-python-1.2.3 → 2captcha-python-1.2.4}/tests/test_rotate.py +0 -0
- {2captcha-python-1.2.3 → 2captcha-python-1.2.4}/tests/test_text.py +0 -0
- {2captcha-python-1.2.3 → 2captcha-python-1.2.4}/tests/test_turnstile.py +0 -0
- {2captcha-python-1.2.3 → 2captcha-python-1.2.4}/twocaptcha/api.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: 2captcha-python
|
|
3
|
-
Version: 1.2.
|
|
3
|
+
Version: 1.2.4
|
|
4
4
|
Summary: Python module for easy integration with 2Captcha API
|
|
5
5
|
Home-page: https://github.com/2captcha/2captcha-python/
|
|
6
6
|
Author: 2Captcha
|
|
@@ -14,7 +14,7 @@ License-File: LICENSE
|
|
|
14
14
|
Requires-Dist: requests
|
|
15
15
|
|
|
16
16
|
# Python Module for 2Captcha API
|
|
17
|
-
The easiest way to quickly integrate
|
|
17
|
+
The easiest way to quickly integrate the 2Captcha captcha-solving service into your code and automate the solving of any type of captcha.
|
|
18
18
|
|
|
19
19
|
- [Python Module for 2Captcha API](#python-module-for-2captcha-api)
|
|
20
20
|
- [Installation](#installation)
|
|
@@ -25,8 +25,8 @@ The easiest way to quickly integrate [2Captcha] captcha solving service into you
|
|
|
25
25
|
- [Normal Captcha](#normal-captcha)
|
|
26
26
|
- [Audio Captcha](#audio-captcha)
|
|
27
27
|
- [Text Captcha](#text-captcha)
|
|
28
|
-
- [
|
|
29
|
-
- [
|
|
28
|
+
- [reCAPTCHA v2](#recaptcha-v2)
|
|
29
|
+
- [reCAPTCHA v3](#recaptcha-v3)
|
|
30
30
|
- [FunCaptcha](#funcaptcha)
|
|
31
31
|
- [GeeTest](#geetest)
|
|
32
32
|
- [hCaptcha](#hcaptcha)
|
|
@@ -35,13 +35,14 @@ The easiest way to quickly integrate [2Captcha] captcha solving service into you
|
|
|
35
35
|
- [Cloudflare Turnstile](#cloudflare-turnstile)
|
|
36
36
|
- [Amazon WAF](#amazon-waf)
|
|
37
37
|
- [KeyCaptcha](#keycaptcha)
|
|
38
|
+
- [atbCAPTCHA](#atbcaptcha)
|
|
38
39
|
- [Capy](#capy)
|
|
39
40
|
- [Grid](#grid)
|
|
40
41
|
- [Canvas](#canvas)
|
|
41
42
|
- [ClickCaptcha](#clickcaptcha)
|
|
42
43
|
- [Rotate](#rotate)
|
|
43
44
|
- [MTCaptcha](#mtcaptcha)
|
|
44
|
-
- [Friendly Captcha](#
|
|
45
|
+
- [Friendly Captcha](#friendly-captcha)
|
|
45
46
|
- [Cutcaptcha](#cutcaptcha)
|
|
46
47
|
- [Other methods](#other-methods)
|
|
47
48
|
- [send / getResult](#send--getresult)
|
|
@@ -67,7 +68,7 @@ from twocaptcha import TwoCaptcha
|
|
|
67
68
|
|
|
68
69
|
solver = TwoCaptcha('YOUR_API_KEY')
|
|
69
70
|
```
|
|
70
|
-
Also there are few options that can be configured:
|
|
71
|
+
Also there are a few options that can be configured:
|
|
71
72
|
|
|
72
73
|
```python
|
|
73
74
|
config = {
|
|
@@ -89,8 +90,8 @@ solver = TwoCaptcha(**config)
|
|
|
89
90
|
| server | `2captcha.com` | API server. You can set it to `rucaptcha.com` if your account is registered there |
|
|
90
91
|
| softId | - | your software ID obtained after publishing in [2captcha sofware catalog] |
|
|
91
92
|
| callback | - | URL of your web-sever that receives the captcha recognition result. The URl should be first registered in [pingback settings] of your account |
|
|
92
|
-
| defaultTimeout | 120 | Polling timeout in seconds for all captcha types except
|
|
93
|
-
| recaptchaTimeout | 600 | Polling timeout for
|
|
93
|
+
| 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 |
|
|
94
|
+
| recaptchaTimeout | 600 | Polling timeout for reCAPTCHA in seconds. Defines how long the module tries to get the answer from `res.php` API endpoint |
|
|
94
95
|
| pollingInterval | 10 | Interval in seconds between requests to `res.php` API endpoint, setting values less than 5 seconds is not recommended |
|
|
95
96
|
|
|
96
97
|
> **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.
|
|
@@ -115,7 +116,7 @@ When you submit any image-based captcha use can provide additional options to he
|
|
|
115
116
|
Below you can find basic examples for every captcha type. Check out [examples directory] to find more examples with all available options.
|
|
116
117
|
|
|
117
118
|
### Normal Captcha
|
|
118
|
-
To bypass a normal captcha (distorted text on image) use the following method. This method also can be used to recognize any text on the image.
|
|
119
|
+
To bypass a normal captcha (distorted text on an image) use the following method. This method also can be used to recognize any text on the image.
|
|
119
120
|
```python
|
|
120
121
|
result = solver.normal('path/to/captcha.jpg', param1=..., ...)
|
|
121
122
|
# OR
|
|
@@ -124,7 +125,7 @@ result = solver.normal('https://site-with-captcha.com/path/to/captcha.jpg', para
|
|
|
124
125
|
|
|
125
126
|
### Audio Captcha
|
|
126
127
|
To bypass an audio captcha (mp3 formats only) use the following method.
|
|
127
|
-
You must
|
|
128
|
+
You must provide the language as `lang = 'en'`. Supported languages are "en", "ru", "de", "el", "pt".
|
|
128
129
|
|
|
129
130
|
```python
|
|
130
131
|
result = solver.audio('path/to/captcha.mp3', lang = 'lang', param1=..., ...)
|
|
@@ -133,21 +134,21 @@ result = solver.audio('https://site-with-captcha.com/path/to/captcha.mp3', lang
|
|
|
133
134
|
```
|
|
134
135
|
|
|
135
136
|
### Text Captcha
|
|
136
|
-
This method can be used to bypass a captcha that requires
|
|
137
|
+
This method can be used to bypass a captcha that requires answering a question provided in clear text.
|
|
137
138
|
```python
|
|
138
139
|
result = solver.text('If tomorrow is Saturday, what day is today?', param1=..., ...)
|
|
139
140
|
```
|
|
140
141
|
|
|
141
|
-
###
|
|
142
|
-
Use this method to solve
|
|
142
|
+
### reCAPTCHA v2
|
|
143
|
+
Use this method to solve reCAPTCHA V2 and obtain a token to bypass the protection.
|
|
143
144
|
```python
|
|
144
145
|
result = solver.recaptcha(sitekey='6Le-wvkSVVABCPBMRTvw0Q4Muexq1bi0DJwx_mJ-',
|
|
145
146
|
url='https://mysite.com/page/with/recaptcha',
|
|
146
147
|
param1=..., ...)
|
|
147
148
|
```
|
|
148
149
|
|
|
149
|
-
###
|
|
150
|
-
This method provides
|
|
150
|
+
### reCAPTCHA v3
|
|
151
|
+
This method provides a reCAPTCHA V3 solver and returns a token.
|
|
151
152
|
```python
|
|
152
153
|
result = solver.recaptcha(sitekey='6Le-wvkSVVABCPBMRTvw0Q4Muexq1bi0DJwx_mJ-',
|
|
153
154
|
url='https://mysite.com/page/with/recaptcha',
|
|
@@ -177,7 +178,7 @@ result = solver.geetest(gt='f1ab2cdefa3456789012345b6c78d90e',
|
|
|
177
178
|
|
|
178
179
|
|
|
179
180
|
### hCaptcha
|
|
180
|
-
Use this method to solve hCaptcha challenge. Returns a token to bypass captcha.
|
|
181
|
+
Use this method to solve the hCaptcha challenge. Returns a token to bypass the captcha.
|
|
181
182
|
```python
|
|
182
183
|
result = solver.hcaptcha(sitekey='10000000-ffff-ffff-ffff-000000000001',
|
|
183
184
|
url='https://www.site.com/page/',
|
|
@@ -196,7 +197,7 @@ result = solver.geetest_v4(captcha_id='e392e1d7fd421dc63325744d5a2b9c73',
|
|
|
196
197
|
|
|
197
198
|
|
|
198
199
|
### Lemin Cropped Captcha
|
|
199
|
-
Use this method to solve hCaptcha challenge. Returns JSON with answer containing the following values: answer, challenge_id.
|
|
200
|
+
Use this method to solve hCaptcha challenge. Returns JSON with an answer containing the following values: answer, challenge_id.
|
|
200
201
|
```python
|
|
201
202
|
result = solver.lemin(captcha_id='CROPPED_1abcd2f_a1234b567c890d12ef3a456bc78d901d',
|
|
202
203
|
div_id='lemin-cropped-captcha',
|
|
@@ -241,6 +242,18 @@ result = solver.keycaptcha(s_s_c_user_id=10,
|
|
|
241
242
|
|
|
242
243
|
```
|
|
243
244
|
|
|
245
|
+
|
|
246
|
+
### atbCAPTCHA
|
|
247
|
+
Use this method to solve atbCaptcha challenge. Returns a token to bypass the captcha.
|
|
248
|
+
```python
|
|
249
|
+
result = solver.atb_captcha(app_id='af25e409b33d722a95e56a230ff8771c',
|
|
250
|
+
api_server='https://cap.aisecurius.com',
|
|
251
|
+
url='http://mysite.com/',
|
|
252
|
+
param1=..., ...)
|
|
253
|
+
|
|
254
|
+
```
|
|
255
|
+
|
|
256
|
+
|
|
244
257
|
### Capy
|
|
245
258
|
Token-based method to bypass Capy puzzle captcha.
|
|
246
259
|
```python
|
|
@@ -250,17 +263,19 @@ result = solver.capy(sitekey='PUZZLE_Abc1dEFghIJKLM2no34P56q7rStu8v',
|
|
|
250
263
|
param1=..., ...)
|
|
251
264
|
```
|
|
252
265
|
### Grid
|
|
253
|
-
Grid method
|
|
266
|
+
Grid method was originally called the Old reCAPTCHA V2 method. The method can be used to bypass any type of captcha where you can apply a grid on an image and click specific grid boxes. Returns numbers of boxes.
|
|
254
267
|
```python
|
|
255
268
|
result = solver.grid('path/to/captcha.jpg', param1=..., ...)
|
|
256
269
|
```
|
|
270
|
+
|
|
257
271
|
### Canvas
|
|
258
|
-
Canvas method can be used when you need to draw a line around an object on image. Returns a set of points' coordinates to draw a polygon.
|
|
272
|
+
Canvas method can be used when you need to draw a line around an object on an image. Returns a set of points' coordinates to draw a polygon.
|
|
259
273
|
```python
|
|
260
274
|
result = solver.canvas('path/to/captcha.jpg', param1=..., ...)
|
|
261
275
|
```
|
|
276
|
+
|
|
262
277
|
### ClickCaptcha
|
|
263
|
-
ClickCaptcha method returns coordinates of points on captcha image. Can be used if you need to click on particular points
|
|
278
|
+
ClickCaptcha method returns coordinates of points on the captcha image. Can be used if you need to click on particular points in the image.
|
|
264
279
|
```python
|
|
265
280
|
result = solver.coordinates('path/to/captcha.jpg', param1=..., ...)
|
|
266
281
|
```
|
|
@@ -319,7 +334,7 @@ balance = solver.balance()
|
|
|
319
334
|
```
|
|
320
335
|
|
|
321
336
|
### report
|
|
322
|
-
Use this method to report good or bad captcha
|
|
337
|
+
Use this method to report good or bad captcha answers.
|
|
323
338
|
```python
|
|
324
339
|
solver.report(id, True) # captcha solved correctly
|
|
325
340
|
solver.report(id, False) # captcha solved incorrectly
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: 2captcha-python
|
|
3
|
-
Version: 1.2.
|
|
3
|
+
Version: 1.2.4
|
|
4
4
|
Summary: Python module for easy integration with 2Captcha API
|
|
5
5
|
Home-page: https://github.com/2captcha/2captcha-python/
|
|
6
6
|
Author: 2Captcha
|
|
@@ -14,7 +14,7 @@ License-File: LICENSE
|
|
|
14
14
|
Requires-Dist: requests
|
|
15
15
|
|
|
16
16
|
# Python Module for 2Captcha API
|
|
17
|
-
The easiest way to quickly integrate
|
|
17
|
+
The easiest way to quickly integrate the 2Captcha captcha-solving service into your code and automate the solving of any type of captcha.
|
|
18
18
|
|
|
19
19
|
- [Python Module for 2Captcha API](#python-module-for-2captcha-api)
|
|
20
20
|
- [Installation](#installation)
|
|
@@ -25,8 +25,8 @@ The easiest way to quickly integrate [2Captcha] captcha solving service into you
|
|
|
25
25
|
- [Normal Captcha](#normal-captcha)
|
|
26
26
|
- [Audio Captcha](#audio-captcha)
|
|
27
27
|
- [Text Captcha](#text-captcha)
|
|
28
|
-
- [
|
|
29
|
-
- [
|
|
28
|
+
- [reCAPTCHA v2](#recaptcha-v2)
|
|
29
|
+
- [reCAPTCHA v3](#recaptcha-v3)
|
|
30
30
|
- [FunCaptcha](#funcaptcha)
|
|
31
31
|
- [GeeTest](#geetest)
|
|
32
32
|
- [hCaptcha](#hcaptcha)
|
|
@@ -35,13 +35,14 @@ The easiest way to quickly integrate [2Captcha] captcha solving service into you
|
|
|
35
35
|
- [Cloudflare Turnstile](#cloudflare-turnstile)
|
|
36
36
|
- [Amazon WAF](#amazon-waf)
|
|
37
37
|
- [KeyCaptcha](#keycaptcha)
|
|
38
|
+
- [atbCAPTCHA](#atbcaptcha)
|
|
38
39
|
- [Capy](#capy)
|
|
39
40
|
- [Grid](#grid)
|
|
40
41
|
- [Canvas](#canvas)
|
|
41
42
|
- [ClickCaptcha](#clickcaptcha)
|
|
42
43
|
- [Rotate](#rotate)
|
|
43
44
|
- [MTCaptcha](#mtcaptcha)
|
|
44
|
-
- [Friendly Captcha](#
|
|
45
|
+
- [Friendly Captcha](#friendly-captcha)
|
|
45
46
|
- [Cutcaptcha](#cutcaptcha)
|
|
46
47
|
- [Other methods](#other-methods)
|
|
47
48
|
- [send / getResult](#send--getresult)
|
|
@@ -67,7 +68,7 @@ from twocaptcha import TwoCaptcha
|
|
|
67
68
|
|
|
68
69
|
solver = TwoCaptcha('YOUR_API_KEY')
|
|
69
70
|
```
|
|
70
|
-
Also there are few options that can be configured:
|
|
71
|
+
Also there are a few options that can be configured:
|
|
71
72
|
|
|
72
73
|
```python
|
|
73
74
|
config = {
|
|
@@ -89,8 +90,8 @@ solver = TwoCaptcha(**config)
|
|
|
89
90
|
| server | `2captcha.com` | API server. You can set it to `rucaptcha.com` if your account is registered there |
|
|
90
91
|
| softId | - | your software ID obtained after publishing in [2captcha sofware catalog] |
|
|
91
92
|
| callback | - | URL of your web-sever that receives the captcha recognition result. The URl should be first registered in [pingback settings] of your account |
|
|
92
|
-
| defaultTimeout | 120 | Polling timeout in seconds for all captcha types except
|
|
93
|
-
| recaptchaTimeout | 600 | Polling timeout for
|
|
93
|
+
| 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 |
|
|
94
|
+
| recaptchaTimeout | 600 | Polling timeout for reCAPTCHA in seconds. Defines how long the module tries to get the answer from `res.php` API endpoint |
|
|
94
95
|
| pollingInterval | 10 | Interval in seconds between requests to `res.php` API endpoint, setting values less than 5 seconds is not recommended |
|
|
95
96
|
|
|
96
97
|
> **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.
|
|
@@ -115,7 +116,7 @@ When you submit any image-based captcha use can provide additional options to he
|
|
|
115
116
|
Below you can find basic examples for every captcha type. Check out [examples directory] to find more examples with all available options.
|
|
116
117
|
|
|
117
118
|
### Normal Captcha
|
|
118
|
-
To bypass a normal captcha (distorted text on image) use the following method. This method also can be used to recognize any text on the image.
|
|
119
|
+
To bypass a normal captcha (distorted text on an image) use the following method. This method also can be used to recognize any text on the image.
|
|
119
120
|
```python
|
|
120
121
|
result = solver.normal('path/to/captcha.jpg', param1=..., ...)
|
|
121
122
|
# OR
|
|
@@ -124,7 +125,7 @@ result = solver.normal('https://site-with-captcha.com/path/to/captcha.jpg', para
|
|
|
124
125
|
|
|
125
126
|
### Audio Captcha
|
|
126
127
|
To bypass an audio captcha (mp3 formats only) use the following method.
|
|
127
|
-
You must
|
|
128
|
+
You must provide the language as `lang = 'en'`. Supported languages are "en", "ru", "de", "el", "pt".
|
|
128
129
|
|
|
129
130
|
```python
|
|
130
131
|
result = solver.audio('path/to/captcha.mp3', lang = 'lang', param1=..., ...)
|
|
@@ -133,21 +134,21 @@ result = solver.audio('https://site-with-captcha.com/path/to/captcha.mp3', lang
|
|
|
133
134
|
```
|
|
134
135
|
|
|
135
136
|
### Text Captcha
|
|
136
|
-
This method can be used to bypass a captcha that requires
|
|
137
|
+
This method can be used to bypass a captcha that requires answering a question provided in clear text.
|
|
137
138
|
```python
|
|
138
139
|
result = solver.text('If tomorrow is Saturday, what day is today?', param1=..., ...)
|
|
139
140
|
```
|
|
140
141
|
|
|
141
|
-
###
|
|
142
|
-
Use this method to solve
|
|
142
|
+
### reCAPTCHA v2
|
|
143
|
+
Use this method to solve reCAPTCHA V2 and obtain a token to bypass the protection.
|
|
143
144
|
```python
|
|
144
145
|
result = solver.recaptcha(sitekey='6Le-wvkSVVABCPBMRTvw0Q4Muexq1bi0DJwx_mJ-',
|
|
145
146
|
url='https://mysite.com/page/with/recaptcha',
|
|
146
147
|
param1=..., ...)
|
|
147
148
|
```
|
|
148
149
|
|
|
149
|
-
###
|
|
150
|
-
This method provides
|
|
150
|
+
### reCAPTCHA v3
|
|
151
|
+
This method provides a reCAPTCHA V3 solver and returns a token.
|
|
151
152
|
```python
|
|
152
153
|
result = solver.recaptcha(sitekey='6Le-wvkSVVABCPBMRTvw0Q4Muexq1bi0DJwx_mJ-',
|
|
153
154
|
url='https://mysite.com/page/with/recaptcha',
|
|
@@ -177,7 +178,7 @@ result = solver.geetest(gt='f1ab2cdefa3456789012345b6c78d90e',
|
|
|
177
178
|
|
|
178
179
|
|
|
179
180
|
### hCaptcha
|
|
180
|
-
Use this method to solve hCaptcha challenge. Returns a token to bypass captcha.
|
|
181
|
+
Use this method to solve the hCaptcha challenge. Returns a token to bypass the captcha.
|
|
181
182
|
```python
|
|
182
183
|
result = solver.hcaptcha(sitekey='10000000-ffff-ffff-ffff-000000000001',
|
|
183
184
|
url='https://www.site.com/page/',
|
|
@@ -196,7 +197,7 @@ result = solver.geetest_v4(captcha_id='e392e1d7fd421dc63325744d5a2b9c73',
|
|
|
196
197
|
|
|
197
198
|
|
|
198
199
|
### Lemin Cropped Captcha
|
|
199
|
-
Use this method to solve hCaptcha challenge. Returns JSON with answer containing the following values: answer, challenge_id.
|
|
200
|
+
Use this method to solve hCaptcha challenge. Returns JSON with an answer containing the following values: answer, challenge_id.
|
|
200
201
|
```python
|
|
201
202
|
result = solver.lemin(captcha_id='CROPPED_1abcd2f_a1234b567c890d12ef3a456bc78d901d',
|
|
202
203
|
div_id='lemin-cropped-captcha',
|
|
@@ -241,6 +242,18 @@ result = solver.keycaptcha(s_s_c_user_id=10,
|
|
|
241
242
|
|
|
242
243
|
```
|
|
243
244
|
|
|
245
|
+
|
|
246
|
+
### atbCAPTCHA
|
|
247
|
+
Use this method to solve atbCaptcha challenge. Returns a token to bypass the captcha.
|
|
248
|
+
```python
|
|
249
|
+
result = solver.atb_captcha(app_id='af25e409b33d722a95e56a230ff8771c',
|
|
250
|
+
api_server='https://cap.aisecurius.com',
|
|
251
|
+
url='http://mysite.com/',
|
|
252
|
+
param1=..., ...)
|
|
253
|
+
|
|
254
|
+
```
|
|
255
|
+
|
|
256
|
+
|
|
244
257
|
### Capy
|
|
245
258
|
Token-based method to bypass Capy puzzle captcha.
|
|
246
259
|
```python
|
|
@@ -250,17 +263,19 @@ result = solver.capy(sitekey='PUZZLE_Abc1dEFghIJKLM2no34P56q7rStu8v',
|
|
|
250
263
|
param1=..., ...)
|
|
251
264
|
```
|
|
252
265
|
### Grid
|
|
253
|
-
Grid method
|
|
266
|
+
Grid method was originally called the Old reCAPTCHA V2 method. The method can be used to bypass any type of captcha where you can apply a grid on an image and click specific grid boxes. Returns numbers of boxes.
|
|
254
267
|
```python
|
|
255
268
|
result = solver.grid('path/to/captcha.jpg', param1=..., ...)
|
|
256
269
|
```
|
|
270
|
+
|
|
257
271
|
### Canvas
|
|
258
|
-
Canvas method can be used when you need to draw a line around an object on image. Returns a set of points' coordinates to draw a polygon.
|
|
272
|
+
Canvas method can be used when you need to draw a line around an object on an image. Returns a set of points' coordinates to draw a polygon.
|
|
259
273
|
```python
|
|
260
274
|
result = solver.canvas('path/to/captcha.jpg', param1=..., ...)
|
|
261
275
|
```
|
|
276
|
+
|
|
262
277
|
### ClickCaptcha
|
|
263
|
-
ClickCaptcha method returns coordinates of points on captcha image. Can be used if you need to click on particular points
|
|
278
|
+
ClickCaptcha method returns coordinates of points on the captcha image. Can be used if you need to click on particular points in the image.
|
|
264
279
|
```python
|
|
265
280
|
result = solver.coordinates('path/to/captcha.jpg', param1=..., ...)
|
|
266
281
|
```
|
|
@@ -319,7 +334,7 @@ balance = solver.balance()
|
|
|
319
334
|
```
|
|
320
335
|
|
|
321
336
|
### report
|
|
322
|
-
Use this method to report good or bad captcha
|
|
337
|
+
Use this method to report good or bad captcha answers.
|
|
323
338
|
```python
|
|
324
339
|
solver.report(id, True) # captcha solved correctly
|
|
325
340
|
solver.report(id, False) # captcha solved incorrectly
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# Python Module for 2Captcha API
|
|
2
|
-
The easiest way to quickly integrate
|
|
2
|
+
The easiest way to quickly integrate the 2Captcha captcha-solving service into your code and automate the solving of any type of captcha.
|
|
3
3
|
|
|
4
4
|
- [Python Module for 2Captcha API](#python-module-for-2captcha-api)
|
|
5
5
|
- [Installation](#installation)
|
|
@@ -10,8 +10,8 @@ The easiest way to quickly integrate [2Captcha] captcha solving service into you
|
|
|
10
10
|
- [Normal Captcha](#normal-captcha)
|
|
11
11
|
- [Audio Captcha](#audio-captcha)
|
|
12
12
|
- [Text Captcha](#text-captcha)
|
|
13
|
-
- [
|
|
14
|
-
- [
|
|
13
|
+
- [reCAPTCHA v2](#recaptcha-v2)
|
|
14
|
+
- [reCAPTCHA v3](#recaptcha-v3)
|
|
15
15
|
- [FunCaptcha](#funcaptcha)
|
|
16
16
|
- [GeeTest](#geetest)
|
|
17
17
|
- [hCaptcha](#hcaptcha)
|
|
@@ -20,13 +20,14 @@ The easiest way to quickly integrate [2Captcha] captcha solving service into you
|
|
|
20
20
|
- [Cloudflare Turnstile](#cloudflare-turnstile)
|
|
21
21
|
- [Amazon WAF](#amazon-waf)
|
|
22
22
|
- [KeyCaptcha](#keycaptcha)
|
|
23
|
+
- [atbCAPTCHA](#atbcaptcha)
|
|
23
24
|
- [Capy](#capy)
|
|
24
25
|
- [Grid](#grid)
|
|
25
26
|
- [Canvas](#canvas)
|
|
26
27
|
- [ClickCaptcha](#clickcaptcha)
|
|
27
28
|
- [Rotate](#rotate)
|
|
28
29
|
- [MTCaptcha](#mtcaptcha)
|
|
29
|
-
- [Friendly Captcha](#
|
|
30
|
+
- [Friendly Captcha](#friendly-captcha)
|
|
30
31
|
- [Cutcaptcha](#cutcaptcha)
|
|
31
32
|
- [Other methods](#other-methods)
|
|
32
33
|
- [send / getResult](#send--getresult)
|
|
@@ -52,7 +53,7 @@ from twocaptcha import TwoCaptcha
|
|
|
52
53
|
|
|
53
54
|
solver = TwoCaptcha('YOUR_API_KEY')
|
|
54
55
|
```
|
|
55
|
-
Also there are few options that can be configured:
|
|
56
|
+
Also there are a few options that can be configured:
|
|
56
57
|
|
|
57
58
|
```python
|
|
58
59
|
config = {
|
|
@@ -74,8 +75,8 @@ solver = TwoCaptcha(**config)
|
|
|
74
75
|
| server | `2captcha.com` | API server. You can set it to `rucaptcha.com` if your account is registered there |
|
|
75
76
|
| softId | - | your software ID obtained after publishing in [2captcha sofware catalog] |
|
|
76
77
|
| callback | - | URL of your web-sever that receives the captcha recognition result. The URl should be first registered in [pingback settings] of your account |
|
|
77
|
-
| defaultTimeout | 120 | Polling timeout in seconds for all captcha types except
|
|
78
|
-
| recaptchaTimeout | 600 | Polling timeout for
|
|
78
|
+
| 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 |
|
|
79
|
+
| recaptchaTimeout | 600 | Polling timeout for reCAPTCHA in seconds. Defines how long the module tries to get the answer from `res.php` API endpoint |
|
|
79
80
|
| pollingInterval | 10 | Interval in seconds between requests to `res.php` API endpoint, setting values less than 5 seconds is not recommended |
|
|
80
81
|
|
|
81
82
|
> **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.
|
|
@@ -100,7 +101,7 @@ When you submit any image-based captcha use can provide additional options to he
|
|
|
100
101
|
Below you can find basic examples for every captcha type. Check out [examples directory] to find more examples with all available options.
|
|
101
102
|
|
|
102
103
|
### Normal Captcha
|
|
103
|
-
To bypass a normal captcha (distorted text on image) use the following method. This method also can be used to recognize any text on the image.
|
|
104
|
+
To bypass a normal captcha (distorted text on an image) use the following method. This method also can be used to recognize any text on the image.
|
|
104
105
|
```python
|
|
105
106
|
result = solver.normal('path/to/captcha.jpg', param1=..., ...)
|
|
106
107
|
# OR
|
|
@@ -109,7 +110,7 @@ result = solver.normal('https://site-with-captcha.com/path/to/captcha.jpg', para
|
|
|
109
110
|
|
|
110
111
|
### Audio Captcha
|
|
111
112
|
To bypass an audio captcha (mp3 formats only) use the following method.
|
|
112
|
-
You must
|
|
113
|
+
You must provide the language as `lang = 'en'`. Supported languages are "en", "ru", "de", "el", "pt".
|
|
113
114
|
|
|
114
115
|
```python
|
|
115
116
|
result = solver.audio('path/to/captcha.mp3', lang = 'lang', param1=..., ...)
|
|
@@ -118,21 +119,21 @@ result = solver.audio('https://site-with-captcha.com/path/to/captcha.mp3', lang
|
|
|
118
119
|
```
|
|
119
120
|
|
|
120
121
|
### Text Captcha
|
|
121
|
-
This method can be used to bypass a captcha that requires
|
|
122
|
+
This method can be used to bypass a captcha that requires answering a question provided in clear text.
|
|
122
123
|
```python
|
|
123
124
|
result = solver.text('If tomorrow is Saturday, what day is today?', param1=..., ...)
|
|
124
125
|
```
|
|
125
126
|
|
|
126
|
-
###
|
|
127
|
-
Use this method to solve
|
|
127
|
+
### reCAPTCHA v2
|
|
128
|
+
Use this method to solve reCAPTCHA V2 and obtain a token to bypass the protection.
|
|
128
129
|
```python
|
|
129
130
|
result = solver.recaptcha(sitekey='6Le-wvkSVVABCPBMRTvw0Q4Muexq1bi0DJwx_mJ-',
|
|
130
131
|
url='https://mysite.com/page/with/recaptcha',
|
|
131
132
|
param1=..., ...)
|
|
132
133
|
```
|
|
133
134
|
|
|
134
|
-
###
|
|
135
|
-
This method provides
|
|
135
|
+
### reCAPTCHA v3
|
|
136
|
+
This method provides a reCAPTCHA V3 solver and returns a token.
|
|
136
137
|
```python
|
|
137
138
|
result = solver.recaptcha(sitekey='6Le-wvkSVVABCPBMRTvw0Q4Muexq1bi0DJwx_mJ-',
|
|
138
139
|
url='https://mysite.com/page/with/recaptcha',
|
|
@@ -162,7 +163,7 @@ result = solver.geetest(gt='f1ab2cdefa3456789012345b6c78d90e',
|
|
|
162
163
|
|
|
163
164
|
|
|
164
165
|
### hCaptcha
|
|
165
|
-
Use this method to solve hCaptcha challenge. Returns a token to bypass captcha.
|
|
166
|
+
Use this method to solve the hCaptcha challenge. Returns a token to bypass the captcha.
|
|
166
167
|
```python
|
|
167
168
|
result = solver.hcaptcha(sitekey='10000000-ffff-ffff-ffff-000000000001',
|
|
168
169
|
url='https://www.site.com/page/',
|
|
@@ -181,7 +182,7 @@ result = solver.geetest_v4(captcha_id='e392e1d7fd421dc63325744d5a2b9c73',
|
|
|
181
182
|
|
|
182
183
|
|
|
183
184
|
### Lemin Cropped Captcha
|
|
184
|
-
Use this method to solve hCaptcha challenge. Returns JSON with answer containing the following values: answer, challenge_id.
|
|
185
|
+
Use this method to solve hCaptcha challenge. Returns JSON with an answer containing the following values: answer, challenge_id.
|
|
185
186
|
```python
|
|
186
187
|
result = solver.lemin(captcha_id='CROPPED_1abcd2f_a1234b567c890d12ef3a456bc78d901d',
|
|
187
188
|
div_id='lemin-cropped-captcha',
|
|
@@ -226,6 +227,18 @@ result = solver.keycaptcha(s_s_c_user_id=10,
|
|
|
226
227
|
|
|
227
228
|
```
|
|
228
229
|
|
|
230
|
+
|
|
231
|
+
### atbCAPTCHA
|
|
232
|
+
Use this method to solve atbCaptcha challenge. Returns a token to bypass the captcha.
|
|
233
|
+
```python
|
|
234
|
+
result = solver.atb_captcha(app_id='af25e409b33d722a95e56a230ff8771c',
|
|
235
|
+
api_server='https://cap.aisecurius.com',
|
|
236
|
+
url='http://mysite.com/',
|
|
237
|
+
param1=..., ...)
|
|
238
|
+
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
|
|
229
242
|
### Capy
|
|
230
243
|
Token-based method to bypass Capy puzzle captcha.
|
|
231
244
|
```python
|
|
@@ -235,17 +248,19 @@ result = solver.capy(sitekey='PUZZLE_Abc1dEFghIJKLM2no34P56q7rStu8v',
|
|
|
235
248
|
param1=..., ...)
|
|
236
249
|
```
|
|
237
250
|
### Grid
|
|
238
|
-
Grid method
|
|
251
|
+
Grid method was originally called the Old reCAPTCHA V2 method. The method can be used to bypass any type of captcha where you can apply a grid on an image and click specific grid boxes. Returns numbers of boxes.
|
|
239
252
|
```python
|
|
240
253
|
result = solver.grid('path/to/captcha.jpg', param1=..., ...)
|
|
241
254
|
```
|
|
255
|
+
|
|
242
256
|
### Canvas
|
|
243
|
-
Canvas method can be used when you need to draw a line around an object on image. Returns a set of points' coordinates to draw a polygon.
|
|
257
|
+
Canvas method can be used when you need to draw a line around an object on an image. Returns a set of points' coordinates to draw a polygon.
|
|
244
258
|
```python
|
|
245
259
|
result = solver.canvas('path/to/captcha.jpg', param1=..., ...)
|
|
246
260
|
```
|
|
261
|
+
|
|
247
262
|
### ClickCaptcha
|
|
248
|
-
ClickCaptcha method returns coordinates of points on captcha image. Can be used if you need to click on particular points
|
|
263
|
+
ClickCaptcha method returns coordinates of points on the captcha image. Can be used if you need to click on particular points in the image.
|
|
249
264
|
```python
|
|
250
265
|
result = solver.coordinates('path/to/captcha.jpg', param1=..., ...)
|
|
251
266
|
```
|
|
@@ -304,7 +319,7 @@ balance = solver.balance()
|
|
|
304
319
|
```
|
|
305
320
|
|
|
306
321
|
### report
|
|
307
|
-
Use this method to report good or bad captcha
|
|
322
|
+
Use this method to report good or bad captcha answers.
|
|
308
323
|
```python
|
|
309
324
|
solver.report(id, True) # captcha solved correctly
|
|
310
325
|
solver.report(id, False) # captcha solved incorrectly
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
|
|
3
|
+
import unittest
|
|
4
|
+
|
|
5
|
+
try:
|
|
6
|
+
from .abstract import AbstractTest
|
|
7
|
+
except ImportError:
|
|
8
|
+
from abstract import AbstractTest
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class AtbCaptchaTest(AbstractTest):
|
|
12
|
+
|
|
13
|
+
def test_all_params(self):
|
|
14
|
+
params = {
|
|
15
|
+
'app_id': 'af25e409b33d722a95e56a230ff8771c',
|
|
16
|
+
'api_server': 'https://cap.aisecurius.com',
|
|
17
|
+
'url': 'http://mysite.com/'
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
sends = {
|
|
21
|
+
'method': 'atb_captcha',
|
|
22
|
+
'app_id': 'af25e409b33d722a95e56a230ff8771c',
|
|
23
|
+
'api_server': 'https://cap.aisecurius.com',
|
|
24
|
+
'pageurl': 'http://mysite.com/'
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
return self.send_return(sends, self.solver.atb_captcha, **params)
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
if __name__ == '__main__':
|
|
31
|
+
unittest.main()
|
|
@@ -36,7 +36,7 @@ class TimeoutException(SolverExceptions):
|
|
|
36
36
|
class TwoCaptcha():
|
|
37
37
|
def __init__(self,
|
|
38
38
|
apiKey,
|
|
39
|
-
softId=
|
|
39
|
+
softId=4580,
|
|
40
40
|
callback=None,
|
|
41
41
|
defaultTimeout=120,
|
|
42
42
|
recaptchaTimeout=600,
|
|
@@ -457,6 +457,26 @@ class TwoCaptcha():
|
|
|
457
457
|
method='lemin',
|
|
458
458
|
**kwargs)
|
|
459
459
|
return result
|
|
460
|
+
|
|
461
|
+
def atb_captcha(self, app_id, api_server, url, **kwargs):
|
|
462
|
+
'''
|
|
463
|
+
Wrapper for solving atbCAPTCHA
|
|
464
|
+
|
|
465
|
+
Required:
|
|
466
|
+
app_id
|
|
467
|
+
api_server
|
|
468
|
+
url
|
|
469
|
+
|
|
470
|
+
Optional params:
|
|
471
|
+
|
|
472
|
+
|
|
473
|
+
'''
|
|
474
|
+
result = self.solve(app_id=app_id,
|
|
475
|
+
api_server=api_server,
|
|
476
|
+
url=url,
|
|
477
|
+
method='atb_captcha',
|
|
478
|
+
**kwargs)
|
|
479
|
+
return result
|
|
460
480
|
|
|
461
481
|
|
|
462
482
|
def turnstile(self, sitekey, url, **kwargs):
|
{2captcha-python-1.2.3 → 2captcha-python-1.2.4}/2captcha_python.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|