2captcha-python 1.2.5__tar.gz → 1.2.6__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.5 → 2captcha_python-1.2.6}/2captcha_python.egg-info/PKG-INFO +19 -8
- {2captcha_python-1.2.5 → 2captcha_python-1.2.6}/PKG-INFO +19 -8
- {2captcha_python-1.2.5 → 2captcha_python-1.2.6}/README.md +18 -7
- {2captcha_python-1.2.5 → 2captcha_python-1.2.6}/twocaptcha/__init__.py +1 -1
- {2captcha_python-1.2.5 → 2captcha_python-1.2.6}/twocaptcha/solver.py +6 -1
- {2captcha_python-1.2.5 → 2captcha_python-1.2.6}/2captcha_python.egg-info/SOURCES.txt +0 -0
- {2captcha_python-1.2.5 → 2captcha_python-1.2.6}/2captcha_python.egg-info/dependency_links.txt +0 -0
- {2captcha_python-1.2.5 → 2captcha_python-1.2.6}/2captcha_python.egg-info/requires.txt +0 -0
- {2captcha_python-1.2.5 → 2captcha_python-1.2.6}/2captcha_python.egg-info/top_level.txt +0 -0
- {2captcha_python-1.2.5 → 2captcha_python-1.2.6}/LICENSE +0 -0
- {2captcha_python-1.2.5 → 2captcha_python-1.2.6}/setup.cfg +0 -0
- {2captcha_python-1.2.5 → 2captcha_python-1.2.6}/setup.py +0 -0
- {2captcha_python-1.2.5 → 2captcha_python-1.2.6}/tests/test_amazon_waf.py +0 -0
- {2captcha_python-1.2.5 → 2captcha_python-1.2.6}/tests/test_atb_captcha.py +0 -0
- {2captcha_python-1.2.5 → 2captcha_python-1.2.6}/tests/test_canvas.py +0 -0
- {2captcha_python-1.2.5 → 2captcha_python-1.2.6}/tests/test_capy.py +0 -0
- {2captcha_python-1.2.5 → 2captcha_python-1.2.6}/tests/test_coordinates.py +0 -0
- {2captcha_python-1.2.5 → 2captcha_python-1.2.6}/tests/test_cutcaptcha.py +0 -0
- {2captcha_python-1.2.5 → 2captcha_python-1.2.6}/tests/test_friendly_captcha.py +0 -0
- {2captcha_python-1.2.5 → 2captcha_python-1.2.6}/tests/test_funcaptcha.py +0 -0
- {2captcha_python-1.2.5 → 2captcha_python-1.2.6}/tests/test_geetest.py +0 -0
- {2captcha_python-1.2.5 → 2captcha_python-1.2.6}/tests/test_geetest_v4.py +0 -0
- {2captcha_python-1.2.5 → 2captcha_python-1.2.6}/tests/test_grid.py +0 -0
- {2captcha_python-1.2.5 → 2captcha_python-1.2.6}/tests/test_hcaptcha.py +0 -0
- {2captcha_python-1.2.5 → 2captcha_python-1.2.6}/tests/test_keycaptcha.py +0 -0
- {2captcha_python-1.2.5 → 2captcha_python-1.2.6}/tests/test_lemin.py +0 -0
- {2captcha_python-1.2.5 → 2captcha_python-1.2.6}/tests/test_mtcaptcha.py +0 -0
- {2captcha_python-1.2.5 → 2captcha_python-1.2.6}/tests/test_normal.py +0 -0
- {2captcha_python-1.2.5 → 2captcha_python-1.2.6}/tests/test_recaptcha.py +0 -0
- {2captcha_python-1.2.5 → 2captcha_python-1.2.6}/tests/test_rotate.py +0 -0
- {2captcha_python-1.2.5 → 2captcha_python-1.2.6}/tests/test_tencent.py +0 -0
- {2captcha_python-1.2.5 → 2captcha_python-1.2.6}/tests/test_text.py +0 -0
- {2captcha_python-1.2.5 → 2captcha_python-1.2.6}/tests/test_turnstile.py +0 -0
- {2captcha_python-1.2.5 → 2captcha_python-1.2.6}/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.6
|
|
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
|
|
@@ -44,8 +44,9 @@ The easiest way to quickly integrate the 2Captcha captcha-solving service into y
|
|
|
44
44
|
- [MTCaptcha](#mtcaptcha)
|
|
45
45
|
- [Friendly Captcha](#friendly-captcha)
|
|
46
46
|
- [Cutcaptcha](#cutcaptcha)
|
|
47
|
+
- [Tencent](#tencent)
|
|
47
48
|
- [Other methods](#other-methods)
|
|
48
|
-
- [send / get_result](#send--
|
|
49
|
+
- [send / get_result](#send--get_result)
|
|
49
50
|
- [balance](#balance)
|
|
50
51
|
- [report](#report)
|
|
51
52
|
- [Error handling](#error-handling)
|
|
@@ -95,7 +96,7 @@ solver = TwoCaptcha(**config)
|
|
|
95
96
|
| pollingInterval | 10 | Interval in seconds between requests to `res.php` API endpoint, setting values less than 5 seconds is not recommended |
|
|
96
97
|
|
|
97
98
|
> **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.
|
|
98
|
-
To get the answer manually use [get_result method](#send--
|
|
99
|
+
To get the answer manually use [get_result method](#send--get_result)
|
|
99
100
|
|
|
100
101
|
## Solve captcha
|
|
101
102
|
When you submit any image-based captcha use can provide additional options to help 2captcha workers to solve it properly.
|
|
@@ -125,7 +126,7 @@ result = solver.normal('https://site-with-captcha.com/path/to/captcha.jpg', para
|
|
|
125
126
|
|
|
126
127
|
### Audio Captcha
|
|
127
128
|
To bypass an audio captcha (mp3 formats only) use the following method.
|
|
128
|
-
You must provide the language as `lang = 'en'`. Supported languages are "en", "ru", "de", "el", "pt".
|
|
129
|
+
You must provide the language as `lang = 'en'`. Supported languages are "en", "ru", "de", "el", "pt", "fr".
|
|
129
130
|
|
|
130
131
|
```python
|
|
131
132
|
result = solver.audio('path/to/captcha.mp3', lang = 'lang', param1=..., ...)
|
|
@@ -312,6 +313,13 @@ result = solver.cutcaptcha(misery_key='ad52c87af17e2ec09b8d918c9f00416b1cb8c320'
|
|
|
312
313
|
param1=..., ...)
|
|
313
314
|
```
|
|
314
315
|
|
|
316
|
+
### Tencent
|
|
317
|
+
Use this method to solve Cutcaptcha. Returns a token.
|
|
318
|
+
```python
|
|
319
|
+
result = solver.tencent(app_id="197326679",
|
|
320
|
+
url="https://mysite.com/page/with/tencent",
|
|
321
|
+
param1=..., ...)
|
|
322
|
+
```
|
|
315
323
|
|
|
316
324
|
## Other methods
|
|
317
325
|
|
|
@@ -364,7 +372,7 @@ except TimeoutException as e:
|
|
|
364
372
|
### Proxies
|
|
365
373
|
|
|
366
374
|
You can pass your proxy as an additional argument for methods: recaptcha, funcaptcha, geetest, geetest v4, hcaptcha,
|
|
367
|
-
keycaptcha, capy
|
|
375
|
+
keycaptcha, capy puzzle, lemin, atbcaptcha, turnstile, tencent, amazon waf, mtcaptcha, friendly captcha, cutcaptcha.
|
|
368
376
|
The proxy will be forwarded to the API to solve the captcha.
|
|
369
377
|
|
|
370
378
|
We have our own proxies that we can offer you. [Buy residential proxies] for avoid restrictions and blocks. [Quick start].
|
|
@@ -384,20 +392,23 @@ import asyncio
|
|
|
384
392
|
import concurrent.futures
|
|
385
393
|
from twocaptcha import TwoCaptcha
|
|
386
394
|
|
|
387
|
-
|
|
395
|
+
API_KEY = "YOUR_API_KEY"
|
|
396
|
+
image = "data:image/png;base64,iVBORw0KGgoA..."
|
|
388
397
|
|
|
389
398
|
async def captchaSolver(image):
|
|
390
399
|
loop = asyncio.get_running_loop()
|
|
391
|
-
with concurrent.
|
|
400
|
+
with concurrent.futures.ThreadPoolExecutor() as pool:
|
|
392
401
|
result = await loop.run_in_executor(pool, lambda: TwoCaptcha(API_KEY).normal(image))
|
|
393
402
|
return result
|
|
403
|
+
|
|
404
|
+
captcha_result = asyncio.run(captchaSolver(image))
|
|
394
405
|
```
|
|
395
406
|
|
|
396
407
|
|
|
397
408
|
[2Captcha]: https://2captcha.com/
|
|
398
409
|
[2captcha sofware catalog]: https://2captcha.com/software
|
|
399
410
|
[pingback settings]: https://2captcha.com/setting/pingback
|
|
400
|
-
[post options]: https://2captcha.com/2captcha-api#
|
|
411
|
+
[post options]: https://2captcha.com/2captcha-api#normal_post
|
|
401
412
|
[list of supported languages]: https://2captcha.com/2captcha-api#language
|
|
402
413
|
[examples directory]: /examples
|
|
403
414
|
[asyncio]: https://docs.python.org/3/library/asyncio.html
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: 2captcha-python
|
|
3
|
-
Version: 1.2.
|
|
3
|
+
Version: 1.2.6
|
|
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
|
|
@@ -44,8 +44,9 @@ The easiest way to quickly integrate the 2Captcha captcha-solving service into y
|
|
|
44
44
|
- [MTCaptcha](#mtcaptcha)
|
|
45
45
|
- [Friendly Captcha](#friendly-captcha)
|
|
46
46
|
- [Cutcaptcha](#cutcaptcha)
|
|
47
|
+
- [Tencent](#tencent)
|
|
47
48
|
- [Other methods](#other-methods)
|
|
48
|
-
- [send / get_result](#send--
|
|
49
|
+
- [send / get_result](#send--get_result)
|
|
49
50
|
- [balance](#balance)
|
|
50
51
|
- [report](#report)
|
|
51
52
|
- [Error handling](#error-handling)
|
|
@@ -95,7 +96,7 @@ solver = TwoCaptcha(**config)
|
|
|
95
96
|
| pollingInterval | 10 | Interval in seconds between requests to `res.php` API endpoint, setting values less than 5 seconds is not recommended |
|
|
96
97
|
|
|
97
98
|
> **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.
|
|
98
|
-
To get the answer manually use [get_result method](#send--
|
|
99
|
+
To get the answer manually use [get_result method](#send--get_result)
|
|
99
100
|
|
|
100
101
|
## Solve captcha
|
|
101
102
|
When you submit any image-based captcha use can provide additional options to help 2captcha workers to solve it properly.
|
|
@@ -125,7 +126,7 @@ result = solver.normal('https://site-with-captcha.com/path/to/captcha.jpg', para
|
|
|
125
126
|
|
|
126
127
|
### Audio Captcha
|
|
127
128
|
To bypass an audio captcha (mp3 formats only) use the following method.
|
|
128
|
-
You must provide the language as `lang = 'en'`. Supported languages are "en", "ru", "de", "el", "pt".
|
|
129
|
+
You must provide the language as `lang = 'en'`. Supported languages are "en", "ru", "de", "el", "pt", "fr".
|
|
129
130
|
|
|
130
131
|
```python
|
|
131
132
|
result = solver.audio('path/to/captcha.mp3', lang = 'lang', param1=..., ...)
|
|
@@ -312,6 +313,13 @@ result = solver.cutcaptcha(misery_key='ad52c87af17e2ec09b8d918c9f00416b1cb8c320'
|
|
|
312
313
|
param1=..., ...)
|
|
313
314
|
```
|
|
314
315
|
|
|
316
|
+
### Tencent
|
|
317
|
+
Use this method to solve Cutcaptcha. Returns a token.
|
|
318
|
+
```python
|
|
319
|
+
result = solver.tencent(app_id="197326679",
|
|
320
|
+
url="https://mysite.com/page/with/tencent",
|
|
321
|
+
param1=..., ...)
|
|
322
|
+
```
|
|
315
323
|
|
|
316
324
|
## Other methods
|
|
317
325
|
|
|
@@ -364,7 +372,7 @@ except TimeoutException as e:
|
|
|
364
372
|
### Proxies
|
|
365
373
|
|
|
366
374
|
You can pass your proxy as an additional argument for methods: recaptcha, funcaptcha, geetest, geetest v4, hcaptcha,
|
|
367
|
-
keycaptcha, capy
|
|
375
|
+
keycaptcha, capy puzzle, lemin, atbcaptcha, turnstile, tencent, amazon waf, mtcaptcha, friendly captcha, cutcaptcha.
|
|
368
376
|
The proxy will be forwarded to the API to solve the captcha.
|
|
369
377
|
|
|
370
378
|
We have our own proxies that we can offer you. [Buy residential proxies] for avoid restrictions and blocks. [Quick start].
|
|
@@ -384,20 +392,23 @@ import asyncio
|
|
|
384
392
|
import concurrent.futures
|
|
385
393
|
from twocaptcha import TwoCaptcha
|
|
386
394
|
|
|
387
|
-
|
|
395
|
+
API_KEY = "YOUR_API_KEY"
|
|
396
|
+
image = "data:image/png;base64,iVBORw0KGgoA..."
|
|
388
397
|
|
|
389
398
|
async def captchaSolver(image):
|
|
390
399
|
loop = asyncio.get_running_loop()
|
|
391
|
-
with concurrent.
|
|
400
|
+
with concurrent.futures.ThreadPoolExecutor() as pool:
|
|
392
401
|
result = await loop.run_in_executor(pool, lambda: TwoCaptcha(API_KEY).normal(image))
|
|
393
402
|
return result
|
|
403
|
+
|
|
404
|
+
captcha_result = asyncio.run(captchaSolver(image))
|
|
394
405
|
```
|
|
395
406
|
|
|
396
407
|
|
|
397
408
|
[2Captcha]: https://2captcha.com/
|
|
398
409
|
[2captcha sofware catalog]: https://2captcha.com/software
|
|
399
410
|
[pingback settings]: https://2captcha.com/setting/pingback
|
|
400
|
-
[post options]: https://2captcha.com/2captcha-api#
|
|
411
|
+
[post options]: https://2captcha.com/2captcha-api#normal_post
|
|
401
412
|
[list of supported languages]: https://2captcha.com/2captcha-api#language
|
|
402
413
|
[examples directory]: /examples
|
|
403
414
|
[asyncio]: https://docs.python.org/3/library/asyncio.html
|
|
@@ -29,8 +29,9 @@ The easiest way to quickly integrate the 2Captcha captcha-solving service into y
|
|
|
29
29
|
- [MTCaptcha](#mtcaptcha)
|
|
30
30
|
- [Friendly Captcha](#friendly-captcha)
|
|
31
31
|
- [Cutcaptcha](#cutcaptcha)
|
|
32
|
+
- [Tencent](#tencent)
|
|
32
33
|
- [Other methods](#other-methods)
|
|
33
|
-
- [send / get_result](#send--
|
|
34
|
+
- [send / get_result](#send--get_result)
|
|
34
35
|
- [balance](#balance)
|
|
35
36
|
- [report](#report)
|
|
36
37
|
- [Error handling](#error-handling)
|
|
@@ -80,7 +81,7 @@ solver = TwoCaptcha(**config)
|
|
|
80
81
|
| pollingInterval | 10 | Interval in seconds between requests to `res.php` API endpoint, setting values less than 5 seconds is not recommended |
|
|
81
82
|
|
|
82
83
|
> **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.
|
|
83
|
-
To get the answer manually use [get_result method](#send--
|
|
84
|
+
To get the answer manually use [get_result method](#send--get_result)
|
|
84
85
|
|
|
85
86
|
## Solve captcha
|
|
86
87
|
When you submit any image-based captcha use can provide additional options to help 2captcha workers to solve it properly.
|
|
@@ -110,7 +111,7 @@ result = solver.normal('https://site-with-captcha.com/path/to/captcha.jpg', para
|
|
|
110
111
|
|
|
111
112
|
### Audio Captcha
|
|
112
113
|
To bypass an audio captcha (mp3 formats only) use the following method.
|
|
113
|
-
You must provide the language as `lang = 'en'`. Supported languages are "en", "ru", "de", "el", "pt".
|
|
114
|
+
You must provide the language as `lang = 'en'`. Supported languages are "en", "ru", "de", "el", "pt", "fr".
|
|
114
115
|
|
|
115
116
|
```python
|
|
116
117
|
result = solver.audio('path/to/captcha.mp3', lang = 'lang', param1=..., ...)
|
|
@@ -297,6 +298,13 @@ result = solver.cutcaptcha(misery_key='ad52c87af17e2ec09b8d918c9f00416b1cb8c320'
|
|
|
297
298
|
param1=..., ...)
|
|
298
299
|
```
|
|
299
300
|
|
|
301
|
+
### Tencent
|
|
302
|
+
Use this method to solve Cutcaptcha. Returns a token.
|
|
303
|
+
```python
|
|
304
|
+
result = solver.tencent(app_id="197326679",
|
|
305
|
+
url="https://mysite.com/page/with/tencent",
|
|
306
|
+
param1=..., ...)
|
|
307
|
+
```
|
|
300
308
|
|
|
301
309
|
## Other methods
|
|
302
310
|
|
|
@@ -349,7 +357,7 @@ except TimeoutException as e:
|
|
|
349
357
|
### Proxies
|
|
350
358
|
|
|
351
359
|
You can pass your proxy as an additional argument for methods: recaptcha, funcaptcha, geetest, geetest v4, hcaptcha,
|
|
352
|
-
keycaptcha, capy
|
|
360
|
+
keycaptcha, capy puzzle, lemin, atbcaptcha, turnstile, tencent, amazon waf, mtcaptcha, friendly captcha, cutcaptcha.
|
|
353
361
|
The proxy will be forwarded to the API to solve the captcha.
|
|
354
362
|
|
|
355
363
|
We have our own proxies that we can offer you. [Buy residential proxies] for avoid restrictions and blocks. [Quick start].
|
|
@@ -369,20 +377,23 @@ import asyncio
|
|
|
369
377
|
import concurrent.futures
|
|
370
378
|
from twocaptcha import TwoCaptcha
|
|
371
379
|
|
|
372
|
-
|
|
380
|
+
API_KEY = "YOUR_API_KEY"
|
|
381
|
+
image = "data:image/png;base64,iVBORw0KGgoA..."
|
|
373
382
|
|
|
374
383
|
async def captchaSolver(image):
|
|
375
384
|
loop = asyncio.get_running_loop()
|
|
376
|
-
with concurrent.
|
|
385
|
+
with concurrent.futures.ThreadPoolExecutor() as pool:
|
|
377
386
|
result = await loop.run_in_executor(pool, lambda: TwoCaptcha(API_KEY).normal(image))
|
|
378
387
|
return result
|
|
388
|
+
|
|
389
|
+
captcha_result = asyncio.run(captchaSolver(image))
|
|
379
390
|
```
|
|
380
391
|
|
|
381
392
|
|
|
382
393
|
[2Captcha]: https://2captcha.com/
|
|
383
394
|
[2captcha sofware catalog]: https://2captcha.com/software
|
|
384
395
|
[pingback settings]: https://2captcha.com/setting/pingback
|
|
385
|
-
[post options]: https://2captcha.com/2captcha-api#
|
|
396
|
+
[post options]: https://2captcha.com/2captcha-api#normal_post
|
|
386
397
|
[list of supported languages]: https://2captcha.com/2captcha-api#language
|
|
387
398
|
[examples directory]: /examples
|
|
388
399
|
[asyncio]: https://docs.python.org/3/library/asyncio.html
|
|
@@ -361,7 +361,7 @@ class TwoCaptcha():
|
|
|
361
361
|
api_server : str, optional
|
|
362
362
|
The domain part of script URL you found on page. Default value: https://jp.api.capy.me/.
|
|
363
363
|
version : str, optional
|
|
364
|
-
The version of captcha task: puzzle (assemble a puzzle) or avatar (drag an object). Default: puzzle.
|
|
364
|
+
The version of captcha task: "puzzle" (assemble a puzzle) or "avatar" (drag an object). Default: puzzle.
|
|
365
365
|
softId : int, optional
|
|
366
366
|
ID of software developer. Developers who integrated their software with 2Captcha get reward: 10% of
|
|
367
367
|
spendings of their software users.
|
|
@@ -643,11 +643,16 @@ class TwoCaptcha():
|
|
|
643
643
|
Value of sitekey parameter you found on page.
|
|
644
644
|
url : str
|
|
645
645
|
Full URL of the page where you see the captcha.
|
|
646
|
+
useragent : str
|
|
647
|
+
User-Agent of your browser. Must match the User-Agent you use to access the site.
|
|
648
|
+
Use only modern browsers released within the last 6 months.
|
|
646
649
|
action : str. optional
|
|
647
650
|
Value of optional action parameter you found on page, can be defined in data-action attribute or passed
|
|
648
651
|
to turnstile.render call.
|
|
649
652
|
data : str, optional
|
|
650
653
|
The value of cData passed to turnstile.render call. Also can be defined in data-cdata attribute.
|
|
654
|
+
pagedata : str, optional
|
|
655
|
+
The value of the chlPageData parameter when calling turnstile.render.
|
|
651
656
|
softId : int, optional
|
|
652
657
|
ID of software developer. Developers who integrated their software with 2Captcha get reward: 10% of
|
|
653
658
|
spendings of their software users.
|
|
File without changes
|
{2captcha_python-1.2.5 → 2captcha_python-1.2.6}/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
|
|
File without changes
|
|
File without changes
|