Skip to content
Open
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
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -61,3 +61,6 @@ build-iPhoneSimulator/
._.DS_Store
**/.DS_Store
**/._.DS_Store

.vscode
.rspec_status
13 changes: 8 additions & 5 deletions .rspec_status
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
example_id | status | run_time |
---------------------------------- | ------ | --------------------- |
./spec/api_2captcha_spec.rb[1:1] | passed | 0.04326 seconds |
./spec/api_2captcha_spec.rb[1:2:1] | passed | 0.00121 seconds |
./spec/api_2captcha_spec.rb[1:3:1] | passed | 3.15 seconds |
./spec/api_2captcha_spec.rb[1:4:1] | passed | 2 minutes 0.2 seconds |
./spec/api_2captcha_spec.rb[1:5:1] | passed | 0.26142 seconds |
./spec/api_2captcha_spec.rb[1:1] | passed | 0.00056 seconds |
./spec/api_2captcha_spec.rb[1:2:1] | passed | 0.00041 seconds |
./spec/api_2captcha_spec.rb[1:3:1] | passed | 1.52 seconds |
./spec/api_2captcha_spec.rb[1:4:1] | passed | 23.45 seconds |
./spec/api_2captcha_spec.rb[1:5:1] | passed | 0.60409 seconds |
./spec/api_2captcha_spec.rb[1:6:1] | passed | 12.42 seconds |
./spec/api_2captcha_spec.rb[1:7:1] | passed | 1.37 seconds |
./spec/api_2captcha_spec.rb[1:8:1] | passed | 1 minute 4.24 seconds |
2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.6.0
3.2.0
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
ruby-2captcha (1.1.5)
ruby-2captcha (1.1.6)

