ruby-2captcha 1.1.4 → 1.1.6
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.
- checksums.yaml +4 -4
- data/Gemfile.lock +5 -5
- data/README.md +256 -75
- data/README.ru.md +288 -80
- data/api_2captcha.gemspec +3 -0
- data/examples/atb_captcha_example.rb +11 -0
- data/examples/audio_example.rb +10 -0
- data/examples/grid_captcha_example.rb +14 -0
- data/examples/media/example.mp3 +0 -0
- data/examples/media/normal_2.jpg +0 -0
- data/examples/media/recaptchaGrid4x4.jpg +0 -0
- data/examples/media/recaptchaGridImginstructions4x4.jpg +0 -0
- data/examples/normal_captcha_example.rb +9 -0
- data/examples/recaptcha_v2_example.rb +10 -0
- data/examples/tencent_example.rb +10 -0
- data/lib/api_2captcha/client.rb +31 -7
- data/lib/api_2captcha/version.rb +1 -1
- metadata +16 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f3cf34c705f05cac002afa61dbfe4ded7b7e1f07a579fa0d2e98c52ec1972ebc
|
4
|
+
data.tar.gz: 7aeb0c18eb4f7136278ef3ab528312eced958cd4ef1ebd2ee33a44296e4ed416
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c092dcb03fc11e1de8aff2a41b7b1b8908ee19e66dd643d8aaf4dd12cdab9d920e68a60b6f63c55e6ea9271b93f8b9d54aa3ea1d0991e8f11ae9cbad48d1b813
|
7
|
+
data.tar.gz: 7c42d06519aa623dcf5652d036bc85864f1df0725d913c3c7be2d3be2f7b8502367ed802ccba7f3908a3f2bf711840a50e36a54c53b4a35df0b9699cb008fc4b
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
ruby-2captcha (1.
|
4
|
+
ruby-2captcha (1.1.5)
|
5
5
|
|
6
6
|
GEM
|
7
7
|
remote: https://rubygems.org/
|
@@ -20,7 +20,7 @@ GEM
|
|
20
20
|
rainbow (3.1.1)
|
21
21
|
rake (13.0.6)
|
22
22
|
regexp_parser (2.8.0)
|
23
|
-
rexml (3.
|
23
|
+
rexml (3.3.9)
|
24
24
|
rspec (3.12.0)
|
25
25
|
rspec-core (~> 3.12.0)
|
26
26
|
rspec-expectations (~> 3.12.0)
|
@@ -34,7 +34,7 @@ GEM
|
|
34
34
|
diff-lcs (>= 1.2.0, < 2.0)
|
35
35
|
rspec-support (~> 3.12.0)
|
36
36
|
rspec-support (3.12.0)
|
37
|
-
rubocop (1.
|
37
|
+
rubocop (1.50.2)
|
38
38
|
json (~> 2.3)
|
39
39
|
parallel (~> 1.10)
|
40
40
|
parser (>= 3.2.0.0)
|
@@ -51,7 +51,7 @@ GEM
|
|
51
51
|
time (0.2.2)
|
52
52
|
date
|
53
53
|
unicode-display_width (2.4.2)
|
54
|
-
uri (0.
|
54
|
+
uri (0.13.0)
|
55
55
|
|
56
56
|
PLATFORMS
|
57
57
|
ruby
|
@@ -64,4 +64,4 @@ DEPENDENCIES
|
|
64
64
|
ruby-2captcha!
|
65
65
|
|
66
66
|
BUNDLED WITH
|
67
|
-
2.4.
|
67
|
+
2.4.22
|
data/README.md
CHANGED
@@ -1,41 +1,60 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
-
|
8
|
-
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
- [
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
1
|
+
<a href="https://github.com/2captcha/2captcha-python"><img src="https://github.com/user-attachments/assets/37e1d860-033b-4cf3-a158-468fc6b4debc" width="82" height="30"></a>
|
2
|
+
<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>
|
3
|
+
<a href="https://github.com/2captcha/2captcha-go"><img src="https://github.com/user-attachments/assets/ab22182e-6cb2-41fa-91f4-d5e89c6d7c6f" width="63" height="30"></a>
|
4
|
+
<a href="https://github.com/2captcha/2captcha-ruby"><img src="https://github.com/user-attachments/assets/1c3b6dc2-9acd-44fe-927d-31de3427639f" width="75" height="30"></a>
|
5
|
+
<a href="https://github.com/2captcha/2captcha-cpp"><img src="https://github.com/user-attachments/assets/36de8512-acfd-44fb-bb1f-b7c793a3f926" width="45" height="30"></a>
|
6
|
+
<a href="https://github.com/2captcha/2captcha-php"><img src="https://github.com/user-attachments/assets/e8797843-3f61-4fa9-a155-ab0b21fb3858" width="52" height="30"></a>
|
7
|
+
<a href="https://github.com/2captcha/2captcha-java"><img src="https://github.com/user-attachments/assets/a3d923f6-4fec-4c07-ac50-e20da6370911" width="50" height="30"></a>
|
8
|
+
<a href="https://github.com/2captcha/2captcha-csharp"><img src="https://github.com/user-attachments/assets/f4d449de-780b-49ed-bb0a-b70c82ec4b32" width="38" height="30"></a>
|
9
|
+
|
10
|
+
# Ruby 2Captcha API Client (captcha solver)
|
11
|
+
|
12
|
+
This is the easiest way to quickly integrate [2Captcha] into your code and automate solving of any type of captcha.
|
13
|
+
Examples of API requests for different captcha types are available on the [Ruby captcha solver](https://2captcha.com/lang/ruby) page.
|
14
|
+
|
15
|
+
- [Ruby 2Captcha API Client (captcha solver)](#ruby-2captcha-api-client-captcha-solver)
|
16
|
+
- [Installation](#installation)
|
17
|
+
- [Configuration](#configuration)
|
18
|
+
- [Client instance options](#client-instance-options)
|
19
|
+
- [Solve captcha](#solve-captcha)
|
20
|
+
- [Captcha options](#captcha-options)
|
21
|
+
- [Normal Captcha](#normal-captcha)
|
22
|
+
- [Text Captcha](#text-captcha)
|
23
|
+
- [reCAPTCHA v2](#recaptcha-v2)
|
24
|
+
- [reCAPTCHA v3](#recaptcha-v3)
|
25
|
+
- [reCAPTCHA Enterprise](#recaptcha-enterprise)
|
26
|
+
- [FunCaptcha](#funcaptcha)
|
27
|
+
- [GeeTest](#geetest)
|
28
|
+
- [GeeTest V4](#geetest-v4)
|
29
|
+
- [KeyCaptcha](#keycaptcha)
|
30
|
+
- [Capy](#capy)
|
31
|
+
- [Grid](#grid)
|
32
|
+
- [Canvas](#canvas)
|
33
|
+
- [ClickCaptcha](#clickcaptcha)
|
34
|
+
- [Rotate](#rotate)
|
35
|
+
- [Amazon WAF](#amazon-waf)
|
36
|
+
- [Cloudflare Turnstile](#cloudflare-turnstile)
|
37
|
+
- [Lemin Cropped Captcha](#lemin-cropped-captcha)
|
38
|
+
- [Audio Captcha](#audio-captcha)
|
39
|
+
- [Yandex](#yandex)
|
40
|
+
- [CyberSiARA](#cybersiara)
|
41
|
+
- [DataDome](#datadome)
|
42
|
+
- [MTCaptcha](#mtcaptcha)
|
43
|
+
- [Friendly captcha](#friendly-captcha)
|
44
|
+
- [Cutcaptcha](#cutcaptcha)
|
45
|
+
- [Tencent](#tencent)
|
46
|
+
- [atbCAPTCHA](#atbcaptcha)
|
47
|
+
- [Other methods](#other-methods)
|
48
|
+
- [send / get_result](#send--get_result)
|
49
|
+
- [balance](#balance)
|
50
|
+
- [report](#report)
|
51
|
+
- [Proxies](#proxies)
|
52
|
+
- [Error handling](#error-handling)
|
53
|
+
- [Examples](#examples)
|
54
|
+
- [Get in touch](#get-in-touch)
|
55
|
+
- [Join the team 👪](#join-the-team-)
|
56
|
+
- [License](#license)
|
57
|
+
- [Graphics and Trademarks](#graphics-and-trademarks)
|
39
58
|
|
40
59
|
## Installation
|
41
60
|
Add this line to your application's Gemfile:
|
@@ -72,15 +91,17 @@ client.api_key = "YOUR_API_KEY"
|
|
72
91
|
|
73
92
|
### Client instance options
|
74
93
|
|
75
|
-
|Option|Default value|Description|
|
76
|
-
|
77
|
-
|soft_id
|
78
|
-
|callback
|
79
|
-
|default_timeout|120|Timeout in seconds for all captcha types except reCAPTCHA. Defines how long the module tries to get the answer from `res.php` API endpoint|
|
80
|
-
|polling_interval|10|Interval in seconds between requests to `res.php` API endpoint, setting values less than 5 seconds is not recommended|
|
94
|
+
|Option |Default value|Description |
|
95
|
+
|----------------|-------------|------------------------------------------------------------------------|
|
96
|
+
|soft_id |4584 |your software ID obtained after publishing in [2captcha sofware catalog]|
|
97
|
+
|callback |- |URL of your web-sever that receives the captcha recognition result. The URl should be first registered in [pingback settings] of your account|
|
98
|
+
|default_timeout |120 |Timeout in seconds for all captcha types except reCAPTCHA. Defines how long the module tries to get the answer from `res.php` API endpoint|
|
99
|
+
|polling_interval|10 |Interval in seconds between requests to `res.php` API endpoint, setting values less than 5 seconds is not recommended|
|
81
100
|
|
82
|
-
>
|
83
|
-
|
101
|
+
> [!IMPORTANT]
|
102
|
+
> Once `callback` is defined for `Client` 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.
|
103
|
+
|
104
|
+
To get the answer manually use [get_result method](#send--get_result)
|
84
105
|
|
85
106
|
## Solve captcha
|
86
107
|
When you submit any image-based captcha use can provide additional options to help 2captcha workers to solve it properly.
|
@@ -88,20 +109,23 @@ When you submit any image-based captcha use can provide additional options to he
|
|
88
109
|
### Captcha options
|
89
110
|
| Option | Default Value | Description |
|
90
111
|
| ------------- | ------------- | -------------------------------------------------------------------------------------------------- |
|
91
|
-
| numeric | 0 | Defines if captcha contains numeric or other symbols [see more info in the API docs][
|
92
|
-
| min_len
|
93
|
-
| max_len
|
112
|
+
| numeric | 0 | Defines if captcha contains numeric or other symbols [see more info in the API docs][normal_post] |
|
113
|
+
| min_len | 0 | minimal answer lenght |
|
114
|
+
| max_len | 0 | maximum answer length |
|
94
115
|
| phrase | 0 | defines if the answer contains multiple words or not |
|
95
|
-
| case_sensitive
|
116
|
+
| case_sensitive| 0 | defines if the answer is case sensitive |
|
96
117
|
| calc | 0 | defines captcha requires calculation |
|
97
118
|
| lang | - | defines the captcha language, see the [list of supported languages] |
|
98
|
-
| hint_image
|
99
|
-
| hint_text
|
119
|
+
| hint_image | - | an image with hint shown to workers with the captcha, translated into instructionsimg API parameter |
|
120
|
+
| hint_text | - | hint or task text shown to workers with the captcha |
|
100
121
|
|
101
122
|
Below you can find basic examples for every captcha type, check out the code below.
|
102
123
|
|
103
124
|
|
104
125
|
### Normal Captcha
|
126
|
+
|
127
|
+
<sup>[API method description.](https://2captcha.com/2captcha-api#solving_normal_captcha)</sup>
|
128
|
+
|
105
129
|
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.
|
106
130
|
```ruby
|
107
131
|
result = client.normal({ image: 'path/to/captcha.jpg'})
|
@@ -112,6 +136,9 @@ result = client.normal({
|
|
112
136
|
```
|
113
137
|
|
114
138
|
### Text Captcha
|
139
|
+
|
140
|
+
<sup>[API method description.](https://2captcha.com/2captcha-api#solving_text_captcha)</sup>
|
141
|
+
|
115
142
|
This method can be used to bypass a captcha that requires to answer a question provided in clear text.
|
116
143
|
```ruby
|
117
144
|
result = client.text({
|
@@ -121,6 +148,9 @@ result = client.text({
|
|
121
148
|
```
|
122
149
|
|
123
150
|
### reCAPTCHA v2
|
151
|
+
|
152
|
+
<sup>[API method description.](https://2captcha.com/2captcha-api#solving_recaptchav2_new)</sup>
|
153
|
+
|
124
154
|
Use this method to solve reCAPTCHA V2 and obtain a token to bypass the protection.
|
125
155
|
```ruby
|
126
156
|
result = client.recaptcha_v2({
|
@@ -131,6 +161,9 @@ result = client.recaptcha_v2({
|
|
131
161
|
```
|
132
162
|
|
133
163
|
### reCAPTCHA v3
|
164
|
+
|
165
|
+
<sup>[API method description.](https://2captcha.com/2captcha-api#solving_recaptchav3)</sup>
|
166
|
+
|
134
167
|
This method provides reCAPTCHA V3 solver and returns a token.
|
135
168
|
```ruby
|
136
169
|
result = client.recaptcha_v3({
|
@@ -143,6 +176,9 @@ result = client.recaptcha_v3({
|
|
143
176
|
```
|
144
177
|
|
145
178
|
### reCAPTCHA Enterprise
|
179
|
+
|
180
|
+
<sup>[API method description.](https://2captcha.com/2captcha-api#recaptcha-enterprise)</sup>
|
181
|
+
|
146
182
|
reCAPTCHA Enterprise can be used as reCAPTCHA V2 and reCAPTCHA V3. Below is a usage example for both versions.
|
147
183
|
|
148
184
|
```ruby
|
@@ -165,6 +201,9 @@ result = client.recaptcha_v3({
|
|
165
201
|
```
|
166
202
|
|
167
203
|
### FunCaptcha
|
204
|
+
|
205
|
+
<sup>[API method description.](https://2captcha.com/2captcha-api#solving_funcaptcha_new)</sup>
|
206
|
+
|
168
207
|
FunCaptcha (Arkoselabs) solving method. Returns a token.
|
169
208
|
|
170
209
|
```ruby
|
@@ -175,6 +214,9 @@ result = client.funcaptcha({
|
|
175
214
|
```
|
176
215
|
|
177
216
|
### GeeTest
|
217
|
+
|
218
|
+
<sup>[API method description.](https://2captcha.com/2captcha-api#solving_geetest)</sup>
|
219
|
+
|
178
220
|
Method to solve GeeTest puzzle captcha. Returns a set of tokens as JSON.
|
179
221
|
```ruby
|
180
222
|
result = client.geetest({
|
@@ -185,16 +227,22 @@ result = client.geetest({
|
|
185
227
|
})
|
186
228
|
```
|
187
229
|
|
188
|
-
###
|
189
|
-
|
230
|
+
### GeeTest v4
|
231
|
+
|
232
|
+
<sup>[API method description.](https://2captcha.com/2captcha-api#geetest-v4)</sup>
|
233
|
+
|
234
|
+
Use this method to solve GeeTest v4. Returns the response in JSON.
|
190
235
|
```ruby
|
191
|
-
result = client.
|
192
|
-
|
236
|
+
result = client.geetest_v4({
|
237
|
+
captcha_id: 'e392e1d7fd421dc63325744d5a2b9c73',
|
193
238
|
pageurl: 'https://www.site.com/page/'
|
194
239
|
})
|
195
240
|
```
|
196
241
|
|
197
242
|
### KeyCaptcha
|
243
|
+
|
244
|
+
<sup>[API method description.](https://2captcha.com/2captcha-api#solving_keycaptcha)</sup>
|
245
|
+
|
198
246
|
Token-based method to solve KeyCaptcha.
|
199
247
|
```ruby
|
200
248
|
result = client.keycaptcha({
|
@@ -207,6 +255,9 @@ result = client.keycaptcha({
|
|
207
255
|
```
|
208
256
|
|
209
257
|
### Capy
|
258
|
+
|
259
|
+
<sup>[API method description.](https://2captcha.com/2captcha-api#solving_capy)</sup>
|
260
|
+
|
210
261
|
Token-based method to bypass Capy puzzle captcha.
|
211
262
|
```ruby
|
212
263
|
result = client.capy({
|
@@ -217,20 +268,26 @@ result = client.capy({
|
|
217
268
|
```
|
218
269
|
|
219
270
|
### Grid
|
271
|
+
|
272
|
+
<sup>[API method description.](https://2captcha.com/2captcha-api#grid)</sup>
|
273
|
+
|
220
274
|
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.
|
221
275
|
```ruby
|
222
276
|
result = client.grid({
|
223
277
|
image: 'path/to/captcha.jpg',
|
224
|
-
|
225
|
-
|
278
|
+
recaptcharows: 3,
|
279
|
+
recaptchacols: 3,
|
226
280
|
previous_id: 0,
|
227
281
|
lang: 'en',
|
228
|
-
|
229
|
-
|
282
|
+
imginstructions: 'path/to/hint.jpg',
|
283
|
+
textinstructions: 'Select all images with an Orange'
|
230
284
|
})
|
231
285
|
```
|
232
286
|
|
233
287
|
### Canvas
|
288
|
+
|
289
|
+
<sup>[API method description.](https://2captcha.com/2captcha-api#canvas)</sup>
|
290
|
+
|
234
291
|
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.
|
235
292
|
```ruby
|
236
293
|
result = client.canvas({
|
@@ -243,6 +300,9 @@ result = client.canvas({
|
|
243
300
|
```
|
244
301
|
|
245
302
|
### ClickCaptcha
|
303
|
+
|
304
|
+
<sup>[API method description.](https://2captcha.com/2captcha-api#coordinates)</sup>
|
305
|
+
|
246
306
|
ClickCaptcha method returns coordinates of points on captcha image. Can be used if you need to click on particular points on the image.
|
247
307
|
```ruby
|
248
308
|
result = client.coordinates({
|
@@ -254,6 +314,9 @@ result = client.coordinates({
|
|
254
314
|
```
|
255
315
|
|
256
316
|
### Rotate
|
317
|
+
|
318
|
+
<sup>[API method description.](https://2captcha.com/2captcha-api#solving_rotatecaptcha)</sup>
|
319
|
+
|
257
320
|
This method can be used to solve a captcha that asks to rotate an object. Mostly used to bypass FunCaptcha. Returns the rotation angle.
|
258
321
|
```ruby
|
259
322
|
result = client.rotate({
|
@@ -266,7 +329,10 @@ result = client.rotate({
|
|
266
329
|
```
|
267
330
|
|
268
331
|
### Lemin Cropped Captcha
|
269
|
-
|
332
|
+
|
333
|
+
<sup>[API method description.](https://2captcha.com/2captcha-api#lemin)</sup>
|
334
|
+
|
335
|
+
Use this method to solve Lemin challenge. Returns JSON with answer containing the following values: answer, challenge_id.
|
270
336
|
```ruby
|
271
337
|
result = client.lemin({
|
272
338
|
captcha_id: 'CROPPED_1abcd2f_a1234b567c890d12ef3a456bc78d901d',
|
@@ -277,6 +343,9 @@ result = client.lemin({
|
|
277
343
|
```
|
278
344
|
|
279
345
|
### Cloudflare Turnstile
|
346
|
+
|
347
|
+
<sup>[API method description.](https://2captcha.com/2captcha-api#turnstile)</sup>
|
348
|
+
|
280
349
|
Use this method to solve Cloudflare Turnstile. Returns JSON with the token and User-Agent.
|
281
350
|
```ruby
|
282
351
|
result = client.turnstile({
|
@@ -291,6 +360,9 @@ result = client.turnstile({
|
|
291
360
|
```
|
292
361
|
|
293
362
|
### Amazon WAF
|
363
|
+
|
364
|
+
<sup>[API method description.](https://2captcha.com/2captcha-api#amazon-waf)</sup>
|
365
|
+
|
294
366
|
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.
|
295
367
|
```ruby
|
296
368
|
result = client.amazon_waf({
|
@@ -303,20 +375,15 @@ result = client.amazon_waf({
|
|
303
375
|
})
|
304
376
|
```
|
305
377
|
|
306
|
-
###
|
307
|
-
|
308
|
-
|
309
|
-
result = client.geetest_v4({
|
310
|
-
captcha_id: 'e392e1d7fd421dc63325744d5a2b9c73',
|
311
|
-
pageurl: 'https://www.site.com/page/'
|
312
|
-
})
|
313
|
-
```
|
378
|
+
### Audio Captcha
|
379
|
+
|
380
|
+
<sup>[API method description.](https://2captcha.com/2captcha-api#audio)</sup>
|
314
381
|
|
315
|
-
|
316
|
-
|
382
|
+
Use the following method to bypass an audio captcha (mp3 formats only).
|
383
|
+
You must provide the language as `lang = 'en'`. Supported languages are "en", "ru", "de", "el", "pt", "fr".
|
317
384
|
```ruby
|
318
385
|
result = client.audio({
|
319
|
-
audio: 'path/to/audio.
|
386
|
+
audio: 'path/to/audio.mp3',
|
320
387
|
lang: "en"
|
321
388
|
})
|
322
389
|
```
|
@@ -331,6 +398,9 @@ result = client.yandex({
|
|
331
398
|
```
|
332
399
|
|
333
400
|
### CyberSiARA
|
401
|
+
|
402
|
+
<sup>[API method description.](https://2captcha.com/2captcha-api#cybersiara)</sup>
|
403
|
+
|
334
404
|
Use this method to solve CyberSiARA and obtain a token to bypass the protection.
|
335
405
|
```ruby
|
336
406
|
result = client.cyber_siara({
|
@@ -340,8 +410,15 @@ result = client.cyber_siara({
|
|
340
410
|
```
|
341
411
|
|
342
412
|
### DataDome
|
413
|
+
|
414
|
+
<sup>[API method description.](https://2captcha.com/2captcha-api#datadome)</sup>
|
415
|
+
|
343
416
|
Use this method to solve DataDome and obtain a token to bypass the protection.
|
344
|
-
|
417
|
+
|
418
|
+
|
419
|
+
> [!IMPORTANT]
|
420
|
+
> To solve the DataDome captcha, you must use a proxy. It is recommended to use [residential proxies].
|
421
|
+
|
345
422
|
```ruby
|
346
423
|
result = client.data_dome({
|
347
424
|
pageurl: "https://test.com",
|
@@ -352,6 +429,9 @@ result = client.data_dome({
|
|
352
429
|
```
|
353
430
|
|
354
431
|
### MTCaptcha
|
432
|
+
|
433
|
+
<sup>[API method description.](https://2captcha.com/2captcha-api#mtcaptcha)</sup>
|
434
|
+
|
355
435
|
Use this method to solve MTCaptcha and obtain a token to bypass the protection.
|
356
436
|
```ruby
|
357
437
|
result = client.mt_captcha({
|
@@ -361,14 +441,59 @@ result = client.mt_captcha({
|
|
361
441
|
```
|
362
442
|
|
363
443
|
### Friendly captcha
|
444
|
+
|
445
|
+
<sup>[API method description.](https://2captcha.com/2captcha-api#friendly-captcha)</sup>
|
446
|
+
|
364
447
|
Use this method to solve Friendly captcha and obtain a token to bypass the protection.
|
448
|
+
|
449
|
+
> [!IMPORTANT]
|
450
|
+
> 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.
|
451
|
+
|
365
452
|
```ruby
|
366
|
-
result = client.
|
453
|
+
result = client.friendly({
|
367
454
|
pageurl: "https://example.com",
|
368
455
|
sitekey: "2FZFEVS1FZCGQ9"
|
369
456
|
})
|
370
457
|
```
|
371
458
|
|
459
|
+
### Cutcaptcha
|
460
|
+
|
461
|
+
<sup>[API method description.](https://2captcha.com/2captcha-api#cutcaptcha)</sup>
|
462
|
+
|
463
|
+
Use this method to solve Cutcaptcha and obtain a token to bypass the protection.
|
464
|
+
```ruby
|
465
|
+
result = client.cutcaptcha({
|
466
|
+
misery_key: "a1488b66da00bf332a1488993a5443c79047e752",
|
467
|
+
api_key: "SAb83IIB",
|
468
|
+
pageurl: "https://example.cc/foo/bar.html"
|
469
|
+
})
|
470
|
+
```
|
471
|
+
|
472
|
+
### Tencent
|
473
|
+
|
474
|
+
<sup>[API method description.](https://2captcha.com/2captcha-api#tencent)</sup>
|
475
|
+
|
476
|
+
Token-based method for automated solving of Tencent captcha.
|
477
|
+
```ruby
|
478
|
+
result = client.tencent({
|
479
|
+
app_id: "197326679",
|
480
|
+
pageurl: "https://mysite.com/page/with/tencent"
|
481
|
+
})
|
482
|
+
```
|
483
|
+
|
484
|
+
### atbCAPTCHA
|
485
|
+
|
486
|
+
<sup>[API method description.](https://2captcha.com/2captcha-api#atb-captcha)</sup>
|
487
|
+
|
488
|
+
Token-based method for automated solving of atbCAPTCHA.
|
489
|
+
```ruby
|
490
|
+
result = client.atb_captcha({
|
491
|
+
app_id: "197326679",
|
492
|
+
api_server: "api.atb_captcha.com",
|
493
|
+
pageurl: "https://mysite.com/page/with/atb_captcha"
|
494
|
+
})
|
495
|
+
```
|
496
|
+
|
372
497
|
## Other methods
|
373
498
|
|
374
499
|
### send / get_result
|
@@ -395,6 +520,9 @@ result = client.get_result(captcha_id)
|
|
395
520
|
```
|
396
521
|
|
397
522
|
### balance
|
523
|
+
|
524
|
+
<sup>[API method description.](https://2captcha.com/2captcha-api#additional-methods)</sup>
|
525
|
+
|
398
526
|
Use this method to get your account's balance
|
399
527
|
|
400
528
|
```ruby
|
@@ -402,13 +530,32 @@ balance = client.get_balance
|
|
402
530
|
```
|
403
531
|
|
404
532
|
### report
|
533
|
+
|
534
|
+
<sup>[API method description.](https://2captcha.com/2captcha-api#complain)</sup>
|
535
|
+
|
405
536
|
Use this method to report good or bad captcha answer.
|
406
537
|
```ruby
|
407
538
|
client.report(captcha_id, True) # captcha solved correctly
|
408
539
|
client.report(captcha_id, False) # captcha solved incorrectly
|
409
540
|
```
|
541
|
+
## Proxies
|
542
|
+
|
543
|
+
You can pass your proxy as an additional argument for methods: recaptcha, funcaptcha, geetest, geetest v4, keycaptcha, capy puzzle, lemin, turnstile, amazon waf, Cutcaptcha, Friendly captcha, MTCaptcha, DataDome, CyberSiARA and etc. The proxy will be forwarded to the API to solve the captcha.
|
544
|
+
|
545
|
+
We have our own proxies that we can offer you. [Buy residential proxies] for avoid restrictions and blocks. [Quick start].
|
546
|
+
|
547
|
+
Example solving reCAPTCHA V2 using proxy:
|
548
|
+
```ruby
|
549
|
+
result = client.recaptcha_v2({
|
550
|
+
googlekey: '6Le-wvkSVVABCPBMRTvw0Q4Muexq1bi0DJwx_mJ-',
|
551
|
+
pageurl: 'https://mysite.com/page/with/recaptcha_v2',
|
552
|
+
invisible: 1,
|
553
|
+
proxytype: "https",
|
554
|
+
proxy: "proxyuser:strongPassword@123.123.123.123:3128"
|
555
|
+
})
|
556
|
+
```
|
410
557
|
|
411
|
-
|
558
|
+
## Error handling
|
412
559
|
In case of an error, the captcha solver throws an exception. It's important to properly handle these cases. We recommend using `begin rescue` to handle exceptions.
|
413
560
|
```ruby
|
414
561
|
begin
|
@@ -427,3 +574,37 @@ In case of an error, the captcha solver throws an exception. It's important to p
|
|
427
574
|
puts(e)
|
428
575
|
end
|
429
576
|
```
|
577
|
+
|
578
|
+
## Examples
|
579
|
+
|
580
|
+
Examples of solving all supported captcha types are located in the [examples] directory.
|
581
|
+
|
582
|
+
## Get in touch
|
583
|
+
|
584
|
+
<a href="mailto:support@2captcha.com"><img src="https://github.com/user-attachments/assets/539df209-7c85-4fa5-84b4-fc22ab93fac7" width="80" height="30"></a>
|
585
|
+
<a href="https://2captcha.com/support/tickets/new"><img src="https://github.com/user-attachments/assets/be044db5-2e67-46c6-8c81-04b78bd99650" width="81" height="30"></a>
|
586
|
+
|
587
|
+
## Join the team 👪
|
588
|
+
|
589
|
+
There are many ways to contribute, of which development is only one! Find your next job. Open positions: AI experts, scrapers, developers, technical support, and much more! 😍
|
590
|
+
|
591
|
+
<a href="mailto:job@2captcha.com"><img src="https://github.com/user-attachments/assets/36d23ef5-7866-4841-8e17-261cc8a4e033" width="80" height="30"></a>
|
592
|
+
|
593
|
+
## License
|
594
|
+
|
595
|
+
The code in this repository is licensed under the MIT License. See the [LICENSE](./LICENSE) file for more details.
|
596
|
+
|
597
|
+
### Graphics and Trademarks
|
598
|
+
|
599
|
+
The graphics and trademarks included in this repository are not covered by the MIT License. Please contact <a href="mailto:support@2captcha.com">support</a> for permissions regarding the use of these materials.
|
600
|
+
|
601
|
+
<!-- Shared links -->
|
602
|
+
[2Captcha]: https://2captcha.com/
|
603
|
+
[2captcha sofware catalog]: https://2captcha.com/software
|
604
|
+
[pingback settings]: https://2captcha.com/setting/pingback
|
605
|
+
[normal_post]: https://2captcha.com/2captcha-api#normal_post
|
606
|
+
[list of supported languages]: https://2captcha.com/2captcha-api#language
|
607
|
+
[Buy residential proxies]: https://2captcha.com/proxy/residential-proxies
|
608
|
+
[Quick start]: https://2captcha.com/proxy?openAddTrafficModal=true
|
609
|
+
[examples]: ./examples/
|
610
|
+
[residential proxies]: https://2captcha.com/proxy/residential-proxies
|