2captcha-python 1.5.0__py3-none-any.whl → 1.5.1__py3-none-any.whl
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.5.0.dist-info → 2captcha_python-1.5.1.dist-info}/METADATA +30 -34
- 2captcha_python-1.5.1.dist-info/RECORD +8 -0
- {2captcha_python-1.5.0.dist-info → 2captcha_python-1.5.1.dist-info}/WHEEL +1 -1
- twocaptcha/__init__.py +2 -2
- twocaptcha/solver.py +27 -0
- 2captcha_python-1.5.0.dist-info/RECORD +0 -8
- {2captcha_python-1.5.0.dist-info → 2captcha_python-1.5.1.dist-info}/LICENSE +0 -0
- {2captcha_python-1.5.0.dist-info → 2captcha_python-1.5.1.dist-info}/top_level.txt +0 -0
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.2
|
|
2
2
|
Name: 2captcha-python
|
|
3
|
-
Version: 1.5.
|
|
3
|
+
Version: 1.5.1
|
|
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
|
|
7
7
|
Author-email: info@2captcha.com
|
|
8
|
-
Keywords: 2captcha,captcha,api,captcha solver,reCAPTCHA,
|
|
8
|
+
Keywords: 2captcha,captcha,api,captcha solver,reCAPTCHA,FunCaptcha,Geetest,image captcha,Coordinates,Click Captcha,Geetest V4,Lemin captcha,Amazon WAF,Cloudflare Turnstile,Capy Puzzle,MTCaptcha,Friendly Captcha,Tencent,Cutcaptcha,DataDome,cybersiara
|
|
9
9
|
Classifier: Programming Language :: Python :: 3
|
|
10
10
|
Classifier: License :: OSI Approved :: MIT License
|
|
11
11
|
Classifier: Operating System :: OS Independent
|
|
@@ -17,6 +17,16 @@ Requires-Python: >=3.6
|
|
|
17
17
|
Description-Content-Type: text/markdown
|
|
18
18
|
License-File: LICENSE
|
|
19
19
|
Requires-Dist: requests
|
|
20
|
+
Dynamic: author
|
|
21
|
+
Dynamic: author-email
|
|
22
|
+
Dynamic: classifier
|
|
23
|
+
Dynamic: description
|
|
24
|
+
Dynamic: description-content-type
|
|
25
|
+
Dynamic: home-page
|
|
26
|
+
Dynamic: keywords
|
|
27
|
+
Dynamic: requires-dist
|
|
28
|
+
Dynamic: requires-python
|
|
29
|
+
Dynamic: summary
|
|
20
30
|
|
|
21
31
|
<a href="https://github.com/2captcha/2captcha-python"><img src="https://github.com/user-attachments/assets/a737d428-5233-4605-9d09-211fa213d069" width="82" height="30"></a>
|
|
22
32
|
<a href="https://github.com/2captcha/2captcha-javascript"><img src="https://github.com/user-attachments/assets/4d3b4541-34b2-4ed2-a687-d694ce67e5a6" width="36" height="30"></a>
|
|
@@ -46,7 +56,7 @@ Examples of API requests for different captcha types are available on the [Pytho
|
|
|
46
56
|
- [FunCaptcha](#funcaptcha)
|
|
47
57
|
- [GeeTest](#geetest)
|
|
48
58
|
- [GeeTest v4](#geetest-v4)
|
|
49
|
-
- [
|
|
59
|
+
- [Yandex Smart](#yandex-smart)
|
|
50
60
|
- [Lemin Cropped Captcha](#lemin-cropped-captcha)
|
|
51
61
|
- [Cloudflare Turnstile](#cloudflare-turnstile)
|
|
52
62
|
- [Amazon WAF](#amazon-waf)
|
|
@@ -61,7 +71,7 @@ Examples of API requests for different captcha types are available on the [Pytho
|
|
|
61
71
|
- [Friendly Captcha](#friendly-captcha)
|
|
62
72
|
- [Cutcaptcha](#cutcaptcha)
|
|
63
73
|
- [Tencent](#tencent)
|
|
64
|
-
- [
|
|
74
|
+
- [DataDome](#datadome)
|
|
65
75
|
- [CyberSiARA](#cybersiara)
|
|
66
76
|
- [Other methods](#other-methods)
|
|
67
77
|
- [send / get\_result](#send--get_result)
|
|
@@ -107,6 +117,7 @@ config = {
|
|
|
107
117
|
'defaultTimeout': 120,
|
|
108
118
|
'recaptchaTimeout': 600,
|
|
109
119
|
'pollingInterval': 10,
|
|
120
|
+
'extendedResponse': False
|
|
110
121
|
}
|
|
111
122
|
solver = TwoCaptcha(**config)
|
|
112
123
|
```
|
|
@@ -121,7 +132,7 @@ solver = TwoCaptcha(**config)
|
|
|
121
132
|
| defaultTimeout | 120 | Polling timeout in seconds for all captcha types except reCAPTCHA. Defines how long the module tries to get the answer from the `res.php` API endpoint |
|
|
122
133
|
| recaptchaTimeout | 600 | Polling timeout for reCAPTCHA in seconds. Defines how long the module tries to get the answer from the `res.php` API endpoint |
|
|
123
134
|
| pollingInterval | 10 | Interval in seconds between requests to the `res.php` API endpoint. Setting values less than 5 seconds is not recommended |
|
|
124
|
-
| extendedResponse | None | Set to `True` to get the response with additional fields or in more practical format (enables `JSON` response from `res.php` API endpoint). Suitable for [
|
|
135
|
+
| extendedResponse | None | Set to `True` to get the response with additional fields or in more practical format (enables `JSON` response from `res.php` API endpoint). Suitable for [ClickCaptcha](#clickcaptcha), [Canvas](#canvas) |
|
|
125
136
|
|
|
126
137
|
|
|
127
138
|
> [!IMPORTANT]
|
|
@@ -245,19 +256,6 @@ result = solver.geetest_v4(captcha_id='e392e1d7fd421dc63325744d5a2b9c73',
|
|
|
245
256
|
```
|
|
246
257
|
|
|
247
258
|
|
|
248
|
-
### hCaptcha
|
|
249
|
-
|
|
250
|
-
<sup>[API method description.](https://2captcha.com/2captcha-api#solving_hcaptcha)</sup>
|
|
251
|
-
|
|
252
|
-
Use this method to solve the hCaptcha challenge. Returns a token to bypass the captcha.
|
|
253
|
-
```python
|
|
254
|
-
result = solver.hcaptcha(sitekey='10000000-ffff-ffff-ffff-000000000001',
|
|
255
|
-
url='https://www.site.com/page/',
|
|
256
|
-
param1=..., ...)
|
|
257
|
-
|
|
258
|
-
```
|
|
259
|
-
|
|
260
|
-
|
|
261
259
|
### Lemin Cropped Captcha
|
|
262
260
|
|
|
263
261
|
<sup>[API method description.](https://2captcha.com/2captcha-api#lemin)</sup>
|
|
@@ -271,6 +269,15 @@ result = solver.lemin(captcha_id='CROPPED_1abcd2f_a1234b567c890d12ef3a456bc78d90
|
|
|
271
269
|
|
|
272
270
|
```
|
|
273
271
|
|
|
272
|
+
### Yandex Smart
|
|
273
|
+
|
|
274
|
+
Use this method to solve Yandex Smart Captcha. Returns JSON with the token.
|
|
275
|
+
```python
|
|
276
|
+
result = solver.yandex_smart(sitekey='0x1AAAAh45AAAAkg0s2VIOD34y5hy4h4h',
|
|
277
|
+
url='http://mysite.com/',
|
|
278
|
+
proxy={'type': 'HTTPS', 'uri': 'login:password@IP_address:PORT'},
|
|
279
|
+
userAgent='Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36')
|
|
280
|
+
```
|
|
274
281
|
|
|
275
282
|
### Cloudflare Turnstile
|
|
276
283
|
|
|
@@ -424,7 +431,7 @@ result = solver.cutcaptcha(misery_key='ad52c87af17e2ec09b8d918c9f00416b1cb8c320'
|
|
|
424
431
|
|
|
425
432
|
<sup>[API method description.](https://2captcha.com/2captcha-api#tencent)</sup>
|
|
426
433
|
|
|
427
|
-
Use this method to solve
|
|
434
|
+
Use this method to solve Tencent captcha. Returns a token.
|
|
428
435
|
```python
|
|
429
436
|
result = solver.tencent(app_id="197326679",
|
|
430
437
|
url="https://mysite.com/page/with/tencent",
|
|
@@ -467,7 +474,7 @@ result = solver.cybersiara(master_url_id='tpjOCKjjpdzv3d8Ub2E9COEWKt1vl1Mv',
|
|
|
467
474
|
|
|
468
475
|
### send / get_result
|
|
469
476
|
These methods can be used for manual captcha submission and answer polling. The `send()` method supports sending any captcha
|
|
470
|
-
type, to specify the captcha type you must send value `method` manually, for example `method='
|
|
477
|
+
type, to specify the captcha type you must send value `method` manually, for example `method='recaptcha'` for solving reCaptcha.
|
|
471
478
|
You can find the value of the `method` parameter in the [API documentation](https://2captcha.com/2captcha-api).
|
|
472
479
|
|
|
473
480
|
Example for solving Normal captcha manually:
|
|
@@ -479,17 +486,6 @@ import time
|
|
|
479
486
|
id = solver.send(file='path/to/captcha.jpg')
|
|
480
487
|
time.sleep(20)
|
|
481
488
|
|
|
482
|
-
code = solver.get_result(id)
|
|
483
|
-
```
|
|
484
|
-
Example for solving hCaptcha manually:
|
|
485
|
-
```python
|
|
486
|
-
import time
|
|
487
|
-
. . . . .
|
|
488
|
-
id = solver.send(sitekey='41b778e7-8f20-45cc-a804-1f1ebb45c579',
|
|
489
|
-
url='https://2captcha.com/demo/hcaptcha?difficulty=easy',
|
|
490
|
-
method='hcaptcha')
|
|
491
|
-
print(id)
|
|
492
|
-
time.sleep(20)
|
|
493
489
|
code = solver.get_result(id)
|
|
494
490
|
```
|
|
495
491
|
|
|
@@ -535,7 +531,7 @@ except TimeoutException as e:
|
|
|
535
531
|
|
|
536
532
|
## Proxies
|
|
537
533
|
|
|
538
|
-
You can pass your proxy as an additional argument for the following methods: recaptcha, funcaptcha, geetest, geetest v4,
|
|
534
|
+
You can pass your proxy as an additional argument for the following methods: recaptcha, funcaptcha, geetest, geetest v4,
|
|
539
535
|
keycaptcha, capy puzzle, lemin, atbcaptcha, turnstile, amazon waf, mtcaptcha, friendly captcha, cutcaptcha, Tencent, DataDome, cybersiara.
|
|
540
536
|
|
|
541
537
|
|
|
@@ -573,7 +569,7 @@ captcha_result = asyncio.run(captchaSolver(image))
|
|
|
573
569
|
Examples of solving all supported captcha types are located in the [examples] directory.
|
|
574
570
|
|
|
575
571
|
## Examples using Selenium
|
|
576
|
-
Also we have a [separate repository](https://github.com/2captcha/captcha-solver-selenium-python-examples) you can find examples of captcha solving using [Selenium](https://pypi.org/project/selenium/) library. At the moment we have implemented examples of bypassing [reCAPTCHA](https://github.com/2captcha/captcha-solver-selenium-python-examples/tree/main/examples/reCAPTCHA), [
|
|
572
|
+
Also we have a [separate repository](https://github.com/2captcha/captcha-solver-selenium-python-examples) you can find examples of captcha solving using [Selenium](https://pypi.org/project/selenium/) library. At the moment we have implemented examples of bypassing [reCAPTCHA](https://github.com/2captcha/captcha-solver-selenium-python-examples/tree/main/examples/reCAPTCHA), [Cloudflare](https://github.com/2captcha/captcha-solver-selenium-python-examples/tree/main/examples/cloudflare), [Coordinates](https://github.com/2captcha/captcha-solver-selenium-python-examples/tree/main/examples/coordinates), [MTCaptcha](https://github.com/2captcha/captcha-solver-selenium-python-examples/tree/main/examples/mtcaptcha), [normal captcha](https://github.com/2captcha/captcha-solver-selenium-python-examples/tree/main/examples/normal_captcha) (image captcha) and [text captcha](https://github.com/2captcha/captcha-solver-selenium-python-examples/tree/main/examples/text_captcha) using Selenium.
|
|
577
573
|
|
|
578
574
|
## Useful articles
|
|
579
575
|
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
twocaptcha/__init__.py,sha256=OwdL4IswYgn-I6-AQzPRZWHz0pKielUKUU7RIAEtWNA,463
|
|
2
|
+
twocaptcha/api.py,sha256=qgv1y4FpajF2QZZ_Nzd4_Dcm7Dhk4I1LMAGubydg8zA,2763
|
|
3
|
+
twocaptcha/solver.py,sha256=7e-UG_jR4Wq3RCcCWCL9Ftg_tCoMQl4v8YMLi8UHXLA,44727
|
|
4
|
+
2captcha_python-1.5.1.dist-info/LICENSE,sha256=sbILKjQcxUC6dAvBbivnRX9YCshBI9XRvvk1LGkpMEo,1065
|
|
5
|
+
2captcha_python-1.5.1.dist-info/METADATA,sha256=AbudiCcAIGAaesMmn_tFmJF_cPukQTMHzYwXhhg7qbQ,26511
|
|
6
|
+
2captcha_python-1.5.1.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
|
7
|
+
2captcha_python-1.5.1.dist-info/top_level.txt,sha256=AvFZdM89oM6Vo97ZTxT9AxHWpwoO3_Qf5ORMV3NClFE,11
|
|
8
|
+
2captcha_python-1.5.1.dist-info/RECORD,,
|
twocaptcha/__init__.py
CHANGED
|
@@ -3,7 +3,7 @@ from .solver import (TwoCaptcha, SolverExceptions, ValidationException,
|
|
|
3
3
|
NetworkException, ApiException, TimeoutException)
|
|
4
4
|
|
|
5
5
|
"""
|
|
6
|
-
Python 3 package for easy integration with the API of 2captcha captcha solving service to bypass recaptcha,
|
|
6
|
+
Python 3 package for easy integration with the API of 2captcha captcha solving service to bypass recaptcha,
|
|
7
7
|
funcaptcha, geetest and solve any other captchas.
|
|
8
8
|
|
|
9
9
|
website 2captcha [https://2captcha.com/]
|
|
@@ -12,4 +12,4 @@ support@2captcha.com
|
|
|
12
12
|
"""
|
|
13
13
|
|
|
14
14
|
__author__ = '2captcha'
|
|
15
|
-
__version__ = '1.5.
|
|
15
|
+
__version__ = '1.5.1'
|
twocaptcha/solver.py
CHANGED
|
@@ -856,6 +856,33 @@ class TwoCaptcha():
|
|
|
856
856
|
**kwargs)
|
|
857
857
|
return result
|
|
858
858
|
|
|
859
|
+
def yandex_smart(self, sitekey, url, **kwargs):
|
|
860
|
+
'''Wrapper for solving Yandex Smart.
|
|
861
|
+
|
|
862
|
+
Parameters
|
|
863
|
+
__________
|
|
864
|
+
sitekey : str
|
|
865
|
+
The value of data-sitekey attribute of captcha's div element on page.
|
|
866
|
+
url : str
|
|
867
|
+
Full URL of the page where you solve the captcha.
|
|
868
|
+
softId : int, optional
|
|
869
|
+
ID of software developer. Developers who integrated their software with 2Captcha get reward: 10% of
|
|
870
|
+
spendings of their software users.
|
|
871
|
+
callback : str, optional
|
|
872
|
+
URL for pingback (callback) response that will be sent when captcha is solved. URL should be registered on
|
|
873
|
+
the server. More info here https://2captcha.com/2captcha-api#pingback.
|
|
874
|
+
proxy : dict, optional
|
|
875
|
+
{'type': 'HTTPS', 'uri': 'login:password@IP_address:PORT'}.
|
|
876
|
+
userAgent: str, optional
|
|
877
|
+
User-Agent of the browser that will be used by the employee when loading the captcha.
|
|
878
|
+
'''
|
|
879
|
+
|
|
880
|
+
result = self.solve(sitekey=sitekey,
|
|
881
|
+
url=url,
|
|
882
|
+
method='yandex',
|
|
883
|
+
**kwargs)
|
|
884
|
+
return result
|
|
885
|
+
|
|
859
886
|
def solve(self, timeout=0, polling_interval=0, **kwargs):
|
|
860
887
|
'''Sends captcha, receives result.
|
|
861
888
|
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
twocaptcha/__init__.py,sha256=5hH6hJGpkQhNEm8NQG_H5BSO4xyTLWw0MCi2uSLIOJs,473
|
|
2
|
-
twocaptcha/api.py,sha256=qgv1y4FpajF2QZZ_Nzd4_Dcm7Dhk4I1LMAGubydg8zA,2763
|
|
3
|
-
twocaptcha/solver.py,sha256=6jd-k7prawSg25tblsap0REZGptmnNx3wOdWauJlumo,43547
|
|
4
|
-
2captcha_python-1.5.0.dist-info/LICENSE,sha256=sbILKjQcxUC6dAvBbivnRX9YCshBI9XRvvk1LGkpMEo,1065
|
|
5
|
-
2captcha_python-1.5.0.dist-info/METADATA,sha256=3beKcuMQMsuYdTTeudJeLdQe3IOQJ9-0MAfWZaGYjw0,26298
|
|
6
|
-
2captcha_python-1.5.0.dist-info/WHEEL,sha256=UvcQYKBHoFqaQd6LKyqHw9fxEolWLQnlzP0h_LgJAfI,91
|
|
7
|
-
2captcha_python-1.5.0.dist-info/top_level.txt,sha256=AvFZdM89oM6Vo97ZTxT9AxHWpwoO3_Qf5ORMV3NClFE,11
|
|
8
|
-
2captcha_python-1.5.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|