2captcha-python 1.2.5__tar.gz → 1.2.7__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.7}/2captcha_python.egg-info/PKG-INFO +141 -33
- {2captcha_python-1.2.5 → 2captcha_python-1.2.7}/PKG-INFO +141 -33
- {2captcha_python-1.2.5 → 2captcha_python-1.2.7}/README.md +140 -32
- {2captcha_python-1.2.5 → 2captcha_python-1.2.7}/twocaptcha/__init__.py +1 -1
- {2captcha_python-1.2.5 → 2captcha_python-1.2.7}/twocaptcha/solver.py +11 -3
- {2captcha_python-1.2.5 → 2captcha_python-1.2.7}/2captcha_python.egg-info/SOURCES.txt +0 -0
- {2captcha_python-1.2.5 → 2captcha_python-1.2.7}/2captcha_python.egg-info/dependency_links.txt +0 -0
- {2captcha_python-1.2.5 → 2captcha_python-1.2.7}/2captcha_python.egg-info/requires.txt +0 -0
- {2captcha_python-1.2.5 → 2captcha_python-1.2.7}/2captcha_python.egg-info/top_level.txt +0 -0
- {2captcha_python-1.2.5 → 2captcha_python-1.2.7}/LICENSE +0 -0
- {2captcha_python-1.2.5 → 2captcha_python-1.2.7}/setup.cfg +0 -0
- {2captcha_python-1.2.5 → 2captcha_python-1.2.7}/setup.py +0 -0
- {2captcha_python-1.2.5 → 2captcha_python-1.2.7}/tests/test_amazon_waf.py +0 -0
- {2captcha_python-1.2.5 → 2captcha_python-1.2.7}/tests/test_atb_captcha.py +0 -0
- {2captcha_python-1.2.5 → 2captcha_python-1.2.7}/tests/test_canvas.py +0 -0
- {2captcha_python-1.2.5 → 2captcha_python-1.2.7}/tests/test_capy.py +0 -0
- {2captcha_python-1.2.5 → 2captcha_python-1.2.7}/tests/test_coordinates.py +0 -0
- {2captcha_python-1.2.5 → 2captcha_python-1.2.7}/tests/test_cutcaptcha.py +0 -0
- {2captcha_python-1.2.5 → 2captcha_python-1.2.7}/tests/test_friendly_captcha.py +0 -0
- {2captcha_python-1.2.5 → 2captcha_python-1.2.7}/tests/test_funcaptcha.py +0 -0
- {2captcha_python-1.2.5 → 2captcha_python-1.2.7}/tests/test_geetest.py +0 -0
- {2captcha_python-1.2.5 → 2captcha_python-1.2.7}/tests/test_geetest_v4.py +0 -0
- {2captcha_python-1.2.5 → 2captcha_python-1.2.7}/tests/test_grid.py +0 -0
- {2captcha_python-1.2.5 → 2captcha_python-1.2.7}/tests/test_hcaptcha.py +0 -0
- {2captcha_python-1.2.5 → 2captcha_python-1.2.7}/tests/test_keycaptcha.py +0 -0
- {2captcha_python-1.2.5 → 2captcha_python-1.2.7}/tests/test_lemin.py +0 -0
- {2captcha_python-1.2.5 → 2captcha_python-1.2.7}/tests/test_mtcaptcha.py +0 -0
- {2captcha_python-1.2.5 → 2captcha_python-1.2.7}/tests/test_normal.py +0 -0
- {2captcha_python-1.2.5 → 2captcha_python-1.2.7}/tests/test_recaptcha.py +0 -0
- {2captcha_python-1.2.5 → 2captcha_python-1.2.7}/tests/test_rotate.py +0 -0
- {2captcha_python-1.2.5 → 2captcha_python-1.2.7}/tests/test_tencent.py +0 -0
- {2captcha_python-1.2.5 → 2captcha_python-1.2.7}/tests/test_text.py +0 -0
- {2captcha_python-1.2.5 → 2captcha_python-1.2.7}/tests/test_turnstile.py +0 -0
- {2captcha_python-1.2.5 → 2captcha_python-1.2.7}/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.7
|
|
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,19 +44,23 @@ 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)
|
|
52
53
|
- [Proxies](#proxies)
|
|
53
54
|
- [Async calls](#async-calls)
|
|
55
|
+
- [Examples](#examples)
|
|
54
56
|
|
|
55
57
|
## Installation
|
|
56
58
|
|
|
57
59
|
This package can be installed with Pip:
|
|
58
60
|
|
|
59
|
-
```
|
|
61
|
+
```bash
|
|
62
|
+
pip3 install 2captcha-python
|
|
63
|
+
```
|
|
60
64
|
|
|
61
65
|
|
|
62
66
|
## Configuration
|
|
@@ -68,7 +72,7 @@ from twocaptcha import TwoCaptcha
|
|
|
68
72
|
|
|
69
73
|
solver = TwoCaptcha('YOUR_API_KEY')
|
|
70
74
|
```
|
|
71
|
-
Also there are a few options that can be configured:
|
|
75
|
+
Also, there are a few options that can be configured:
|
|
72
76
|
|
|
73
77
|
```python
|
|
74
78
|
config = {
|
|
@@ -88,35 +92,39 @@ solver = TwoCaptcha(**config)
|
|
|
88
92
|
| Option | Default value | Description |
|
|
89
93
|
| ---------------- | -------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
90
94
|
| server | `2captcha.com` | API server. You can set it to `rucaptcha.com` if your account is registered there |
|
|
91
|
-
| softId | - | your software ID obtained after publishing in [2captcha
|
|
92
|
-
| callback | - | URL of your web
|
|
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 |
|
|
95
|
-
| pollingInterval | 10 | Interval in seconds between requests to `res.php` API endpoint
|
|
95
|
+
| softId | - | your software ID obtained after publishing in [2captcha software catalog] |
|
|
96
|
+
| callback | - | URL of your web server that receives the captcha recognition result. The URL should be first registered in [pingback settings] of your account |
|
|
97
|
+
| 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 |
|
|
98
|
+
| recaptchaTimeout | 600 | Polling timeout for reCAPTCHA in seconds. Defines how long the module tries to get the answer from the `res.php` API endpoint |
|
|
99
|
+
| pollingInterval | 10 | Interval in seconds between requests to the `res.php` API endpoint. Setting values less than 5 seconds is not recommended |
|
|
96
100
|
|
|
97
|
-
>
|
|
98
|
-
To get the answer manually use [get_result method](#send--
|
|
101
|
+
> **IMPORTANT:** 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.
|
|
102
|
+
To get the answer manually use [get_result method](#send--get_result)
|
|
99
103
|
|
|
100
104
|
## Solve captcha
|
|
101
|
-
When you submit any image-based
|
|
105
|
+
When you submit any image-based CAPTCHA, you can provide additional options to help 2captcha workers solve it properly.
|
|
102
106
|
|
|
103
107
|
### Captcha options
|
|
104
108
|
| Option | Default Value | Description |
|
|
105
109
|
| ------------- | ------------- | -------------------------------------------------------------------------------------------------- |
|
|
106
|
-
| numeric | 0 | Defines if captcha contains numeric or other symbols [see more info in the API docs][post options] |
|
|
107
|
-
| minLen | 0 | minimal answer
|
|
110
|
+
| numeric | 0 | Defines if the captcha contains numeric or other symbols [see more info in the API docs][post options] |
|
|
111
|
+
| minLen | 0 | minimal answer length |
|
|
108
112
|
| maxLen | 0 | maximum answer length |
|
|
109
113
|
| phrase | 0 | defines if the answer contains multiple words or not |
|
|
110
114
|
| caseSensitive | 0 | defines if the answer is case sensitive |
|
|
111
115
|
| calc | 0 | defines captcha requires calculation |
|
|
112
|
-
| lang | - | defines the captcha language
|
|
113
|
-
| hintImg | - | an image with hint shown to workers with the captcha |
|
|
116
|
+
| lang | - | defines the captcha language; see the [list of supported languages] |
|
|
117
|
+
| hintImg | - | an image with a hint shown to workers with the captcha |
|
|
114
118
|
| hintText | - | hint or task text shown to workers with the captcha |
|
|
115
119
|
|
|
116
|
-
Below you can find basic examples for every captcha type. Check out [examples directory]
|
|
120
|
+
Below, you can find basic examples for every captcha type. Check out [examples directory] for more examples with all available options.
|
|
117
121
|
|
|
118
122
|
### Normal Captcha
|
|
119
|
-
|
|
123
|
+
|
|
124
|
+
<sup>[API method description.](https://2captcha.com/2captcha-api#solving_normal_captcha)</sup>
|
|
125
|
+
|
|
126
|
+
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.
|
|
127
|
+
|
|
120
128
|
```python
|
|
121
129
|
result = solver.normal('path/to/captcha.jpg', param1=..., ...)
|
|
122
130
|
# OR
|
|
@@ -124,8 +132,11 @@ result = solver.normal('https://site-with-captcha.com/path/to/captcha.jpg', para
|
|
|
124
132
|
```
|
|
125
133
|
|
|
126
134
|
### Audio Captcha
|
|
127
|
-
|
|
128
|
-
|
|
135
|
+
|
|
136
|
+
<sup>[API method description.](https://2captcha.com/2captcha-api#audio)</sup>
|
|
137
|
+
|
|
138
|
+
Use the following method to bypass an audio captcha (mp3 formats only).
|
|
139
|
+
You must provide the language as `lang = 'en'`. Supported languages are "en", "ru", "de", "el", "pt", "fr".
|
|
129
140
|
|
|
130
141
|
```python
|
|
131
142
|
result = solver.audio('path/to/captcha.mp3', lang = 'lang', param1=..., ...)
|
|
@@ -134,13 +145,20 @@ result = solver.audio('https://site-with-captcha.com/path/to/captcha.mp3', lang
|
|
|
134
145
|
```
|
|
135
146
|
|
|
136
147
|
### Text Captcha
|
|
148
|
+
|
|
149
|
+
<sup>[API method description.](https://2captcha.com/2captcha-api#solving_text_captcha)</sup>
|
|
150
|
+
|
|
137
151
|
This method can be used to bypass a captcha that requires answering a question provided in clear text.
|
|
138
152
|
```python
|
|
139
153
|
result = solver.text('If tomorrow is Saturday, what day is today?', param1=..., ...)
|
|
140
154
|
```
|
|
141
155
|
|
|
142
156
|
### reCAPTCHA v2
|
|
143
|
-
|
|
157
|
+
|
|
158
|
+
<sup>[API method description.](https://2captcha.com/2captcha-api#solving_recaptchav2_new)</sup>
|
|
159
|
+
|
|
160
|
+
Use the following method to solve reCAPTCHA V2 and obtain a token to bypass the protection.
|
|
161
|
+
|
|
144
162
|
```python
|
|
145
163
|
result = solver.recaptcha(sitekey='6Le-wvkSVVABCPBMRTvw0Q4Muexq1bi0DJwx_mJ-',
|
|
146
164
|
url='https://mysite.com/page/with/recaptcha',
|
|
@@ -148,6 +166,9 @@ result = solver.recaptcha(sitekey='6Le-wvkSVVABCPBMRTvw0Q4Muexq1bi0DJwx_mJ-',
|
|
|
148
166
|
```
|
|
149
167
|
|
|
150
168
|
### reCAPTCHA v3
|
|
169
|
+
|
|
170
|
+
<sup>[API method description.](https://2captcha.com/2captcha-api#solving_recaptchav3)</sup>
|
|
171
|
+
|
|
151
172
|
This method provides a reCAPTCHA V3 solver and returns a token.
|
|
152
173
|
```python
|
|
153
174
|
result = solver.recaptcha(sitekey='6Le-wvkSVVABCPBMRTvw0Q4Muexq1bi0DJwx_mJ-',
|
|
@@ -157,6 +178,9 @@ result = solver.recaptcha(sitekey='6Le-wvkSVVABCPBMRTvw0Q4Muexq1bi0DJwx_mJ-',
|
|
|
157
178
|
```
|
|
158
179
|
|
|
159
180
|
### FunCaptcha
|
|
181
|
+
|
|
182
|
+
<sup>[API method description.](https://2captcha.com/2captcha-api#solving_funcaptcha_new)</sup>
|
|
183
|
+
|
|
160
184
|
FunCaptcha (Arkoselabs) solving method. Returns a token.
|
|
161
185
|
```python
|
|
162
186
|
result = solver.funcaptcha(sitekey='6Le-wvkSVVABCPBMRTvw0Q4Muexq1bi0DJwx_mJ-',
|
|
@@ -167,6 +191,9 @@ result = solver.funcaptcha(sitekey='6Le-wvkSVVABCPBMRTvw0Q4Muexq1bi0DJwx_mJ-',
|
|
|
167
191
|
|
|
168
192
|
|
|
169
193
|
### GeeTest
|
|
194
|
+
|
|
195
|
+
<sup>[API method description.](https://2captcha.com/2captcha-api#solving_geetest)</sup>
|
|
196
|
+
|
|
170
197
|
Method to solve GeeTest puzzle captcha. Returns a set of tokens as JSON.
|
|
171
198
|
```python
|
|
172
199
|
result = solver.geetest(gt='f1ab2cdefa3456789012345b6c78d90e',
|
|
@@ -178,6 +205,9 @@ result = solver.geetest(gt='f1ab2cdefa3456789012345b6c78d90e',
|
|
|
178
205
|
|
|
179
206
|
|
|
180
207
|
### GeeTest v4
|
|
208
|
+
|
|
209
|
+
<sup>[API method description.](https://2captcha.com/2captcha-api#geetest-v4)</sup>
|
|
210
|
+
|
|
181
211
|
Use this method to solve GeeTest v4. Returns the response in JSON.
|
|
182
212
|
```python
|
|
183
213
|
result = solver.geetest_v4(captcha_id='e392e1d7fd421dc63325744d5a2b9c73',
|
|
@@ -188,6 +218,9 @@ result = solver.geetest_v4(captcha_id='e392e1d7fd421dc63325744d5a2b9c73',
|
|
|
188
218
|
|
|
189
219
|
|
|
190
220
|
### hCaptcha
|
|
221
|
+
|
|
222
|
+
<sup>[API method description.](https://2captcha.com/2captcha-api#solving_hcaptcha)</sup>
|
|
223
|
+
|
|
191
224
|
Use this method to solve the hCaptcha challenge. Returns a token to bypass the captcha.
|
|
192
225
|
```python
|
|
193
226
|
result = solver.hcaptcha(sitekey='10000000-ffff-ffff-ffff-000000000001',
|
|
@@ -198,6 +231,9 @@ result = solver.hcaptcha(sitekey='10000000-ffff-ffff-ffff-000000000001',
|
|
|
198
231
|
|
|
199
232
|
|
|
200
233
|
### Lemin Cropped Captcha
|
|
234
|
+
|
|
235
|
+
<sup>[API method description.](https://2captcha.com/2captcha-api#lemin)</sup>
|
|
236
|
+
|
|
201
237
|
Use this method to solve hCaptcha challenge. Returns JSON with an answer containing the following values: answer, challenge_id.
|
|
202
238
|
```python
|
|
203
239
|
result = solver.lemin(captcha_id='CROPPED_1abcd2f_a1234b567c890d12ef3a456bc78d901d',
|
|
@@ -209,6 +245,9 @@ result = solver.lemin(captcha_id='CROPPED_1abcd2f_a1234b567c890d12ef3a456bc78d90
|
|
|
209
245
|
|
|
210
246
|
|
|
211
247
|
### Cloudflare Turnstile
|
|
248
|
+
|
|
249
|
+
<sup>[API method description.](https://2captcha.com/2captcha-api#turnstile)</sup>
|
|
250
|
+
|
|
212
251
|
Use this method to solve Cloudflare Turnstile. Returns JSON with the token.
|
|
213
252
|
```python
|
|
214
253
|
result = solver.turnstile(sitekey='0x1AAAAAAAAkg0s2VIOD34y5',
|
|
@@ -220,6 +259,9 @@ result = solver.turnstile(sitekey='0x1AAAAAAAAkg0s2VIOD34y5',
|
|
|
220
259
|
```
|
|
221
260
|
|
|
222
261
|
### Amazon WAF
|
|
262
|
+
|
|
263
|
+
<sup>[API method description.](https://2captcha.com/2captcha-api#amazon-waf)</sup>
|
|
264
|
+
|
|
223
265
|
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.
|
|
224
266
|
```python
|
|
225
267
|
result = solver.amazon_waf(sitekey='0x1AAAAAAAAkg0s2VIOD34y5',
|
|
@@ -232,6 +274,9 @@ result = solver.amazon_waf(sitekey='0x1AAAAAAAAkg0s2VIOD34y5',
|
|
|
232
274
|
|
|
233
275
|
|
|
234
276
|
### KeyCaptcha
|
|
277
|
+
|
|
278
|
+
<sup>[API method description.](https://2captcha.com/2captcha-api#solving_keycaptcha)</sup>
|
|
279
|
+
|
|
235
280
|
Token-based method to solve KeyCaptcha.
|
|
236
281
|
```python
|
|
237
282
|
result = solver.keycaptcha(s_s_c_user_id=10,
|
|
@@ -245,6 +290,9 @@ result = solver.keycaptcha(s_s_c_user_id=10,
|
|
|
245
290
|
|
|
246
291
|
|
|
247
292
|
### atbCAPTCHA
|
|
293
|
+
|
|
294
|
+
<sup>[API method description.](https://2captcha.com/2captcha-api#atb-captcha)</sup>
|
|
295
|
+
|
|
248
296
|
Use this method to solve atbCaptcha challenge. Returns a token to bypass the captcha.
|
|
249
297
|
```python
|
|
250
298
|
result = solver.atb_captcha(app_id='af25e409b33d722a95e56a230ff8771c',
|
|
@@ -256,6 +304,9 @@ result = solver.atb_captcha(app_id='af25e409b33d722a95e56a230ff8771c',
|
|
|
256
304
|
|
|
257
305
|
|
|
258
306
|
### Capy
|
|
307
|
+
|
|
308
|
+
<sup>[API method description.](https://2captcha.com/2captcha-api#solving_capy)</sup>
|
|
309
|
+
|
|
259
310
|
Token-based method to bypass Capy puzzle captcha.
|
|
260
311
|
```python
|
|
261
312
|
result = solver.capy(sitekey='PUZZLE_Abc1dEFghIJKLM2no34P56q7rStu8v',
|
|
@@ -264,30 +315,49 @@ result = solver.capy(sitekey='PUZZLE_Abc1dEFghIJKLM2no34P56q7rStu8v',
|
|
|
264
315
|
param1=..., ...)
|
|
265
316
|
```
|
|
266
317
|
### Grid
|
|
267
|
-
|
|
318
|
+
|
|
319
|
+
<sup>[API method description.](https://2captcha.com/2captcha-api#grid)</sup>
|
|
320
|
+
|
|
321
|
+
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.
|
|
322
|
+
|
|
268
323
|
```python
|
|
269
324
|
result = solver.grid('path/to/captcha.jpg', param1=..., ...)
|
|
270
325
|
```
|
|
271
326
|
|
|
272
327
|
### Canvas
|
|
273
|
-
|
|
328
|
+
|
|
329
|
+
<sup>[API method description.](https://2captcha.com/2captcha-api#canvas)</sup>
|
|
330
|
+
|
|
331
|
+
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.
|
|
332
|
+
|
|
274
333
|
```python
|
|
275
334
|
result = solver.canvas('path/to/captcha.jpg', param1=..., ...)
|
|
276
335
|
```
|
|
277
336
|
|
|
278
337
|
### ClickCaptcha
|
|
279
|
-
|
|
338
|
+
|
|
339
|
+
<sup>[API method description.](https://2captcha.com/2captcha-api#coordinates)</sup>
|
|
340
|
+
|
|
341
|
+
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.
|
|
342
|
+
|
|
280
343
|
```python
|
|
281
344
|
result = solver.coordinates('path/to/captcha.jpg', param1=..., ...)
|
|
282
345
|
```
|
|
283
346
|
|
|
284
347
|
### Rotate
|
|
285
|
-
|
|
348
|
+
|
|
349
|
+
<sup>[API method description.](https://2captcha.com/2captcha-api#solving_rotatecaptcha)</sup>
|
|
350
|
+
|
|
351
|
+
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.
|
|
352
|
+
|
|
286
353
|
```python
|
|
287
354
|
result = solver.rotate('path/to/captcha.jpg', param1=..., ...)
|
|
288
355
|
```
|
|
289
356
|
|
|
290
357
|
### MTCaptcha
|
|
358
|
+
|
|
359
|
+
<sup>[API method description.](https://2captcha.com/2captcha-api#mtcaptcha)</sup>
|
|
360
|
+
|
|
291
361
|
Use this method to solve MTCaptcha and obtain a token to bypass the protection.
|
|
292
362
|
```python
|
|
293
363
|
result = solver.mtcaptcha(sitekey='MTPublic-KzqLY1cKH',
|
|
@@ -296,6 +366,9 @@ result = solver.mtcaptcha(sitekey='MTPublic-KzqLY1cKH',
|
|
|
296
366
|
```
|
|
297
367
|
|
|
298
368
|
### Friendly Captcha
|
|
369
|
+
|
|
370
|
+
<sup>[API method description.](https://2captcha.com/2captcha-api#friendly-captcha)</sup>
|
|
371
|
+
|
|
299
372
|
Friendly Captcha solving method. Returns a token.
|
|
300
373
|
```python
|
|
301
374
|
result = solver.friendly_captcha(sitekey='FCMGEMUD2KTDSQ5H',
|
|
@@ -304,6 +377,9 @@ result = solver.friendly_captcha(sitekey='FCMGEMUD2KTDSQ5H',
|
|
|
304
377
|
```
|
|
305
378
|
|
|
306
379
|
### Cutcaptcha
|
|
380
|
+
|
|
381
|
+
<sup>[API method description.](https://2captcha.com/2captcha-api#cutcaptcha)</sup>
|
|
382
|
+
|
|
307
383
|
Use this method to solve Cutcaptcha. Returns the response in JSON.
|
|
308
384
|
```python
|
|
309
385
|
result = solver.cutcaptcha(misery_key='ad52c87af17e2ec09b8d918c9f00416b1cb8c320',
|
|
@@ -312,11 +388,25 @@ result = solver.cutcaptcha(misery_key='ad52c87af17e2ec09b8d918c9f00416b1cb8c320'
|
|
|
312
388
|
param1=..., ...)
|
|
313
389
|
```
|
|
314
390
|
|
|
391
|
+
### Tencent
|
|
392
|
+
|
|
393
|
+
<sup>[API method description.](https://2captcha.com/2captcha-api#tencent)</sup>
|
|
394
|
+
|
|
395
|
+
Use this method to solve Cutcaptcha. Returns a token.
|
|
396
|
+
```python
|
|
397
|
+
result = solver.tencent(app_id="197326679",
|
|
398
|
+
url="https://mysite.com/page/with/tencent",
|
|
399
|
+
param1=..., ...)
|
|
400
|
+
```
|
|
315
401
|
|
|
316
402
|
## Other methods
|
|
317
403
|
|
|
318
404
|
### send / get_result
|
|
319
|
-
These methods can be used for manual captcha submission and answer polling.
|
|
405
|
+
These methods can be used for manual captcha submission and answer polling. The `send()` method supports sending any captcha
|
|
406
|
+
type, to specify the captcha type you must send value `method` manually, for example `method='hcaptcha'` for solving hCapthca.
|
|
407
|
+
You can find the value of the `method` parameter in the [API documentation](https://2captcha.com/2captcha-api).
|
|
408
|
+
|
|
409
|
+
Example for solving Normal captcha manually:
|
|
320
410
|
```python
|
|
321
411
|
import time
|
|
322
412
|
. . . . .
|
|
@@ -325,6 +415,17 @@ import time
|
|
|
325
415
|
id = solver.send(file='path/to/captcha.jpg')
|
|
326
416
|
time.sleep(20)
|
|
327
417
|
|
|
418
|
+
code = solver.get_result(id)
|
|
419
|
+
```
|
|
420
|
+
Example for solving hCaptcha manually:
|
|
421
|
+
```python
|
|
422
|
+
import time
|
|
423
|
+
. . . . .
|
|
424
|
+
id = solver.send(sitekey='41b778e7-8f20-45cc-a804-1f1ebb45c579',
|
|
425
|
+
url='https://2captcha.com/demo/hcaptcha?difficulty=easy',
|
|
426
|
+
method='hcaptcha')
|
|
427
|
+
print(id)
|
|
428
|
+
time.sleep(20)
|
|
328
429
|
code = solver.get_result(id)
|
|
329
430
|
```
|
|
330
431
|
|
|
@@ -363,11 +464,12 @@ except TimeoutException as e:
|
|
|
363
464
|
|
|
364
465
|
### Proxies
|
|
365
466
|
|
|
366
|
-
You can pass your proxy as an additional argument for methods: recaptcha, funcaptcha, geetest, geetest v4, hcaptcha,
|
|
367
|
-
keycaptcha, capy
|
|
467
|
+
You can pass your proxy as an additional argument for the following methods: recaptcha, funcaptcha, geetest, geetest v4, hcaptcha,
|
|
468
|
+
keycaptcha, capy puzzle, lemin, atbcaptcha, turnstile, amazon waf, mtcaptcha, friendly captcha, cutcaptcha.
|
|
469
|
+
|
|
368
470
|
The proxy will be forwarded to the API to solve the captcha.
|
|
369
471
|
|
|
370
|
-
We have our own proxies that we can offer you. [Buy residential proxies]
|
|
472
|
+
We have our own proxies that we can offer you. [Buy residential proxies] to avoid restrictions and blocks. [Quick start].
|
|
371
473
|
|
|
372
474
|
```python
|
|
373
475
|
proxy={
|
|
@@ -384,22 +486,28 @@ import asyncio
|
|
|
384
486
|
import concurrent.futures
|
|
385
487
|
from twocaptcha import TwoCaptcha
|
|
386
488
|
|
|
387
|
-
|
|
489
|
+
API_KEY = "YOUR_API_KEY"
|
|
490
|
+
image = "data:image/png;base64,iVBORw0KGgoA..."
|
|
388
491
|
|
|
389
492
|
async def captchaSolver(image):
|
|
390
493
|
loop = asyncio.get_running_loop()
|
|
391
|
-
with concurrent.
|
|
494
|
+
with concurrent.futures.ThreadPoolExecutor() as pool:
|
|
392
495
|
result = await loop.run_in_executor(pool, lambda: TwoCaptcha(API_KEY).normal(image))
|
|
393
496
|
return result
|
|
394
|
-
```
|
|
395
497
|
|
|
498
|
+
captcha_result = asyncio.run(captchaSolver(image))
|
|
499
|
+
```
|
|
500
|
+
## Examples
|
|
501
|
+
Examples of solving all supported captcha types are located in the [examples] directory.
|
|
396
502
|
|
|
503
|
+
### Useful links
|
|
397
504
|
[2Captcha]: https://2captcha.com/
|
|
398
505
|
[2captcha sofware catalog]: https://2captcha.com/software
|
|
399
506
|
[pingback settings]: https://2captcha.com/setting/pingback
|
|
400
|
-
[post options]: https://2captcha.com/2captcha-api#
|
|
507
|
+
[post options]: https://2captcha.com/2captcha-api#normal_post
|
|
401
508
|
[list of supported languages]: https://2captcha.com/2captcha-api#language
|
|
402
509
|
[examples directory]: /examples
|
|
403
510
|
[asyncio]: https://docs.python.org/3/library/asyncio.html
|
|
404
511
|
[Buy residential proxies]: https://2captcha.com/proxy/residential-proxies
|
|
405
512
|
[Quick start]: https://2captcha.com/proxy?openAddTrafficModal=true
|
|
513
|
+
[examples]: ./examples
|