Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
165 changes: 144 additions & 21 deletions README.md

Large diffs are not rendered by default.

249 changes: 183 additions & 66 deletions README.ru.md

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions api_2captcha.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@ Gem::Specification.new do |spec|
spec.metadata["source_code_uri"] = "https://github.com/2captcha/2captcha-ruby"
spec.metadata["changelog_uri"] = "https://github.com/2captcha/2captcha-ruby/releases"
spec.metadata["github_repo"] = "ssh://github.com/2captcha/2captcha-ruby"
spec.metadata["bug_tracker_uri"] = "https://github.com/2captcha/2captcha-ruby/issues"
spec.metadata["keywords"] = [
'2captcha', 'captcha solver', 'captcha bypass', 'Ruby', 'automation',
'CAPTCHA API', 'CAPTCHA recognition', 'anti-captcha', 'reCAPTCHA', 'OCR',
'image recognition', 'human verification', 'bot protection', 'recaptcha'
]

# Specify which files should be added to the gem when it is released.
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
Expand Down
11 changes: 11 additions & 0 deletions examples/atb_captcha_example.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
require 'api_2captcha'

client = Api2Captcha.new("YOUR_API_KEY")

result = client.atb_captcha({
app_id: "197326679",
api_server: "api.atb_captcha.com",
pageurl: "https://mysite.com/page/with/atb_captcha"
})

puts "Result: #{result.inspect}"
10 changes: 10 additions & 0 deletions examples/audio_example.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
require 'api_2captcha'

client = Api2Captcha.new("YOUR_API_KEY")

result = client.audio({
audio: './media/example.mp3',
lang: "en"
})

puts "Result: #{result.inspect}"
14 changes: 14 additions & 0 deletions examples/grid_captcha_example.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
require 'api_2captcha'

client = Api2Captcha.new("YOUR_API_KEY")

result = client.grid({
image: './media/recaptchaGrid4x4.jpg',
rows: 4,
cols: 4,
lang: 'en',
hint_image: './media/recaptchaGridImginstructions4x4.jpg',
# hint_text: 'Select all squares with stairs'
})

puts "Result: #{result.inspect}"
Binary file added examples/media/example.mp3
Binary file not shown.
Binary file added examples/media/normal_2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/media/recaptchaGrid4x4.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions examples/normal_captcha_example.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
require 'api_2captcha'

client = Api2Captcha.new("YOUR_API_KEY")

result = client.normal({
image: './media/normal_2.jpg',
})

puts "Result: #{result.inspect}"
10 changes: 10 additions & 0 deletions examples/recaptcha_v2_example.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
require 'api_2captcha'

client = Api2Captcha.new("YOUR_API_KEY")

result = client.recaptcha_v2({
googlekey: '6LfD3PIbAAAAAJs_eEHvoOl75_83eXSqpPSRFJ_u',
pageurl: 'https://2captcha.com/demo/recaptcha-v2',
})

puts "Result: #{result.inspect}"
10 changes: 10 additions & 0 deletions examples/tencent_example.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
require 'api_2captcha'

client = Api2Captcha.new("YOUR_API_KEY")

result = client.tencent({
app_id: "197326679",
pageurl: "https://mysite.com/page/with/tencent"
})

puts "Result: #{result.inspect}"
10 changes: 9 additions & 1 deletion lib/api_2captcha/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ def amazon_waf(params)
end

def audio(params)
audio = params.delete("audio")
audio = params.delete(:audio)
audio_content = File.file?(audio) ? File.binread(audio) : audio

params = params.merge(
Expand Down Expand Up @@ -205,6 +205,14 @@ def cutcaptcha(params)
solve("cutcaptcha", **params)
end

def tencent(params)
solve("tencent", **params)
end

def atb_captcha(params)
solve("atb_captcha", **params)
end

private

def base_url
Expand Down