GEM
remote: https://rubygems.org/
Expand Down
48 changes: 48 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ Examples of API requests for different captcha types are available on the [Ruby
- [Cutcaptcha](#cutcaptcha)
- [Tencent](#tencent)
- [atbCAPTCHA](#atbcaptcha)
- [Prosopo](#prosopo)
- [Captchafox](#captchafox)
- [Temu](#temu)
- [Other methods](#other-methods)
- [send / get_result](#send--get_result)
- [balance](#balance)
Expand Down Expand Up @@ -494,6 +497,51 @@ result = client.atb_captcha({
})
```

### Prosopo

<sup>[API method description.](https://2captcha.com/2captcha-api#prosopo-procaptcha)</sup>

Token-based method for automated solving of Prosopo.

```ruby
result = client.prosopo({
pageurl: "https://www.twickets.live/",
sitekey: "5EZVvsHMrKCFKp5NYNoTyDjTjetoVo1Z4UNNbTwJf1GfN6Xm"
})
```

### Captchafox

<sup>[API method description.](https://2captcha.com/2captcha-api#captchafox)</sup>

Token-based method for automated solving of Captchafox.

```ruby
result = client.captchafox({
sitekey: "sitekey",
pageurl: "https://pageurl/",
userAgent: "Mozilla/5.0 (Windows NT 10.0; Win64; x64) Chrome/131.0.0.0 Safari/537.36",
proxytype: "socks5",
proxy: "proxyuser:strongPassword@123.123.123.123:3128"
})
```

### Temu

<sup>[API method description.](https://2captcha.com/2captcha-api#temucaptcha)</sup>

Token-based method for automated solving of Temu.

```ruby
result = client.temu({
body: bodyStr,
part1: part1Str,
part2: part2Str,
part3: part3Str,
})
```


## Other methods

### send / get_result
Expand Down
46 changes: 46 additions & 0 deletions README.ru.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@
- [Cutcaptcha](#cutcaptcha)
- [Tencent](#tencent)
- [atbCAPTCHA](#atbcaptcha)
- [Prosopo](#prosopo)
- [Captchafox](#captchafox)
- [Temu](#temu)
- [Другие методы](#другие-методы)
- [send / get_result](#send--get_result)
- [Баланс](#баланс)
Expand Down Expand Up @@ -476,6 +479,49 @@ result = client.atb_captcha({
})
```

### Prosopo

<sup>[Описание метода API.](https://2captcha.com/2captcha-api#prosopo-procaptcha)</sup>

Основанный на токенах метод автоматизированного решения капчи Prosopo.

```ruby
result = client.prosopo({
pageurl: "https://www.twickets.live/",
sitekey: "5EZVvsHMrKCFKp5NYNoTyDjTjetoVo1Z4UNNbTwJf1GfN6Xm"
})
```

### Captchafox

<sup>[Описание метода API.](https://2captcha.com/2captcha-api#captchafox)</sup>

Основанный на токенах метод автоматизированного решения капчи Captchafox.

```ruby
result = client.captchafox({
sitekey: "sitekey",
pageurl: "https://pageurl/",
userAgent: "Mozilla/5.0 (Windows NT 10.0; Win64; x64) Chrome/131.0.0.0 Safari/537.36",
proxytype: "socks5",
proxy: "proxyuser:strongPassword@123.123.123.123:3128"
})
```

### Temu

<sup>[API method description.](https://2captcha.com/2captcha-api#temucaptcha)</sup>

Основанный на токенах метод автоматизированного решения капчи Temu.

```ruby
result = client.temu({
body: bodyStr,
part1: part1Str,
part2: part2Str,
part3: part3Str,
})
```

## Другие методы

Expand Down
19 changes: 19 additions & 0 deletions examples/captchafox_example.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@

require_relative '../lib/api_2captcha'

client = Api2Captcha.new(ARGV[0])

begin
result = client.captchafox({
sitekey: "sk_vKdD8WGlPF5FKpRDs1U4qTuu6Jv0w",
pageurl: "https://sinscrire.gmx.fr/",
userAgent: "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36",
proxytype: "socks5",
proxy: "u37d88e6957ca05d6-zone-custom-region-fr:u37d88e6957ca05d6@118.193.59.17:10743"
})

rescue StandardError => e
puts(e)
end

puts "Result: #{result.inspect}"
Binary file added examples/media/temu/body.png
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/temu/part1.png
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/temu/part2.png
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/temu/part3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 16 additions & 0 deletions examples/prosopo_example.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@

require_relative '../lib/api_2captcha'

client = Api2Captcha.new(ARGV[0])

begin
result = client.prosopo({
pageurl: "https://www.twickets.live/",
sitekey: "5EZVvsHMrKCFKp5NYNoTyDjTjetoVo1Z4UNNbTwJf1GfN6Xm",
})
rescue StandardError => e
puts(e)
end


puts "Result: #{result.inspect}"
2 changes: 1 addition & 1 deletion examples/recaptcha_v2_example.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
require 'api_2captcha'

client = Api2Captcha.new("YOUR_API_KEY")
client = Api2Captcha.new(ARGV[0])

result = client.recaptcha_v2({
googlekey: '6LfD3PIbAAAAAJs_eEHvoOl75_83eXSqpPSRFJ_u',
Expand Down
18 changes: 18 additions & 0 deletions examples/recaptcha_v3_example.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
require_relative '../lib/api_2captcha'

client = Api2Captcha.new(ARGV[0])

begin
result = client.recaptcha_v3({
googlekey: "6LfD3PIbAAAAAJs_eEHvoOl75_83eXSqpPSRFJ_u",
pageurl: "http://2captcha.com/demo/recaptcha-v3",
version: "v3",
score: 0.3,
action: "verify"
})
rescue StandardError => e
puts(e)
end


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

require_relative '../lib/api_2captcha'

client = Api2Captcha.new(ARGV[0])

bodyFile = File.expand_path("../media/temu/body.png", __FILE__)
part1File = File.expand_path("../media/temu/part1.png", __FILE__)
part2File = File.expand_path("../media/temu/part2.png", __FILE__)
part3File = File.expand_path("../media/temu/part3.png", __FILE__)

bodyStr = Base64.strict_encode64(File.binread(bodyFile))
part1Str = Base64.strict_encode64(File.binread(part1File))
part2Str = Base64.strict_encode64(File.binread(part2File))
part3Str = Base64.strict_encode64(File.binread(part3File))

begin
result = client.temu({
body: bodyStr,
part1: part1Str,
part2: part2Str,
part3: part3Str,
})
rescue StandardError => e
puts(e)
end


puts "Result: #{result.inspect}"
8 changes: 8 additions & 0 deletions howto.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

ruby examples/prosopo_example.rb API_KEY

API_KEY=API_KEY_123 rspec spec/api_2captcha_spec.rb --tag recaptcha_v3

rake spec
rake -T
ruby api_2captcha_spec.rb
11 changes: 11 additions & 0 deletions lib/api_2captcha/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,17 @@ def atb_captcha(params)
solve("atb_captcha", **params)
end

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

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

def temu(params)
solve("temuimage", **params)
end
private

def base_url
Expand Down
Loading