2captcha-python 1.2.2__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.
Files changed (33) hide show
  1. {2captcha-python-1.2.2 → 2captcha-python-1.2.4}/2captcha_python.egg-info/PKG-INFO +64 -20
  2. {2captcha-python-1.2.2 → 2captcha-python-1.2.4}/2captcha_python.egg-info/SOURCES.txt +4 -0
  3. {2captcha-python-1.2.2 → 2captcha-python-1.2.4}/PKG-INFO +64 -20
  4. {2captcha-python-1.2.2 → 2captcha-python-1.2.4}/README.md +63 -19
  5. 2captcha-python-1.2.4/tests/test_atb_captcha.py +31 -0
  6. 2captcha-python-1.2.4/tests/test_cutcaptcha.py +31 -0
  7. 2captcha-python-1.2.4/tests/test_friendly_captcha.py +29 -0
  8. 2captcha-python-1.2.4/tests/test_mtcaptcha.py +29 -0
  9. {2captcha-python-1.2.2 → 2captcha-python-1.2.4}/twocaptcha/__init__.py +1 -1
  10. {2captcha-python-1.2.2 → 2captcha-python-1.2.4}/twocaptcha/solver.py +81 -1
  11. {2captcha-python-1.2.2 → 2captcha-python-1.2.4}/2captcha_python.egg-info/dependency_links.txt +0 -0
  12. {2captcha-python-1.2.2 → 2captcha-python-1.2.4}/2captcha_python.egg-info/requires.txt +0 -0
  13. {2captcha-python-1.2.2 → 2captcha-python-1.2.4}/2captcha_python.egg-info/top_level.txt +0 -0
  14. {2captcha-python-1.2.2 → 2captcha-python-1.2.4}/LICENSE +0 -0
  15. {2captcha-python-1.2.2 → 2captcha-python-1.2.4}/setup.cfg +0 -0
  16. {2captcha-python-1.2.2 → 2captcha-python-1.2.4}/setup.py +0 -0
  17. {2captcha-python-1.2.2 → 2captcha-python-1.2.4}/tests/test_amazon_waf.py +0 -0
  18. {2captcha-python-1.2.2 → 2captcha-python-1.2.4}/tests/test_canvas.py +0 -0
  19. {2captcha-python-1.2.2 → 2captcha-python-1.2.4}/tests/test_capy.py +0 -0
  20. {2captcha-python-1.2.2 → 2captcha-python-1.2.4}/tests/test_coordinates.py +0 -0
  21. {2captcha-python-1.2.2 → 2captcha-python-1.2.4}/tests/test_funcaptcha.py +0 -0
  22. {2captcha-python-1.2.2 → 2captcha-python-1.2.4}/tests/test_geetest.py +0 -0
  23. {2captcha-python-1.2.2 → 2captcha-python-1.2.4}/tests/test_geetest_v4.py +0 -0
  24. {2captcha-python-1.2.2 → 2captcha-python-1.2.4}/tests/test_grid.py +0 -0
  25. {2captcha-python-1.2.2 → 2captcha-python-1.2.4}/tests/test_hcaptcha.py +0 -0
  26. {2captcha-python-1.2.2 → 2captcha-python-1.2.4}/tests/test_keycaptcha.py +0 -0
  27. {2captcha-python-1.2.2 → 2captcha-python-1.2.4}/tests/test_lemin.py +0 -0
  28. {2captcha-python-1.2.2 → 2captcha-python-1.2.4}/tests/test_normal.py +0 -0
  29. {2captcha-python-1.2.2 → 2captcha-python-1.2.4}/tests/test_recaptcha.py +0 -0
  30. {2captcha-python-1.2.2 → 2captcha-python-1.2.4}/tests/test_rotate.py +0 -0
  31. {2captcha-python-1.2.2 → 2captcha-python-1.2.4}/tests/test_text.py +0 -0
  32. {2captcha-python-1.2.2 → 2captcha-python-1.2.4}/tests/test_turnstile.py +0 -0
  33. {2captcha-python-1.2.2 → 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.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 [2Captcha] captcha solving service into your code to automate solving of any types of captcha.
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
- - [ReCaptcha v2](#recaptcha-v2)
29
- - [ReCaptcha v3](#recaptcha-v3)
28
+ - [reCAPTCHA v2](#recaptcha-v2)
29
+ - [reCAPTCHA v3](#recaptcha-v3)
30
30
  - [FunCaptcha](#funcaptcha)
31
31
  - [GeeTest](#geetest)
32
32
  - [hCaptcha](#hcaptcha)
@@ -35,11 +35,15 @@ 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)
44
+ - [MTCaptcha](#mtcaptcha)
45
+ - [Friendly Captcha](#friendly-captcha)
46
+ - [Cutcaptcha](#cutcaptcha)
43
47
  - [Other methods](#other-methods)
44
48
  - [send / getResult](#send--getresult)
45
49
  - [balance](#balance)
@@ -64,7 +68,7 @@ from twocaptcha import TwoCaptcha
64
68
 
65
69
  solver = TwoCaptcha('YOUR_API_KEY')
66
70
  ```
67
- Also there are few options that can be configured:
71
+ Also there are a few options that can be configured:
68
72
 
69
73
  ```python
70
74
  config = {
@@ -86,8 +90,8 @@ solver = TwoCaptcha(**config)
86
90
  | server | `2captcha.com` | API server. You can set it to `rucaptcha.com` if your account is registered there |
87
91
  | softId | - | your software ID obtained after publishing in [2captcha sofware catalog] |
88
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 |
89
- | 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 |
90
- | recaptchaTimeout | 600 | Polling timeout for ReCaptcha in seconds. Defines how long the module tries to get the answer from `res.php` API endpoint |
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 |
91
95
  | pollingInterval | 10 | Interval in seconds between requests to `res.php` API endpoint, setting values less than 5 seconds is not recommended |
92
96
 
93
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.
@@ -112,7 +116,7 @@ When you submit any image-based captcha use can provide additional options to he
112
116
  Below you can find basic examples for every captcha type. Check out [examples directory] to find more examples with all available options.
113
117
 
114
118
  ### Normal Captcha
115
- 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.
116
120
  ```python
117
121
  result = solver.normal('path/to/captcha.jpg', param1=..., ...)
118
122
  # OR
@@ -121,7 +125,7 @@ result = solver.normal('https://site-with-captcha.com/path/to/captcha.jpg', para
121
125
 
122
126
  ### Audio Captcha
123
127
  To bypass an audio captcha (mp3 formats only) use the following method.
124
- You must provife the language as `lang = 'en'`. Supported languages are "en", "ru", "de", "el", "pt".
128
+ You must provide the language as `lang = 'en'`. Supported languages are "en", "ru", "de", "el", "pt".
125
129
 
126
130
  ```python
127
131
  result = solver.audio('path/to/captcha.mp3', lang = 'lang', param1=..., ...)
@@ -130,21 +134,21 @@ result = solver.audio('https://site-with-captcha.com/path/to/captcha.mp3', lang
130
134
  ```
131
135
 
132
136
  ### Text Captcha
133
- This method can be used to bypass a captcha that requires to answer a question provided in clear text.
137
+ This method can be used to bypass a captcha that requires answering a question provided in clear text.
134
138
  ```python
135
139
  result = solver.text('If tomorrow is Saturday, what day is today?', param1=..., ...)
136
140
  ```
137
141
 
138
- ### ReCaptcha v2
139
- Use this method to solve ReCaptcha V2 and obtain a token to bypass the protection.
142
+ ### reCAPTCHA v2
143
+ Use this method to solve reCAPTCHA V2 and obtain a token to bypass the protection.
140
144
  ```python
141
145
  result = solver.recaptcha(sitekey='6Le-wvkSVVABCPBMRTvw0Q4Muexq1bi0DJwx_mJ-',
142
146
  url='https://mysite.com/page/with/recaptcha',
143
147
  param1=..., ...)
144
148
  ```
145
149
 
146
- ### ReCaptcha v3
147
- This method provides ReCaptcha V3 solver and returns a token.
150
+ ### reCAPTCHA v3
151
+ This method provides a reCAPTCHA V3 solver and returns a token.
148
152
  ```python
149
153
  result = solver.recaptcha(sitekey='6Le-wvkSVVABCPBMRTvw0Q4Muexq1bi0DJwx_mJ-',
150
154
  url='https://mysite.com/page/with/recaptcha',
@@ -174,7 +178,7 @@ result = solver.geetest(gt='f1ab2cdefa3456789012345b6c78d90e',
174
178
 
175
179
 
176
180
  ### hCaptcha
177
- 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.
178
182
  ```python
179
183
  result = solver.hcaptcha(sitekey='10000000-ffff-ffff-ffff-000000000001',
180
184
  url='https://www.site.com/page/',
@@ -193,7 +197,7 @@ result = solver.geetest_v4(captcha_id='e392e1d7fd421dc63325744d5a2b9c73',
193
197
 
194
198
 
195
199
  ### Lemin Cropped Captcha
196
- 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.
197
201
  ```python
198
202
  result = solver.lemin(captcha_id='CROPPED_1abcd2f_a1234b567c890d12ef3a456bc78d901d',
199
203
  div_id='lemin-cropped-captcha',
@@ -238,6 +242,18 @@ result = solver.keycaptcha(s_s_c_user_id=10,
238
242
 
239
243
  ```
240
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
+
241
257
  ### Capy
242
258
  Token-based method to bypass Capy puzzle captcha.
243
259
  ```python
@@ -247,17 +263,19 @@ result = solver.capy(sitekey='PUZZLE_Abc1dEFghIJKLM2no34P56q7rStu8v',
247
263
  param1=..., ...)
248
264
  ```
249
265
  ### Grid
250
- Grid method is originally called Old ReCaptcha V2 method. The method can be used to bypass any type of captcha where you can apply a grid on image and need to click specific grid boxes. Returns numbers of boxes.
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.
251
267
  ```python
252
268
  result = solver.grid('path/to/captcha.jpg', param1=..., ...)
253
269
  ```
270
+
254
271
  ### Canvas
255
- 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.
256
273
  ```python
257
274
  result = solver.canvas('path/to/captcha.jpg', param1=..., ...)
258
275
  ```
276
+
259
277
  ### ClickCaptcha
260
- ClickCaptcha method returns coordinates of points on captcha image. Can be used if you need to click on particular points on the image.
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.
261
279
  ```python
262
280
  result = solver.coordinates('path/to/captcha.jpg', param1=..., ...)
263
281
  ```
@@ -268,6 +286,32 @@ This method can be used to solve a captcha that asks to rotate an object. Mostly
268
286
  result = solver.rotate('path/to/captcha.jpg', param1=..., ...)
269
287
  ```
270
288
 
289
+ ### MTCaptcha
290
+ Use this method to solve MTCaptcha and obtain a token to bypass the protection.
291
+ ```python
292
+ result = solver.mtcaptcha(sitekey='MTPublic-KzqLY1cKH',
293
+ url='https://2captcha.com/demo/mtcaptcha',
294
+ param1=..., ...)
295
+ ```
296
+
297
+ ### Friendly Captcha
298
+ Friendly Captcha solving method. Returns a token.
299
+ ```python
300
+ result = solver.friendly_captcha(sitekey='FCMGEMUD2KTDSQ5H',
301
+ url='https://friendlycaptcha.com/demo',
302
+ param1=..., ...)
303
+ ```
304
+
305
+ ### Cutcaptcha
306
+ Use this method to solve Cutcaptcha. Returns the response in JSON.
307
+ ```python
308
+ result = solver.cutcaptcha(misery_key='ad52c87af17e2ec09b8d918c9f00416b1cb8c320',
309
+ apikey='SAs61IAI',
310
+ url='https://mysite.com/page/with/cutcaptcha',
311
+ param1=..., ...)
312
+ ```
313
+
314
+
271
315
  ## Other methods
272
316
 
273
317
  ### send / getResult
@@ -290,7 +334,7 @@ balance = solver.balance()
290
334
  ```
291
335
 
292
336
  ### report
293
- Use this method to report good or bad captcha answer.
337
+ Use this method to report good or bad captcha answers.
294
338
  ```python
295
339
  solver.report(id, True) # captcha solved correctly
296
340
  solver.report(id, False) # captcha solved incorrectly
@@ -7,9 +7,12 @@ setup.py
7
7
  2captcha_python.egg-info/requires.txt
8
8
  2captcha_python.egg-info/top_level.txt
9
9
  tests/test_amazon_waf.py
10
+ tests/test_atb_captcha.py
10
11
  tests/test_canvas.py
11
12
  tests/test_capy.py
12
13
  tests/test_coordinates.py
14
+ tests/test_cutcaptcha.py
15
+ tests/test_friendly_captcha.py
13
16
  tests/test_funcaptcha.py
14
17
  tests/test_geetest.py
15
18
  tests/test_geetest_v4.py
@@ -17,6 +20,7 @@ tests/test_grid.py
17
20
  tests/test_hcaptcha.py
18
21
  tests/test_keycaptcha.py
19
22
  tests/test_lemin.py
23
+ tests/test_mtcaptcha.py
20
24
  tests/test_normal.py
21
25
  tests/test_recaptcha.py
22
26
  tests/test_rotate.py
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: 2captcha-python
3
- Version: 1.2.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 [2Captcha] captcha solving service into your code to automate solving of any types of captcha.
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
- - [ReCaptcha v2](#recaptcha-v2)
29
- - [ReCaptcha v3](#recaptcha-v3)
28
+ - [reCAPTCHA v2](#recaptcha-v2)
29
+ - [reCAPTCHA v3](#recaptcha-v3)
30
30
  - [FunCaptcha](#funcaptcha)
31
31
  - [GeeTest](#geetest)
32
32
  - [hCaptcha](#hcaptcha)
@@ -35,11 +35,15 @@ 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)
44
+ - [MTCaptcha](#mtcaptcha)
45
+ - [Friendly Captcha](#friendly-captcha)
46
+ - [Cutcaptcha](#cutcaptcha)
43
47
  - [Other methods](#other-methods)
44
48
  - [send / getResult](#send--getresult)
45
49
  - [balance](#balance)
@@ -64,7 +68,7 @@ from twocaptcha import TwoCaptcha
64
68
 
65
69
  solver = TwoCaptcha('YOUR_API_KEY')
66
70
  ```
67
- Also there are few options that can be configured:
71
+ Also there are a few options that can be configured:
68
72
 
69
73
  ```python
70
74
  config = {
@@ -86,8 +90,8 @@ solver = TwoCaptcha(**config)
86
90
  | server | `2captcha.com` | API server. You can set it to `rucaptcha.com` if your account is registered there |
87
91
  | softId | - | your software ID obtained after publishing in [2captcha sofware catalog] |
88
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 |
89
- | 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 |
90
- | recaptchaTimeout | 600 | Polling timeout for ReCaptcha in seconds. Defines how long the module tries to get the answer from `res.php` API endpoint |
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 |
91
95
  | pollingInterval | 10 | Interval in seconds between requests to `res.php` API endpoint, setting values less than 5 seconds is not recommended |
92
96
 
93
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.
@@ -112,7 +116,7 @@ When you submit any image-based captcha use can provide additional options to he
112
116
  Below you can find basic examples for every captcha type. Check out [examples directory] to find more examples with all available options.
113
117
 
114
118
  ### Normal Captcha
115
- 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.
116
120
  ```python
117
121
  result = solver.normal('path/to/captcha.jpg', param1=..., ...)
118
122
  # OR
@@ -121,7 +125,7 @@ result = solver.normal('https://site-with-captcha.com/path/to/captcha.jpg', para
121
125
 
122
126
  ### Audio Captcha
123
127
  To bypass an audio captcha (mp3 formats only) use the following method.
124
- You must provife the language as `lang = 'en'`. Supported languages are "en", "ru", "de", "el", "pt".
128
+ You must provide the language as `lang = 'en'`. Supported languages are "en", "ru", "de", "el", "pt".
125
129
 
126
130
  ```python
127
131
  result = solver.audio('path/to/captcha.mp3', lang = 'lang', param1=..., ...)
@@ -130,21 +134,21 @@ result = solver.audio('https://site-with-captcha.com/path/to/captcha.mp3', lang
130
134
  ```
131
135
 
132
136
  ### Text Captcha
133
- This method can be used to bypass a captcha that requires to answer a question provided in clear text.
137
+ This method can be used to bypass a captcha that requires answering a question provided in clear text.
134
138
  ```python
135
139
  result = solver.text('If tomorrow is Saturday, what day is today?', param1=..., ...)
136
140
  ```
137
141
 
138
- ### ReCaptcha v2
139
- Use this method to solve ReCaptcha V2 and obtain a token to bypass the protection.
142
+ ### reCAPTCHA v2
143
+ Use this method to solve reCAPTCHA V2 and obtain a token to bypass the protection.
140
144
  ```python
141
145
  result = solver.recaptcha(sitekey='6Le-wvkSVVABCPBMRTvw0Q4Muexq1bi0DJwx_mJ-',
142
146
  url='https://mysite.com/page/with/recaptcha',
143
147
  param1=..., ...)
144
148
  ```
145
149
 
146
- ### ReCaptcha v3
147
- This method provides ReCaptcha V3 solver and returns a token.
150
+ ### reCAPTCHA v3
151
+ This method provides a reCAPTCHA V3 solver and returns a token.
148
152
  ```python
149
153
  result = solver.recaptcha(sitekey='6Le-wvkSVVABCPBMRTvw0Q4Muexq1bi0DJwx_mJ-',
150
154
  url='https://mysite.com/page/with/recaptcha',
@@ -174,7 +178,7 @@ result = solver.geetest(gt='f1ab2cdefa3456789012345b6c78d90e',
174
178
 
175
179
 
176
180
  ### hCaptcha
177
- 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.
178
182
  ```python
179
183
  result = solver.hcaptcha(sitekey='10000000-ffff-ffff-ffff-000000000001',
180
184
  url='https://www.site.com/page/',
@@ -193,7 +197,7 @@ result = solver.geetest_v4(captcha_id='e392e1d7fd421dc63325744d5a2b9c73',
193
197
 
194
198
 
195
199
  ### Lemin Cropped Captcha
196
- 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.
197
201
  ```python
198
202
  result = solver.lemin(captcha_id='CROPPED_1abcd2f_a1234b567c890d12ef3a456bc78d901d',
199
203
  div_id='lemin-cropped-captcha',
@@ -238,6 +242,18 @@ result = solver.keycaptcha(s_s_c_user_id=10,
238
242
 
239
243
  ```
240
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
+
241
257
  ### Capy
242
258
  Token-based method to bypass Capy puzzle captcha.
243
259
  ```python
@@ -247,17 +263,19 @@ result = solver.capy(sitekey='PUZZLE_Abc1dEFghIJKLM2no34P56q7rStu8v',
247
263
  param1=..., ...)
248
264
  ```
249
265
  ### Grid
250
- Grid method is originally called Old ReCaptcha V2 method. The method can be used to bypass any type of captcha where you can apply a grid on image and need to click specific grid boxes. Returns numbers of boxes.
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.
251
267
  ```python
252
268
  result = solver.grid('path/to/captcha.jpg', param1=..., ...)
253
269
  ```
270
+
254
271
  ### Canvas
255
- 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.
256
273
  ```python
257
274
  result = solver.canvas('path/to/captcha.jpg', param1=..., ...)
258
275
  ```
276
+
259
277
  ### ClickCaptcha
260
- ClickCaptcha method returns coordinates of points on captcha image. Can be used if you need to click on particular points on the image.
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.
261
279
  ```python
262
280
  result = solver.coordinates('path/to/captcha.jpg', param1=..., ...)
263
281
  ```
@@ -268,6 +286,32 @@ This method can be used to solve a captcha that asks to rotate an object. Mostly
268
286
  result = solver.rotate('path/to/captcha.jpg', param1=..., ...)
269
287
  ```
270
288
 
289
+ ### MTCaptcha
290
+ Use this method to solve MTCaptcha and obtain a token to bypass the protection.
291
+ ```python
292
+ result = solver.mtcaptcha(sitekey='MTPublic-KzqLY1cKH',
293
+ url='https://2captcha.com/demo/mtcaptcha',
294
+ param1=..., ...)
295
+ ```
296
+
297
+ ### Friendly Captcha
298
+ Friendly Captcha solving method. Returns a token.
299
+ ```python
300
+ result = solver.friendly_captcha(sitekey='FCMGEMUD2KTDSQ5H',
301
+ url='https://friendlycaptcha.com/demo',
302
+ param1=..., ...)
303
+ ```
304
+
305
+ ### Cutcaptcha
306
+ Use this method to solve Cutcaptcha. Returns the response in JSON.
307
+ ```python
308
+ result = solver.cutcaptcha(misery_key='ad52c87af17e2ec09b8d918c9f00416b1cb8c320',
309
+ apikey='SAs61IAI',
310
+ url='https://mysite.com/page/with/cutcaptcha',
311
+ param1=..., ...)
312
+ ```
313
+
314
+
271
315
  ## Other methods
272
316
 
273
317
  ### send / getResult
@@ -290,7 +334,7 @@ balance = solver.balance()
290
334
  ```
291
335
 
292
336
  ### report
293
- Use this method to report good or bad captcha answer.
337
+ Use this method to report good or bad captcha answers.
294
338
  ```python
295
339
  solver.report(id, True) # captcha solved correctly
296
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 [2Captcha] captcha solving service into your code to automate solving of any types of captcha.
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
- - [ReCaptcha v2](#recaptcha-v2)
14
- - [ReCaptcha v3](#recaptcha-v3)
13
+ - [reCAPTCHA v2](#recaptcha-v2)
14
+ - [reCAPTCHA v3](#recaptcha-v3)
15
15
  - [FunCaptcha](#funcaptcha)
16
16
  - [GeeTest](#geetest)
17
17
  - [hCaptcha](#hcaptcha)
@@ -20,11 +20,15 @@ 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)
29
+ - [MTCaptcha](#mtcaptcha)
30
+ - [Friendly Captcha](#friendly-captcha)
31
+ - [Cutcaptcha](#cutcaptcha)
28
32
  - [Other methods](#other-methods)
29
33
  - [send / getResult](#send--getresult)
30
34
  - [balance](#balance)
@@ -49,7 +53,7 @@ from twocaptcha import TwoCaptcha
49
53
 
50
54
  solver = TwoCaptcha('YOUR_API_KEY')
51
55
  ```
52
- Also there are few options that can be configured:
56
+ Also there are a few options that can be configured:
53
57
 
54
58
  ```python
55
59
  config = {
@@ -71,8 +75,8 @@ solver = TwoCaptcha(**config)
71
75
  | server | `2captcha.com` | API server. You can set it to `rucaptcha.com` if your account is registered there |
72
76
  | softId | - | your software ID obtained after publishing in [2captcha sofware catalog] |
73
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 |
74
- | 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 |
75
- | recaptchaTimeout | 600 | Polling timeout for ReCaptcha in seconds. Defines how long the module tries to get the answer from `res.php` API endpoint |
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 |
76
80
  | pollingInterval | 10 | Interval in seconds between requests to `res.php` API endpoint, setting values less than 5 seconds is not recommended |
77
81
 
78
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.
@@ -97,7 +101,7 @@ When you submit any image-based captcha use can provide additional options to he
97
101
  Below you can find basic examples for every captcha type. Check out [examples directory] to find more examples with all available options.
98
102
 
99
103
  ### Normal Captcha
100
- 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.
101
105
  ```python
102
106
  result = solver.normal('path/to/captcha.jpg', param1=..., ...)
103
107
  # OR
@@ -106,7 +110,7 @@ result = solver.normal('https://site-with-captcha.com/path/to/captcha.jpg', para
106
110
 
107
111
  ### Audio Captcha
108
112
  To bypass an audio captcha (mp3 formats only) use the following method.
109
- You must provife the language as `lang = 'en'`. Supported languages are "en", "ru", "de", "el", "pt".
113
+ You must provide the language as `lang = 'en'`. Supported languages are "en", "ru", "de", "el", "pt".
110
114
 
111
115
  ```python
112
116
  result = solver.audio('path/to/captcha.mp3', lang = 'lang', param1=..., ...)
@@ -115,21 +119,21 @@ result = solver.audio('https://site-with-captcha.com/path/to/captcha.mp3', lang
115
119
  ```
116
120
 
117
121
  ### Text Captcha
118
- This method can be used to bypass a captcha that requires to answer a question provided in clear text.
122
+ This method can be used to bypass a captcha that requires answering a question provided in clear text.
119
123
  ```python
120
124
  result = solver.text('If tomorrow is Saturday, what day is today?', param1=..., ...)
121
125
  ```
122
126
 
123
- ### ReCaptcha v2
124
- Use this method to solve ReCaptcha V2 and obtain a token to bypass the protection.
127
+ ### reCAPTCHA v2
128
+ Use this method to solve reCAPTCHA V2 and obtain a token to bypass the protection.
125
129
  ```python
126
130
  result = solver.recaptcha(sitekey='6Le-wvkSVVABCPBMRTvw0Q4Muexq1bi0DJwx_mJ-',
127
131
  url='https://mysite.com/page/with/recaptcha',
128
132
  param1=..., ...)
129
133
  ```
130
134
 
131
- ### ReCaptcha v3
132
- This method provides ReCaptcha V3 solver and returns a token.
135
+ ### reCAPTCHA v3
136
+ This method provides a reCAPTCHA V3 solver and returns a token.
133
137
  ```python
134
138
  result = solver.recaptcha(sitekey='6Le-wvkSVVABCPBMRTvw0Q4Muexq1bi0DJwx_mJ-',
135
139
  url='https://mysite.com/page/with/recaptcha',
@@ -159,7 +163,7 @@ result = solver.geetest(gt='f1ab2cdefa3456789012345b6c78d90e',
159
163
 
160
164
 
161
165
  ### hCaptcha
162
- 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.
163
167
  ```python
164
168
  result = solver.hcaptcha(sitekey='10000000-ffff-ffff-ffff-000000000001',
165
169
  url='https://www.site.com/page/',
@@ -178,7 +182,7 @@ result = solver.geetest_v4(captcha_id='e392e1d7fd421dc63325744d5a2b9c73',
178
182
 
179
183
 
180
184
  ### Lemin Cropped Captcha
181
- 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.
182
186
  ```python
183
187
  result = solver.lemin(captcha_id='CROPPED_1abcd2f_a1234b567c890d12ef3a456bc78d901d',
184
188
  div_id='lemin-cropped-captcha',
@@ -223,6 +227,18 @@ result = solver.keycaptcha(s_s_c_user_id=10,
223
227
 
224
228
  ```
225
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
+
226
242
  ### Capy
227
243
  Token-based method to bypass Capy puzzle captcha.
228
244
  ```python
@@ -232,17 +248,19 @@ result = solver.capy(sitekey='PUZZLE_Abc1dEFghIJKLM2no34P56q7rStu8v',
232
248
  param1=..., ...)
233
249
  ```
234
250
  ### Grid
235
- Grid method is originally called Old ReCaptcha V2 method. The method can be used to bypass any type of captcha where you can apply a grid on image and need to click specific grid boxes. Returns numbers of boxes.
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.
236
252
  ```python
237
253
  result = solver.grid('path/to/captcha.jpg', param1=..., ...)
238
254
  ```
255
+
239
256
  ### Canvas
240
- 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.
241
258
  ```python
242
259
  result = solver.canvas('path/to/captcha.jpg', param1=..., ...)
243
260
  ```
261
+
244
262
  ### ClickCaptcha
245
- ClickCaptcha method returns coordinates of points on captcha image. Can be used if you need to click on particular points on the image.
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.
246
264
  ```python
247
265
  result = solver.coordinates('path/to/captcha.jpg', param1=..., ...)
248
266
  ```
@@ -253,6 +271,32 @@ This method can be used to solve a captcha that asks to rotate an object. Mostly
253
271
  result = solver.rotate('path/to/captcha.jpg', param1=..., ...)
254
272
  ```
255
273
 
274
+ ### MTCaptcha
275
+ Use this method to solve MTCaptcha and obtain a token to bypass the protection.
276
+ ```python
277
+ result = solver.mtcaptcha(sitekey='MTPublic-KzqLY1cKH',
278
+ url='https://2captcha.com/demo/mtcaptcha',
279
+ param1=..., ...)
280
+ ```
281
+
282
+ ### Friendly Captcha
283
+ Friendly Captcha solving method. Returns a token.
284
+ ```python
285
+ result = solver.friendly_captcha(sitekey='FCMGEMUD2KTDSQ5H',
286
+ url='https://friendlycaptcha.com/demo',
287
+ param1=..., ...)
288
+ ```
289
+
290
+ ### Cutcaptcha
291
+ Use this method to solve Cutcaptcha. Returns the response in JSON.
292
+ ```python
293
+ result = solver.cutcaptcha(misery_key='ad52c87af17e2ec09b8d918c9f00416b1cb8c320',
294
+ apikey='SAs61IAI',
295
+ url='https://mysite.com/page/with/cutcaptcha',
296
+ param1=..., ...)
297
+ ```
298
+
299
+
256
300
  ## Other methods
257
301
 
258
302
  ### send / getResult
@@ -275,7 +319,7 @@ balance = solver.balance()
275
319
  ```
276
320
 
277
321
  ### report
278
- Use this method to report good or bad captcha answer.
322
+ Use this method to report good or bad captcha answers.
279
323
  ```python
280
324
  solver.report(id, True) # captcha solved correctly
281
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()
@@ -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 CutcaptchaTest(AbstractTest):
12
+
13
+ def test_all_params(self):
14
+ params = {
15
+ 'misery_key': 'ad52c87af17e2ec09b8d918c9f00416b1cb8c320',
16
+ 'apikey': 'SAs61IAI',
17
+ 'url': 'https://www.site.com/page/',
18
+ }
19
+
20
+ sends = {
21
+ 'method': 'cutcaptcha',
22
+ 'api_key': 'SAs61IAI',
23
+ 'misery_key': 'ad52c87af17e2ec09b8d918c9f00416b1cb8c320',
24
+ 'pageurl': 'https://www.site.com/page/',
25
+ }
26
+
27
+ return self.send_return(sends, self.solver.cutcaptcha, **params)
28
+
29
+
30
+ if __name__ == '__main__':
31
+ unittest.main()
@@ -0,0 +1,29 @@
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 FriendlyCaptchaTest(AbstractTest):
12
+
13
+ def test_all_params(self):
14
+ params = {
15
+ 'sitekey': 'FCMGEMUD2KTDSQ5H',
16
+ 'url': 'https://friendlycaptcha.com/demo',
17
+ }
18
+
19
+ sends = {
20
+ 'method': 'friendly_captcha',
21
+ 'sitekey': 'FCMGEMUD2KTDSQ5H',
22
+ 'pageurl': 'https://friendlycaptcha.com/demo',
23
+ }
24
+
25
+ return self.send_return(sends, self.solver.friendly_captcha, **params)
26
+
27
+
28
+ if __name__ == '__main__':
29
+ unittest.main()
@@ -0,0 +1,29 @@
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 MTCaptchaTest(AbstractTest):
12
+
13
+ def test_all_params(self):
14
+ params = {
15
+ 'sitekey': 'MTPublic-KzqLY1cKH',
16
+ 'url': 'https://2captcha.com/demo/mtcaptcha',
17
+ }
18
+
19
+ sends = {
20
+ 'method': 'mt_captcha',
21
+ 'sitekey': 'MTPublic-KzqLY1cKH',
22
+ 'pageurl': 'https://2captcha.com/demo/mtcaptcha',
23
+ }
24
+
25
+ return self.send_return(sends, self.solver.mtcaptcha, **params)
26
+
27
+
28
+ if __name__ == '__main__':
29
+ unittest.main()
@@ -2,4 +2,4 @@ from .api import ApiClient
2
2
  from .solver import (TwoCaptcha, SolverExceptions, ValidationException,
3
3
  NetworkException, ApiException, TimeoutException)
4
4
 
5
- __version__ = '1.2.2'
5
+ __version__ = '1.2.4'
@@ -36,7 +36,7 @@ class TimeoutException(SolverExceptions):
36
36
  class TwoCaptcha():
37
37
  def __init__(self,
38
38
  apiKey,
39
- softId=None,
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):
@@ -503,7 +523,67 @@ class TwoCaptcha():
503
523
 
504
524
  return result
505
525
 
526
+ def mtcaptcha(self, sitekey, url, **kwargs):
527
+ '''
528
+ Wrapper for solving MTCaptcha
529
+
530
+ Required:
531
+ sitekey
532
+ url
533
+
534
+ Optional params:
535
+ softId
536
+ callback
537
+ proxy = {'type': 'HTTPS', 'uri': 'login:password@IP_address:PORT'})
538
+ '''
539
+
540
+ result = self.solve(sitekey=sitekey,
541
+ url=url,
542
+ method='mt_captcha',
543
+ **kwargs)
544
+ return result
545
+
546
+ def friendly_captcha(self, sitekey, url, **kwargs):
547
+ '''
548
+ Wrapper for solving Friendly Captcha
549
+
550
+ Required:
551
+ sitekey
552
+ url
553
+
554
+ Optional params:
555
+ softId
556
+ callback
557
+ proxy = {'type': 'HTTPS', 'uri': 'login:password@IP_address:PORT'})
558
+ '''
559
+
560
+ result = self.solve(sitekey=sitekey,
561
+ url=url,
562
+ method='friendly_captcha',
563
+ **kwargs)
564
+ return result
565
+
566
+ def cutcaptcha(self, misery_key, apikey, url, **kwargs):
567
+ '''
568
+ Wrapper for solving Friendly Captcha
569
+
570
+ Required:
571
+ misery_key
572
+ apikey
573
+ url
506
574
 
575
+ Optional params:
576
+ softId
577
+ callback
578
+ proxy = {'type': 'HTTPS', 'uri': 'login:password@IP_address:PORT'})
579
+ '''
580
+
581
+ result = self.solve(misery_key=misery_key,
582
+ api_key=apikey,
583
+ url=url,
584
+ method='cutcaptcha',
585
+ **kwargs)
586
+ return result
507
587
 
508
588
  def solve(self, timeout=0, polling_interval=0, **kwargs):
509
589
  '''
File without changes