ruby-2captcha 1.1.5 → 1.2.0
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/.rspec_status +16 -7
- data/.ruby-version +1 -1
- data/Gemfile.lock +5 -5
- data/README.md +403 -66
- data/README.ru.md +416 -76
- data/api_2captcha.gemspec +4 -1
- data/examples/alibaba_example.rb +16 -0
- data/examples/altcha_example.rb +12 -0
- data/examples/amazon_waf_example.rb +14 -0
- data/examples/atb_captcha_example.rb +11 -0
- data/examples/audio_example.rb +10 -0
- data/examples/basilisk_example.rb +15 -0
- data/examples/binance_example.rb +17 -0
- data/examples/canvas_example.rb +13 -0
- data/examples/captchafox_example.rb +20 -0
- data/examples/capy_example.rb +11 -0
- data/examples/cloudflare_turnstile_example.rb +15 -0
- data/examples/coordinates_example.rb +12 -0
- data/examples/cut_captcha_example.rb +11 -0
- data/examples/cyber_siara_example.rb +10 -0
- data/examples/datadome_example.rb +12 -0
- data/examples/drag_drop_example.rb +24 -0
- data/examples/friendly_captcha_example.rb +10 -0
- data/examples/funcaptcha_example.rb +10 -0
- data/examples/geetest_example.rb +12 -0
- data/examples/geetest_v4_example.rb +10 -0
- data/examples/grid_captcha_example.rb +14 -0
- data/examples/hcaptcha_example.rb +10 -0
- data/examples/hunt_example.rb +17 -0
- data/examples/key_captcha_example.rb +13 -0
- data/examples/lemin_example.rb +12 -0
- data/examples/media/drag_drop/background.jpeg +0 -0
- data/examples/media/drag_drop/image1.jpeg +0 -0
- data/examples/media/drag_drop/image2.jpeg +0 -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/media/temu/body.png +0 -0
- data/examples/media/temu/part1.png +0 -0
- data/examples/media/temu/part2.png +0 -0
- data/examples/media/temu/part3.png +0 -0
- data/examples/mt_captcha_example.rb +10 -0
- data/examples/normal_captcha_example.rb +11 -0
- data/examples/prosopo_example.rb +16 -0
- data/examples/recaptcha_v2_example.rb +10 -0
- data/examples/recaptcha_v3_example.rb +18 -0
- data/examples/rotate_example.rb +13 -0
- data/examples/temu_example.rb +28 -0
- data/examples/tencent_example.rb +10 -0
- data/examples/text_example.rb +10 -0
- data/examples/tspd_example.rb +19 -0
- data/examples/vkcaptcha_example.ru +10 -0
- data/examples/vkimage_example.rb +10 -0
- data/examples/yandex_example.rb +10 -0
- data/examples/yidun_example.rb +15 -0
- data/howto.txt +8 -0
- data/lib/api_2captcha/client.rb +77 -5
- data/lib/api_2captcha/version.rb +1 -1
- metadata +62 -7
data/lib/api_2captcha/client.rb
CHANGED
|
@@ -170,8 +170,16 @@ module Api2Captcha
|
|
|
170
170
|
solve("amazon_waf", **params)
|
|
171
171
|
end
|
|
172
172
|
|
|
173
|
+
def vkimage(params)
|
|
174
|
+
solve("vkimage", **params)
|
|
175
|
+
end
|
|
176
|
+
|
|
177
|
+
def vkcaptcha(params)
|
|
178
|
+
solve("vkcaptcha", **params)
|
|
179
|
+
end
|
|
180
|
+
|
|
173
181
|
def audio(params)
|
|
174
|
-
audio = params.delete(
|
|
182
|
+
audio = params.delete(:audio)
|
|
175
183
|
audio_content = File.file?(audio) ? File.binread(audio) : audio
|
|
176
184
|
|
|
177
185
|
params = params.merge(
|
|
@@ -205,6 +213,58 @@ module Api2Captcha
|
|
|
205
213
|
solve("cutcaptcha", **params)
|
|
206
214
|
end
|
|
207
215
|
|
|
216
|
+
def tencent(params)
|
|
217
|
+
solve("tencent", **params)
|
|
218
|
+
end
|
|
219
|
+
|
|
220
|
+
def atb_captcha(params)
|
|
221
|
+
solve("atb_captcha", **params)
|
|
222
|
+
end
|
|
223
|
+
|
|
224
|
+
def prosopo(params)
|
|
225
|
+
solve("prosopo", **params)
|
|
226
|
+
end
|
|
227
|
+
|
|
228
|
+
def captchafox(params)
|
|
229
|
+
solve("captchafox", **params)
|
|
230
|
+
end
|
|
231
|
+
|
|
232
|
+
def altcha(params)
|
|
233
|
+
solve("altcha", **params)
|
|
234
|
+
end
|
|
235
|
+
|
|
236
|
+
def temu(params)
|
|
237
|
+
solve("temuimage", **params)
|
|
238
|
+
end
|
|
239
|
+
|
|
240
|
+
def binance(params)
|
|
241
|
+
solve("binance", **params)
|
|
242
|
+
end
|
|
243
|
+
|
|
244
|
+
def hunt(params)
|
|
245
|
+
solve("hunt", **params)
|
|
246
|
+
end
|
|
247
|
+
|
|
248
|
+
def tspd(params)
|
|
249
|
+
solve("tspd", **params)
|
|
250
|
+
end
|
|
251
|
+
|
|
252
|
+
def basilisk(params)
|
|
253
|
+
solve("basilisk", **params)
|
|
254
|
+
end
|
|
255
|
+
|
|
256
|
+
def alibaba(params)
|
|
257
|
+
solve("alibaba", **params)
|
|
258
|
+
end
|
|
259
|
+
|
|
260
|
+
def yidun(params)
|
|
261
|
+
solve("yidun", **params)
|
|
262
|
+
end
|
|
263
|
+
|
|
264
|
+
def drag_drop(params)
|
|
265
|
+
solve("drag_drop", **params)
|
|
266
|
+
end
|
|
267
|
+
|
|
208
268
|
private
|
|
209
269
|
|
|
210
270
|
def base_url
|
|
@@ -227,16 +287,24 @@ module Api2Captcha
|
|
|
227
287
|
image = params.delete("image")
|
|
228
288
|
hint_image = params.delete("hint_image")
|
|
229
289
|
|
|
230
|
-
image_content =
|
|
231
|
-
|
|
290
|
+
image_content = if base64_encoded?(image)
|
|
291
|
+
image
|
|
292
|
+
else
|
|
293
|
+
Base64.strict_encode64(get_image_content(image))
|
|
294
|
+
end
|
|
295
|
+
|
|
296
|
+
hint_image_content = if hint_image
|
|
297
|
+
base64_encoded?(hint_image) ? hint_image : Base64.strict_encode64(get_image_content(hint_image))
|
|
298
|
+
end
|
|
299
|
+
|
|
232
300
|
result_params = {
|
|
233
301
|
"method" => "base64",
|
|
234
|
-
"body" =>
|
|
302
|
+
"body" => image_content,
|
|
235
303
|
"filename" => File.basename(image),
|
|
236
304
|
"ext" => File.extname(image).delete(".")
|
|
237
305
|
}
|
|
238
306
|
|
|
239
|
-
result_params["imginstructions"] =
|
|
307
|
+
result_params["imginstructions"] = hint_image_content if hint_image_content
|
|
240
308
|
params.merge(result_params)
|
|
241
309
|
end
|
|
242
310
|
|
|
@@ -246,6 +314,10 @@ module Api2Captcha
|
|
|
246
314
|
image
|
|
247
315
|
end
|
|
248
316
|
|
|
317
|
+
def base64_encoded?(string)
|
|
318
|
+
string.is_a?(String) && string.match(/\A[A-Za-z0-9+\/=]+\z/) && (string.length % 4).zero?
|
|
319
|
+
end
|
|
320
|
+
|
|
249
321
|
def download_image(url)
|
|
250
322
|
response = URI.open(url)
|
|
251
323
|
if response.status[0] != '200'
|
data/lib/api_2captcha/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: ruby-2captcha
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.
|
|
4
|
+
version: 1.2.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- 2captcha.com
|
|
8
|
-
autorequire:
|
|
8
|
+
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2026-09-17 00:00:00.000000000 Z
|
|
12
12
|
dependencies: []
|
|
13
13
|
description: Ruby package for easy integration with the API of 2captcha captcha solving
|
|
14
|
-
service to bypass recaptcha,
|
|
14
|
+
service to bypass recaptcha, funcaptcha, geetest and solve any other captchas.
|
|
15
15
|
email:
|
|
16
16
|
- info@2captcha.com
|
|
17
17
|
executables: []
|
|
@@ -29,6 +29,57 @@ files:
|
|
|
29
29
|
- README.ru.md
|
|
30
30
|
- Rakefile
|
|
31
31
|
- api_2captcha.gemspec
|
|
32
|
+
- examples/alibaba_example.rb
|
|
33
|
+
- examples/altcha_example.rb
|
|
34
|
+
- examples/amazon_waf_example.rb
|
|
35
|
+
- examples/atb_captcha_example.rb
|
|
36
|
+
- examples/audio_example.rb
|
|
37
|
+
- examples/basilisk_example.rb
|
|
38
|
+
- examples/binance_example.rb
|
|
39
|
+
- examples/canvas_example.rb
|
|
40
|
+
- examples/captchafox_example.rb
|
|
41
|
+
- examples/capy_example.rb
|
|
42
|
+
- examples/cloudflare_turnstile_example.rb
|
|
43
|
+
- examples/coordinates_example.rb
|
|
44
|
+
- examples/cut_captcha_example.rb
|
|
45
|
+
- examples/cyber_siara_example.rb
|
|
46
|
+
- examples/datadome_example.rb
|
|
47
|
+
- examples/drag_drop_example.rb
|
|
48
|
+
- examples/friendly_captcha_example.rb
|
|
49
|
+
- examples/funcaptcha_example.rb
|
|
50
|
+
- examples/geetest_example.rb
|
|
51
|
+
- examples/geetest_v4_example.rb
|
|
52
|
+
- examples/grid_captcha_example.rb
|
|
53
|
+
- examples/hcaptcha_example.rb
|
|
54
|
+
- examples/hunt_example.rb
|
|
55
|
+
- examples/key_captcha_example.rb
|
|
56
|
+
- examples/lemin_example.rb
|
|
57
|
+
- examples/media/drag_drop/background.jpeg
|
|
58
|
+
- examples/media/drag_drop/image1.jpeg
|
|
59
|
+
- examples/media/drag_drop/image2.jpeg
|
|
60
|
+
- examples/media/example.mp3
|
|
61
|
+
- examples/media/normal_2.jpg
|
|
62
|
+
- examples/media/recaptchaGrid4x4.jpg
|
|
63
|
+
- examples/media/recaptchaGridImginstructions4x4.jpg
|
|
64
|
+
- examples/media/temu/body.png
|
|
65
|
+
- examples/media/temu/part1.png
|
|
66
|
+
- examples/media/temu/part2.png
|
|
67
|
+
- examples/media/temu/part3.png
|
|
68
|
+
- examples/mt_captcha_example.rb
|
|
69
|
+
- examples/normal_captcha_example.rb
|
|
70
|
+
- examples/prosopo_example.rb
|
|
71
|
+
- examples/recaptcha_v2_example.rb
|
|
72
|
+
- examples/recaptcha_v3_example.rb
|
|
73
|
+
- examples/rotate_example.rb
|
|
74
|
+
- examples/temu_example.rb
|
|
75
|
+
- examples/tencent_example.rb
|
|
76
|
+
- examples/text_example.rb
|
|
77
|
+
- examples/tspd_example.rb
|
|
78
|
+
- examples/vkcaptcha_example.ru
|
|
79
|
+
- examples/vkimage_example.rb
|
|
80
|
+
- examples/yandex_example.rb
|
|
81
|
+
- examples/yidun_example.rb
|
|
82
|
+
- howto.txt
|
|
32
83
|
- lib/api_2captcha.rb
|
|
33
84
|
- lib/api_2captcha/api2captcha_exceptions.rb
|
|
34
85
|
- lib/api_2captcha/client.rb
|
|
@@ -42,7 +93,11 @@ metadata:
|
|
|
42
93
|
source_code_uri: https://github.com/2captcha/2captcha-ruby
|
|
43
94
|
changelog_uri: https://github.com/2captcha/2captcha-ruby/releases
|
|
44
95
|
github_repo: ssh://github.com/2captcha/2captcha-ruby
|
|
45
|
-
|
|
96
|
+
bug_tracker_uri: https://github.com/2captcha/2captcha-ruby/issues
|
|
97
|
+
keywords: 2captcha, captcha solver, captcha bypass, Ruby, automation, CAPTCHA API,
|
|
98
|
+
CAPTCHA recognition, anti-captcha, reCAPTCHA, OCR, image recognition, human verification,
|
|
99
|
+
bot protection, recaptcha
|
|
100
|
+
post_install_message:
|
|
46
101
|
rdoc_options: []
|
|
47
102
|
require_paths:
|
|
48
103
|
- lib
|
|
@@ -57,8 +112,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
57
112
|
- !ruby/object:Gem::Version
|
|
58
113
|
version: '0'
|
|
59
114
|
requirements: []
|
|
60
|
-
rubygems_version: 3.
|
|
61
|
-
signing_key:
|
|
115
|
+
rubygems_version: 3.4.1
|
|
116
|
+
signing_key:
|
|
62
117
|
specification_version: 4
|
|
63
118
|
summary: 2Captcha API wrapper for Ruby.
|
|
64
119
|
test_files: []
|