2captcha-python 1.2.6__tar.gz → 1.2.8__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.6 → 2captcha_python-1.2.8/2captcha_python.egg-info}/PKG-INFO +161 -40
- 2captcha_python-1.2.6/README.md → 2captcha_python-1.2.8/PKG-INFO +175 -39
- 2captcha_python-1.2.6/2captcha_python.egg-info/PKG-INFO → 2captcha_python-1.2.8/README.md +155 -54
- {2captcha_python-1.2.6 → 2captcha_python-1.2.8}/setup.py +9 -0
- {2captcha_python-1.2.6 → 2captcha_python-1.2.8}/twocaptcha/__init__.py +1 -1
- {2captcha_python-1.2.6 → 2captcha_python-1.2.8}/twocaptcha/solver.py +5 -2
- {2captcha_python-1.2.6 → 2captcha_python-1.2.8}/2captcha_python.egg-info/SOURCES.txt +0 -0
- {2captcha_python-1.2.6 → 2captcha_python-1.2.8}/2captcha_python.egg-info/dependency_links.txt +0 -0
- {2captcha_python-1.2.6 → 2captcha_python-1.2.8}/2captcha_python.egg-info/requires.txt +0 -0
- {2captcha_python-1.2.6 → 2captcha_python-1.2.8}/2captcha_python.egg-info/top_level.txt +0 -0
- {2captcha_python-1.2.6 → 2captcha_python-1.2.8}/LICENSE +0 -0
- {2captcha_python-1.2.6 → 2captcha_python-1.2.8}/setup.cfg +0 -0
- {2captcha_python-1.2.6 → 2captcha_python-1.2.8}/tests/test_amazon_waf.py +0 -0
- {2captcha_python-1.2.6 → 2captcha_python-1.2.8}/tests/test_atb_captcha.py +0 -0
- {2captcha_python-1.2.6 → 2captcha_python-1.2.8}/tests/test_canvas.py +0 -0
- {2captcha_python-1.2.6 → 2captcha_python-1.2.8}/tests/test_capy.py +0 -0
- {2captcha_python-1.2.6 → 2captcha_python-1.2.8}/tests/test_coordinates.py +0 -0
- {2captcha_python-1.2.6 → 2captcha_python-1.2.8}/tests/test_cutcaptcha.py +0 -0
- {2captcha_python-1.2.6 → 2captcha_python-1.2.8}/tests/test_friendly_captcha.py +0 -0
- {2captcha_python-1.2.6 → 2captcha_python-1.2.8}/tests/test_funcaptcha.py +0 -0
- {2captcha_python-1.2.6 → 2captcha_python-1.2.8}/tests/test_geetest.py +0 -0
- {2captcha_python-1.2.6 → 2captcha_python-1.2.8}/tests/test_geetest_v4.py +0 -0
- {2captcha_python-1.2.6 → 2captcha_python-1.2.8}/tests/test_grid.py +0 -0
- {2captcha_python-1.2.6 → 2captcha_python-1.2.8}/tests/test_hcaptcha.py +0 -0
- {2captcha_python-1.2.6 → 2captcha_python-1.2.8}/tests/test_keycaptcha.py +0 -0
- {2captcha_python-1.2.6 → 2captcha_python-1.2.8}/tests/test_lemin.py +0 -0
- {2captcha_python-1.2.6 → 2captcha_python-1.2.8}/tests/test_mtcaptcha.py +0 -0
- {2captcha_python-1.2.6 → 2captcha_python-1.2.8}/tests/test_normal.py +0 -0
- {2captcha_python-1.2.6 → 2captcha_python-1.2.8}/tests/test_recaptcha.py +0 -0
- {2captcha_python-1.2.6 → 2captcha_python-1.2.8}/tests/test_rotate.py +0 -0
- {2captcha_python-1.2.6 → 2captcha_python-1.2.8}/tests/test_tencent.py +0 -0
- {2captcha_python-1.2.6 → 2captcha_python-1.2.8}/tests/test_text.py +0 -0
- {2captcha_python-1.2.6 → 2captcha_python-1.2.8}/tests/test_turnstile.py +0 -0
- {2captcha_python-1.2.6 → 2captcha_python-1.2.8}/twocaptcha/api.py +0 -0
|
@@ -1,20 +1,25 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: 2captcha-python
|
|
3
|
-
Version: 1.2.
|
|
3
|
+
Version: 1.2.8
|
|
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,hCaptcha,FunCaptcha,Geetest,image captcha,Coordinates,Click Captcha,Geetest V4,Lemin captcha,Amazon WAF,Cloudflare Turnstile,Capy Puzzle,MTCaptcha,Friendly Captcha,Tencent
|
|
8
9
|
Classifier: Programming Language :: Python :: 3
|
|
9
10
|
Classifier: License :: OSI Approved :: MIT License
|
|
10
11
|
Classifier: Operating System :: OS Independent
|
|
12
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
13
|
+
Classifier: Topic :: Scientific/Engineering :: Image Recognition
|
|
14
|
+
Classifier: Topic :: Utilities
|
|
15
|
+
Classifier: Intended Audience :: Developers
|
|
11
16
|
Requires-Python: >=3.6
|
|
12
17
|
Description-Content-Type: text/markdown
|
|
13
18
|
License-File: LICENSE
|
|
14
19
|
Requires-Dist: requests
|
|
15
20
|
|
|
16
21
|
# Python Module for 2Captcha API
|
|
17
|
-
The easiest way to quickly integrate the 2Captcha captcha-solving service into your code and automate the solving of any type of captcha.
|
|
22
|
+
The easiest way to quickly integrate the [2Captcha] captcha-solving service into your code and automate the solving of any type of captcha.
|
|
18
23
|
|
|
19
24
|
- [Python Module for 2Captcha API](#python-module-for-2captcha-api)
|
|
20
25
|
- [Installation](#installation)
|
|
@@ -29,8 +34,8 @@ The easiest way to quickly integrate the 2Captcha captcha-solving service into y
|
|
|
29
34
|
- [reCAPTCHA v3](#recaptcha-v3)
|
|
30
35
|
- [FunCaptcha](#funcaptcha)
|
|
31
36
|
- [GeeTest](#geetest)
|
|
32
|
-
- [hCaptcha](#hcaptcha)
|
|
33
37
|
- [GeeTest v4](#geetest-v4)
|
|
38
|
+
- [hCaptcha](#hcaptcha)
|
|
34
39
|
- [Lemin Cropped Captcha](#lemin-cropped-captcha)
|
|
35
40
|
- [Cloudflare Turnstile](#cloudflare-turnstile)
|
|
36
41
|
- [Amazon WAF](#amazon-waf)
|
|
@@ -49,15 +54,19 @@ The easiest way to quickly integrate the 2Captcha captcha-solving service into y
|
|
|
49
54
|
- [send / get_result](#send--get_result)
|
|
50
55
|
- [balance](#balance)
|
|
51
56
|
- [report](#report)
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
57
|
+
- [Error handling](#error-handling)
|
|
58
|
+
- [Proxies](#proxies)
|
|
59
|
+
- [Async calls](#async-calls)
|
|
60
|
+
- [Examples](#examples)
|
|
61
|
+
- [Useful articles](#useful-articles)
|
|
55
62
|
|
|
56
63
|
## Installation
|
|
57
64
|
|
|
58
65
|
This package can be installed with Pip:
|
|
59
66
|
|
|
60
|
-
```
|
|
67
|
+
```bash
|
|
68
|
+
pip3 install 2captcha-python
|
|
69
|
+
```
|
|
61
70
|
|
|
62
71
|
|
|
63
72
|
## Configuration
|
|
@@ -69,7 +78,7 @@ from twocaptcha import TwoCaptcha
|
|
|
69
78
|
|
|
70
79
|
solver = TwoCaptcha('YOUR_API_KEY')
|
|
71
80
|
```
|
|
72
|
-
Also there are a few options that can be configured:
|
|
81
|
+
Also, there are a few options that can be configured:
|
|
73
82
|
|
|
74
83
|
```python
|
|
75
84
|
config = {
|
|
@@ -86,38 +95,44 @@ solver = TwoCaptcha(**config)
|
|
|
86
95
|
|
|
87
96
|
### TwoCaptcha instance options
|
|
88
97
|
|
|
89
|
-
| Option | Default value | Description
|
|
90
|
-
| ---------------- | --------------
|
|
91
|
-
| server | `2captcha.com` | API server. You can set it to `rucaptcha.com` if your account is registered there
|
|
92
|
-
| softId |
|
|
93
|
-
| callback | - | URL of your web
|
|
94
|
-
| 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 |
|
|
95
|
-
| recaptchaTimeout | 600 | Polling timeout for reCAPTCHA in seconds. Defines how long the module tries to get the answer from `res.php` API endpoint |
|
|
96
|
-
| pollingInterval | 10 | Interval in seconds between requests to `res.php` API endpoint
|
|
98
|
+
| Option | Default value | Description |
|
|
99
|
+
| ---------------- | -------------- |--------------------------------------------------------------------------------------------------------------------------------------------------------|
|
|
100
|
+
| server | `2captcha.com` | API server. You can set it to `rucaptcha.com` if your account is registered there |
|
|
101
|
+
| softId | 4580 | your software ID obtained after publishing in [2captcha software catalog] |
|
|
102
|
+
| callback | - | URL of your web server that receives the captcha recognition result. The URL should be first registered in [pingback settings] of your account |
|
|
103
|
+
| 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 |
|
|
104
|
+
| recaptchaTimeout | 600 | Polling timeout for reCAPTCHA in seconds. Defines how long the module tries to get the answer from the `res.php` API endpoint |
|
|
105
|
+
| pollingInterval | 10 | Interval in seconds between requests to the `res.php` API endpoint. Setting values less than 5 seconds is not recommended |
|
|
106
|
+
|
|
107
|
+
> [!IMPORTANT]
|
|
108
|
+
> Once `callback` is defined for the `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
109
|
|
|
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.
|
|
99
110
|
To get the answer manually use [get_result method](#send--get_result)
|
|
100
111
|
|
|
101
112
|
## Solve captcha
|
|
102
|
-
When you submit any image-based
|
|
113
|
+
When you submit any image-based CAPTCHA, you can provide additional options to help 2captcha workers solve it properly.
|
|
103
114
|
|
|
104
115
|
### Captcha options
|
|
105
116
|
| Option | Default Value | Description |
|
|
106
117
|
| ------------- | ------------- | -------------------------------------------------------------------------------------------------- |
|
|
107
|
-
| numeric | 0 | Defines if captcha contains numeric or other symbols [see more info in the API docs][post options] |
|
|
108
|
-
| minLen | 0 | minimal answer
|
|
118
|
+
| numeric | 0 | Defines if the captcha contains numeric or other symbols [see more info in the API docs][post options] |
|
|
119
|
+
| minLen | 0 | minimal answer length |
|
|
109
120
|
| maxLen | 0 | maximum answer length |
|
|
110
121
|
| phrase | 0 | defines if the answer contains multiple words or not |
|
|
111
122
|
| caseSensitive | 0 | defines if the answer is case sensitive |
|
|
112
123
|
| calc | 0 | defines captcha requires calculation |
|
|
113
|
-
| lang | - | defines the captcha language
|
|
114
|
-
| hintImg | - | an image with hint shown to workers with the captcha |
|
|
124
|
+
| lang | - | defines the captcha language; see the [list of supported languages] |
|
|
125
|
+
| hintImg | - | an image with a hint shown to workers with the captcha |
|
|
115
126
|
| hintText | - | hint or task text shown to workers with the captcha |
|
|
116
127
|
|
|
117
|
-
Below you can find basic examples for every captcha type. Check out [examples directory]
|
|
128
|
+
Below, you can find basic examples for every captcha type. Check out [examples directory] for more examples with all available options.
|
|
118
129
|
|
|
119
130
|
### Normal Captcha
|
|
120
|
-
|
|
131
|
+
|
|
132
|
+
<sup>[API method description.](https://2captcha.com/2captcha-api#solving_normal_captcha)</sup>
|
|
133
|
+
|
|
134
|
+
To bypass a normal captcha (distorted text on an image) use the following method. This method can also be used to recognize any text in an image.
|
|
135
|
+
|
|
121
136
|
```python
|
|
122
137
|
result = solver.normal('path/to/captcha.jpg', param1=..., ...)
|
|
123
138
|
# OR
|
|
@@ -125,7 +140,10 @@ result = solver.normal('https://site-with-captcha.com/path/to/captcha.jpg', para
|
|
|
125
140
|
```
|
|
126
141
|
|
|
127
142
|
### Audio Captcha
|
|
128
|
-
|
|
143
|
+
|
|
144
|
+
<sup>[API method description.](https://2captcha.com/2captcha-api#audio)</sup>
|
|
145
|
+
|
|
146
|
+
Use the following method to bypass an audio captcha (mp3 formats only).
|
|
129
147
|
You must provide the language as `lang = 'en'`. Supported languages are "en", "ru", "de", "el", "pt", "fr".
|
|
130
148
|
|
|
131
149
|
```python
|
|
@@ -135,13 +153,20 @@ result = solver.audio('https://site-with-captcha.com/path/to/captcha.mp3', lang
|
|
|
135
153
|
```
|
|
136
154
|
|
|
137
155
|
### Text Captcha
|
|
156
|
+
|
|
157
|
+
<sup>[API method description.](https://2captcha.com/2captcha-api#solving_text_captcha)</sup>
|
|
158
|
+
|
|
138
159
|
This method can be used to bypass a captcha that requires answering a question provided in clear text.
|
|
139
160
|
```python
|
|
140
161
|
result = solver.text('If tomorrow is Saturday, what day is today?', param1=..., ...)
|
|
141
162
|
```
|
|
142
163
|
|
|
143
164
|
### reCAPTCHA v2
|
|
144
|
-
|
|
165
|
+
|
|
166
|
+
<sup>[API method description.](https://2captcha.com/2captcha-api#solving_recaptchav2_new)</sup>
|
|
167
|
+
|
|
168
|
+
Use the following method to solve reCAPTCHA V2 and obtain a token to bypass the protection.
|
|
169
|
+
|
|
145
170
|
```python
|
|
146
171
|
result = solver.recaptcha(sitekey='6Le-wvkSVVABCPBMRTvw0Q4Muexq1bi0DJwx_mJ-',
|
|
147
172
|
url='https://mysite.com/page/with/recaptcha',
|
|
@@ -149,6 +174,9 @@ result = solver.recaptcha(sitekey='6Le-wvkSVVABCPBMRTvw0Q4Muexq1bi0DJwx_mJ-',
|
|
|
149
174
|
```
|
|
150
175
|
|
|
151
176
|
### reCAPTCHA v3
|
|
177
|
+
|
|
178
|
+
<sup>[API method description.](https://2captcha.com/2captcha-api#solving_recaptchav3)</sup>
|
|
179
|
+
|
|
152
180
|
This method provides a reCAPTCHA V3 solver and returns a token.
|
|
153
181
|
```python
|
|
154
182
|
result = solver.recaptcha(sitekey='6Le-wvkSVVABCPBMRTvw0Q4Muexq1bi0DJwx_mJ-',
|
|
@@ -158,6 +186,9 @@ result = solver.recaptcha(sitekey='6Le-wvkSVVABCPBMRTvw0Q4Muexq1bi0DJwx_mJ-',
|
|
|
158
186
|
```
|
|
159
187
|
|
|
160
188
|
### FunCaptcha
|
|
189
|
+
|
|
190
|
+
<sup>[API method description.](https://2captcha.com/2captcha-api#solving_funcaptcha_new)</sup>
|
|
191
|
+
|
|
161
192
|
FunCaptcha (Arkoselabs) solving method. Returns a token.
|
|
162
193
|
```python
|
|
163
194
|
result = solver.funcaptcha(sitekey='6Le-wvkSVVABCPBMRTvw0Q4Muexq1bi0DJwx_mJ-',
|
|
@@ -168,6 +199,9 @@ result = solver.funcaptcha(sitekey='6Le-wvkSVVABCPBMRTvw0Q4Muexq1bi0DJwx_mJ-',
|
|
|
168
199
|
|
|
169
200
|
|
|
170
201
|
### GeeTest
|
|
202
|
+
|
|
203
|
+
<sup>[API method description.](https://2captcha.com/2captcha-api#solving_geetest)</sup>
|
|
204
|
+
|
|
171
205
|
Method to solve GeeTest puzzle captcha. Returns a set of tokens as JSON.
|
|
172
206
|
```python
|
|
173
207
|
result = solver.geetest(gt='f1ab2cdefa3456789012345b6c78d90e',
|
|
@@ -179,6 +213,9 @@ result = solver.geetest(gt='f1ab2cdefa3456789012345b6c78d90e',
|
|
|
179
213
|
|
|
180
214
|
|
|
181
215
|
### GeeTest v4
|
|
216
|
+
|
|
217
|
+
<sup>[API method description.](https://2captcha.com/2captcha-api#geetest-v4)</sup>
|
|
218
|
+
|
|
182
219
|
Use this method to solve GeeTest v4. Returns the response in JSON.
|
|
183
220
|
```python
|
|
184
221
|
result = solver.geetest_v4(captcha_id='e392e1d7fd421dc63325744d5a2b9c73',
|
|
@@ -189,6 +226,9 @@ result = solver.geetest_v4(captcha_id='e392e1d7fd421dc63325744d5a2b9c73',
|
|
|
189
226
|
|
|
190
227
|
|
|
191
228
|
### hCaptcha
|
|
229
|
+
|
|
230
|
+
<sup>[API method description.](https://2captcha.com/2captcha-api#solving_hcaptcha)</sup>
|
|
231
|
+
|
|
192
232
|
Use this method to solve the hCaptcha challenge. Returns a token to bypass the captcha.
|
|
193
233
|
```python
|
|
194
234
|
result = solver.hcaptcha(sitekey='10000000-ffff-ffff-ffff-000000000001',
|
|
@@ -199,7 +239,10 @@ result = solver.hcaptcha(sitekey='10000000-ffff-ffff-ffff-000000000001',
|
|
|
199
239
|
|
|
200
240
|
|
|
201
241
|
### Lemin Cropped Captcha
|
|
202
|
-
|
|
242
|
+
|
|
243
|
+
<sup>[API method description.](https://2captcha.com/2captcha-api#lemin)</sup>
|
|
244
|
+
|
|
245
|
+
Use this method to solve the Lemin captcha. Returns JSON with an answer containing the following values: answer, challenge_id.
|
|
203
246
|
```python
|
|
204
247
|
result = solver.lemin(captcha_id='CROPPED_1abcd2f_a1234b567c890d12ef3a456bc78d901d',
|
|
205
248
|
div_id='lemin-cropped-captcha',
|
|
@@ -210,6 +253,9 @@ result = solver.lemin(captcha_id='CROPPED_1abcd2f_a1234b567c890d12ef3a456bc78d90
|
|
|
210
253
|
|
|
211
254
|
|
|
212
255
|
### Cloudflare Turnstile
|
|
256
|
+
|
|
257
|
+
<sup>[API method description.](https://2captcha.com/2captcha-api#turnstile)</sup>
|
|
258
|
+
|
|
213
259
|
Use this method to solve Cloudflare Turnstile. Returns JSON with the token.
|
|
214
260
|
```python
|
|
215
261
|
result = solver.turnstile(sitekey='0x1AAAAAAAAkg0s2VIOD34y5',
|
|
@@ -221,6 +267,9 @@ result = solver.turnstile(sitekey='0x1AAAAAAAAkg0s2VIOD34y5',
|
|
|
221
267
|
```
|
|
222
268
|
|
|
223
269
|
### Amazon WAF
|
|
270
|
+
|
|
271
|
+
<sup>[API method description.](https://2captcha.com/2captcha-api#amazon-waf)</sup>
|
|
272
|
+
|
|
224
273
|
Use this method to solve Amazon WAF Captcha also known as AWS WAF Captcha is a part of Intelligent threat mitigation for Amazon AWS. Returns JSON with the token.
|
|
225
274
|
```python
|
|
226
275
|
result = solver.amazon_waf(sitekey='0x1AAAAAAAAkg0s2VIOD34y5',
|
|
@@ -233,6 +282,9 @@ result = solver.amazon_waf(sitekey='0x1AAAAAAAAkg0s2VIOD34y5',
|
|
|
233
282
|
|
|
234
283
|
|
|
235
284
|
### KeyCaptcha
|
|
285
|
+
|
|
286
|
+
<sup>[API method description.](https://2captcha.com/2captcha-api#solving_keycaptcha)</sup>
|
|
287
|
+
|
|
236
288
|
Token-based method to solve KeyCaptcha.
|
|
237
289
|
```python
|
|
238
290
|
result = solver.keycaptcha(s_s_c_user_id=10,
|
|
@@ -246,6 +298,9 @@ result = solver.keycaptcha(s_s_c_user_id=10,
|
|
|
246
298
|
|
|
247
299
|
|
|
248
300
|
### atbCAPTCHA
|
|
301
|
+
|
|
302
|
+
<sup>[API method description.](https://2captcha.com/2captcha-api#atb-captcha)</sup>
|
|
303
|
+
|
|
249
304
|
Use this method to solve atbCaptcha challenge. Returns a token to bypass the captcha.
|
|
250
305
|
```python
|
|
251
306
|
result = solver.atb_captcha(app_id='af25e409b33d722a95e56a230ff8771c',
|
|
@@ -257,6 +312,9 @@ result = solver.atb_captcha(app_id='af25e409b33d722a95e56a230ff8771c',
|
|
|
257
312
|
|
|
258
313
|
|
|
259
314
|
### Capy
|
|
315
|
+
|
|
316
|
+
<sup>[API method description.](https://2captcha.com/2captcha-api#solving_capy)</sup>
|
|
317
|
+
|
|
260
318
|
Token-based method to bypass Capy puzzle captcha.
|
|
261
319
|
```python
|
|
262
320
|
result = solver.capy(sitekey='PUZZLE_Abc1dEFghIJKLM2no34P56q7rStu8v',
|
|
@@ -265,30 +323,49 @@ result = solver.capy(sitekey='PUZZLE_Abc1dEFghIJKLM2no34P56q7rStu8v',
|
|
|
265
323
|
param1=..., ...)
|
|
266
324
|
```
|
|
267
325
|
### Grid
|
|
268
|
-
|
|
326
|
+
|
|
327
|
+
<sup>[API method description.](https://2captcha.com/2captcha-api#grid)</sup>
|
|
328
|
+
|
|
329
|
+
The 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.
|
|
330
|
+
|
|
269
331
|
```python
|
|
270
332
|
result = solver.grid('path/to/captcha.jpg', param1=..., ...)
|
|
271
333
|
```
|
|
272
334
|
|
|
273
335
|
### Canvas
|
|
274
|
-
|
|
336
|
+
|
|
337
|
+
<sup>[API method description.](https://2captcha.com/2captcha-api#canvas)</sup>
|
|
338
|
+
|
|
339
|
+
The 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.
|
|
340
|
+
|
|
275
341
|
```python
|
|
276
342
|
result = solver.canvas('path/to/captcha.jpg', param1=..., ...)
|
|
277
343
|
```
|
|
278
344
|
|
|
279
345
|
### ClickCaptcha
|
|
280
|
-
|
|
346
|
+
|
|
347
|
+
<sup>[API method description.](https://2captcha.com/2captcha-api#coordinates)</sup>
|
|
348
|
+
|
|
349
|
+
The ClickCaptcha method returns the coordinates of points on the captcha image. It can be used if you need to click on particular points in the image.
|
|
350
|
+
|
|
281
351
|
```python
|
|
282
352
|
result = solver.coordinates('path/to/captcha.jpg', param1=..., ...)
|
|
283
353
|
```
|
|
284
354
|
|
|
285
355
|
### Rotate
|
|
286
|
-
|
|
356
|
+
|
|
357
|
+
<sup>[API method description.](https://2captcha.com/2captcha-api#solving_rotatecaptcha)</sup>
|
|
358
|
+
|
|
359
|
+
This method can be used to solve a captcha that asks to rotate an object. It is mostly used to bypass FunCaptcha. Returns the rotation angle.
|
|
360
|
+
|
|
287
361
|
```python
|
|
288
362
|
result = solver.rotate('path/to/captcha.jpg', param1=..., ...)
|
|
289
363
|
```
|
|
290
364
|
|
|
291
365
|
### MTCaptcha
|
|
366
|
+
|
|
367
|
+
<sup>[API method description.](https://2captcha.com/2captcha-api#mtcaptcha)</sup>
|
|
368
|
+
|
|
292
369
|
Use this method to solve MTCaptcha and obtain a token to bypass the protection.
|
|
293
370
|
```python
|
|
294
371
|
result = solver.mtcaptcha(sitekey='MTPublic-KzqLY1cKH',
|
|
@@ -297,7 +374,14 @@ result = solver.mtcaptcha(sitekey='MTPublic-KzqLY1cKH',
|
|
|
297
374
|
```
|
|
298
375
|
|
|
299
376
|
### Friendly Captcha
|
|
377
|
+
|
|
378
|
+
<sup>[API method description.](https://2captcha.com/2captcha-api#friendly-captcha)</sup>
|
|
379
|
+
|
|
300
380
|
Friendly Captcha solving method. Returns a token.
|
|
381
|
+
|
|
382
|
+
> [!IMPORTANT]
|
|
383
|
+
> To successfully use the received token, the captcha widget must not be loaded on the page. To do this, you need to abort request to `/friendlycaptcha/...module.min.js` on the page. When the captcha widget is already loaded on the page, there is a high probability that the received token will not work.
|
|
384
|
+
|
|
301
385
|
```python
|
|
302
386
|
result = solver.friendly_captcha(sitekey='FCMGEMUD2KTDSQ5H',
|
|
303
387
|
url='https://friendlycaptcha.com/demo',
|
|
@@ -305,6 +389,9 @@ result = solver.friendly_captcha(sitekey='FCMGEMUD2KTDSQ5H',
|
|
|
305
389
|
```
|
|
306
390
|
|
|
307
391
|
### Cutcaptcha
|
|
392
|
+
|
|
393
|
+
<sup>[API method description.](https://2captcha.com/2captcha-api#cutcaptcha)</sup>
|
|
394
|
+
|
|
308
395
|
Use this method to solve Cutcaptcha. Returns the response in JSON.
|
|
309
396
|
```python
|
|
310
397
|
result = solver.cutcaptcha(misery_key='ad52c87af17e2ec09b8d918c9f00416b1cb8c320',
|
|
@@ -314,6 +401,9 @@ result = solver.cutcaptcha(misery_key='ad52c87af17e2ec09b8d918c9f00416b1cb8c320'
|
|
|
314
401
|
```
|
|
315
402
|
|
|
316
403
|
### Tencent
|
|
404
|
+
|
|
405
|
+
<sup>[API method description.](https://2captcha.com/2captcha-api#tencent)</sup>
|
|
406
|
+
|
|
317
407
|
Use this method to solve Cutcaptcha. Returns a token.
|
|
318
408
|
```python
|
|
319
409
|
result = solver.tencent(app_id="197326679",
|
|
@@ -324,7 +414,11 @@ result = solver.tencent(app_id="197326679",
|
|
|
324
414
|
## Other methods
|
|
325
415
|
|
|
326
416
|
### send / get_result
|
|
327
|
-
These methods can be used for manual captcha submission and answer polling.
|
|
417
|
+
These methods can be used for manual captcha submission and answer polling. The `send()` method supports sending any captcha
|
|
418
|
+
type, to specify the captcha type you must send value `method` manually, for example `method='hcaptcha'` for solving hCapthca.
|
|
419
|
+
You can find the value of the `method` parameter in the [API documentation](https://2captcha.com/2captcha-api).
|
|
420
|
+
|
|
421
|
+
Example for solving Normal captcha manually:
|
|
328
422
|
```python
|
|
329
423
|
import time
|
|
330
424
|
. . . . .
|
|
@@ -333,24 +427,42 @@ import time
|
|
|
333
427
|
id = solver.send(file='path/to/captcha.jpg')
|
|
334
428
|
time.sleep(20)
|
|
335
429
|
|
|
430
|
+
code = solver.get_result(id)
|
|
431
|
+
```
|
|
432
|
+
Example for solving hCaptcha manually:
|
|
433
|
+
```python
|
|
434
|
+
import time
|
|
435
|
+
. . . . .
|
|
436
|
+
id = solver.send(sitekey='41b778e7-8f20-45cc-a804-1f1ebb45c579',
|
|
437
|
+
url='https://2captcha.com/demo/hcaptcha?difficulty=easy',
|
|
438
|
+
method='hcaptcha')
|
|
439
|
+
print(id)
|
|
440
|
+
time.sleep(20)
|
|
336
441
|
code = solver.get_result(id)
|
|
337
442
|
```
|
|
338
443
|
|
|
339
444
|
### balance
|
|
445
|
+
|
|
446
|
+
<sup>[API method description.](https://2captcha.com/2captcha-api#additional-methods)</sup>
|
|
447
|
+
|
|
340
448
|
Use this method to get your account's balance
|
|
341
449
|
```python
|
|
342
450
|
balance = solver.balance()
|
|
343
451
|
```
|
|
344
452
|
|
|
345
453
|
### report
|
|
454
|
+
|
|
455
|
+
<sup>[API method description.](https://2captcha.com/2captcha-api#complain)</sup>
|
|
456
|
+
|
|
346
457
|
Use this method to report good or bad captcha answers.
|
|
347
458
|
```python
|
|
348
459
|
solver.report(id, True) # captcha solved correctly
|
|
349
460
|
solver.report(id, False) # captcha solved incorrectly
|
|
350
461
|
```
|
|
351
462
|
|
|
352
|
-
|
|
353
|
-
In case of an error, the captcha solver throws an exception. It's important to properly handle these cases. We recommend using `try except` to handle exceptions.
|
|
463
|
+
## Error handling
|
|
464
|
+
In case of an error, the captcha solver throws an exception. It's important to properly handle these cases. We recommend using `try except` to handle exceptions.
|
|
465
|
+
The list of all errors can be found in the [API documentation](https://2captcha.com/2captcha-api#list-of-inphp-errors).
|
|
354
466
|
```python
|
|
355
467
|
try:
|
|
356
468
|
result = solver.text('If tomorrow is Saturday, what day is today?')
|
|
@@ -369,13 +481,14 @@ except TimeoutException as e:
|
|
|
369
481
|
```
|
|
370
482
|
|
|
371
483
|
|
|
372
|
-
|
|
484
|
+
## Proxies
|
|
485
|
+
|
|
486
|
+
You can pass your proxy as an additional argument for the following methods: recaptcha, funcaptcha, geetest, geetest v4, hcaptcha,
|
|
487
|
+
keycaptcha, capy puzzle, lemin, atbcaptcha, turnstile, amazon waf, mtcaptcha, friendly captcha, cutcaptcha.
|
|
373
488
|
|
|
374
|
-
You can pass your proxy as an additional argument for methods: recaptcha, funcaptcha, geetest, geetest v4, hcaptcha,
|
|
375
|
-
keycaptcha, capy puzzle, lemin, atbcaptcha, turnstile, tencent, amazon waf, mtcaptcha, friendly captcha, cutcaptcha.
|
|
376
489
|
The proxy will be forwarded to the API to solve the captcha.
|
|
377
490
|
|
|
378
|
-
We have our own proxies that we can offer you. [Buy residential proxies]
|
|
491
|
+
We have our own proxies that we can offer you. [Buy residential proxies] to avoid restrictions and blocks. [Quick start].
|
|
379
492
|
|
|
380
493
|
```python
|
|
381
494
|
proxy={
|
|
@@ -384,7 +497,7 @@ proxy={
|
|
|
384
497
|
}
|
|
385
498
|
```
|
|
386
499
|
|
|
387
|
-
|
|
500
|
+
## Async calls
|
|
388
501
|
You can also make async calls with [asyncio], for example:
|
|
389
502
|
|
|
390
503
|
```python
|
|
@@ -403,10 +516,17 @@ async def captchaSolver(image):
|
|
|
403
516
|
|
|
404
517
|
captcha_result = asyncio.run(captchaSolver(image))
|
|
405
518
|
```
|
|
519
|
+
## Examples
|
|
520
|
+
Examples of solving all supported captcha types are located in the [examples] directory.
|
|
521
|
+
|
|
522
|
+
## Useful articles
|
|
406
523
|
|
|
524
|
+
- Amazon captcha solver: Code example for bypassing the [Amazon captcha](https://2captcha.com/blog/amazon-captcha-solving)
|
|
525
|
+
- [Captcha bypass in Selenium](https://2captcha.com/blog/captcha-bypass-in-selenium)
|
|
407
526
|
|
|
527
|
+
<!-- Shared links for README.md -->
|
|
408
528
|
[2Captcha]: https://2captcha.com/
|
|
409
|
-
[2captcha
|
|
529
|
+
[2captcha software catalog]: https://2captcha.com/software
|
|
410
530
|
[pingback settings]: https://2captcha.com/setting/pingback
|
|
411
531
|
[post options]: https://2captcha.com/2captcha-api#normal_post
|
|
412
532
|
[list of supported languages]: https://2captcha.com/2captcha-api#language
|
|
@@ -414,3 +534,4 @@ captcha_result = asyncio.run(captchaSolver(image))
|
|
|
414
534
|
[asyncio]: https://docs.python.org/3/library/asyncio.html
|
|
415
535
|
[Buy residential proxies]: https://2captcha.com/proxy/residential-proxies
|
|
416
536
|
[Quick start]: https://2captcha.com/proxy?openAddTrafficModal=true
|
|
537
|
+
[examples]: ./examples
|