ruby-2captcha 1.1.2 → 1.1.4

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9d00c88ab76dd351845d0e233040e08b26078dc547c6e7cb7735737048fab3ca
4
- data.tar.gz: 776934ec77a95680867a9ef9f2e64369a50b583c58ac2f64d60c3fc234992ca8
3
+ metadata.gz: b17960788d337b014b4337b32068a6ded3315e92fd649c28c0df2b0ba8d2cf09
4
+ data.tar.gz: 8b4b808a9d0b1696758bd21a8fe6b8cdeb584f1244416e3d86df83595c4003db
5
5
  SHA512:
6
- metadata.gz: fc6a083c9106dc517cff5f768ae56981530f92869c726176c22788dc493dec5a38414a21c724d5c791ff8f00edaecdd760b83de4c39a3395c1c32ac1aad61372
7
- data.tar.gz: 360fe1c592917e0a0b81485a3293194b5bd123a74123828792482db9a64235a0ef2b9c9b25c9d18c97e23c0e9860bee838e926f1e78b870e208aac26fd1e3bf2
6
+ metadata.gz: c288e20b91dd6b780f0acbc9f9bcf66428954b37d88505ce54330f88e320e775fe6eeccf8ebb621637376d409f0c5a702cb2d5a9d45a3e63ce612ea0a038d2a6
7
+ data.tar.gz: 7304970593279b972e1b85b22b430b7f271d9f0cc85afca244b4b24024bcf4607db17bd0701086b0035d30b7076631aa43de6e06215746e293304feaacd70187
data/README.md CHANGED
@@ -27,11 +27,12 @@ A Ruby client for the 2Captcha API.
27
27
  - [GeeTest V4](#geetest-v4)
28
28
  - [Audio](#audio)
29
29
  - [Yandex](#yandex)
30
- - [CyberSiARA](#cyber_siara)
31
- - [DataDome](#data-dome)
30
+ - [CyberSiARA](#cybersiara)
31
+ - [DataDome](#datadome)
32
32
  - [MTCaptcha](#mtcaptcha)
33
+ - [Friendly captcha](#friendly-captcha)
33
34
  - [Other methods](#other-methods)
34
- - [send / get_result](#send--getresult)
35
+ - [send / get_result](#send--get_result)
35
36
  - [balance](#balance)
36
37
  - [report](#report)
37
38
  - [Error handling](#error-handling)
@@ -359,9 +360,19 @@ result = client.mt_captcha({
359
360
  })
360
361
  ```
361
362
 
363
+ ### Friendly captcha
364
+ Use this method to solve Friendly captcha and obtain a token to bypass the protection.
365
+ ```ruby
366
+ result = client.friendly_captcha({
367
+ pageurl: "https://example.com",
368
+ sitekey: "2FZFEVS1FZCGQ9"
369
+ })
370
+ ```
371
+
362
372
  ## Other methods
363
373
 
364
374
  ### send / get_result
375
+
365
376
  These methods can be used for manual captcha submission and answer polling.
366
377
  ```ruby
367
378
 
data/README.ru.md CHANGED
@@ -25,11 +25,12 @@ Ruby-клиент для API 2Captcha.
25
25
  - [Lemin Cropped Captcha](#lemin-cropped-captcha)
26
26
  - [GeeTest V4](#geetest-v4)
27
27
  - [Аудио](#audio)
28
- - [CyberSiARA](#cyber_siara)
29
- - [DataDome](#data-dome)
28
+ - [CyberSiARA](#cybersiara)
29
+ - [DataDome](#datadome)
30
30
  - [MTCaptcha](#mtcaptcha)
31
+ - [Friendly captcha](#friendly-captcha)
31
32
  - [Другие методы](#other-methods)
32
- - [send / get_result](#send--getresult)
33
+ - [send / get_result](#send--get_result)
33
34
  - [balance](#balance)
34
35
  - [report](#report)
35
36
  - [Обработка ошибок](#error-handling)
@@ -316,6 +317,15 @@ result = client.mt_captcha({
316
317
  })
317
318
  ```
318
319
 
320
+ ### Friendly captcha
321
+ Метод решения Friendly captcha. Он возвращает токен для обхода капчи.
322
+ ```ruby
323
+ result = client.friendly_captcha({
324
+ pageurl: "https://example.com",
325
+ sitekey: "2FZFEVS1FZCGQ9"
326
+ })
327
+ ```
328
+
319
329
  ## Другие методы
320
330
 
321
331
  ### send / get_result
@@ -10,20 +10,20 @@ module Api2Captcha
10
10
  DEFAULT_DOMAIN = "2captcha.com"
11
11
  BASE_URL_FORMAT = "https://%s"
12
12
 
13
- attr_reader :api_key, :soft_id
14
-
15
13
  attr_accessor :domain, :callback,
16
14
  :default_timeout,
17
15
  :recaptcha_timeout,
18
- :polling_interval
16
+ :polling_interval,
17
+ :api_key, :soft_id
19
18
 
20
- def initialize(api_key, soft_id = 0, callback = nil)
19
+ def initialize(api_key, callback = nil)
21
20
  @api_key = api_key
22
21
  @soft_id = soft_id
23
22
  @callback = callback
24
23
  @default_timeout = 120
25
24
  @recaptcha_timeout = 600
26
25
  @polling_interval = 10
26
+ @soft_id = 0
27
27
  @domain = DEFAULT_DOMAIN
28
28
  end
29
29
 
@@ -98,76 +98,76 @@ module Api2Captcha
98
98
  end
99
99
 
100
100
  def normal(params)
101
- solve("post", params)
101
+ solve("post", **params)
102
102
  end
103
103
 
104
104
  def text(params)
105
- solve("textcaptcha", params)
105
+ solve("textcaptcha", **params)
106
106
  end
107
107
 
108
108
  def recaptcha_v2(params)
109
- solve("userrecaptcha", params)
109
+ solve("userrecaptcha", **params)
110
110
  end
111
111
 
112
112
  def recaptcha_v3(params)
113
- solve("userrecaptcha", params)
113
+ solve("userrecaptcha", **params)
114
114
  end
115
115
 
116
116
  def funcaptcha(params)
117
- solve("funcaptcha", params)
117
+ solve("funcaptcha", **params)
118
118
  end
119
119
 
120
120
  def geetest(params)
121
- solve("geetest", params)
121
+ solve("geetest", **params)
122
122
  end
123
123
 
124
124
  def hcaptcha(params)
125
- solve("hcaptcha", params)
125
+ solve("hcaptcha", **params)
126
126
  end
127
127
 
128
128
  def keycaptcha(params)
129
- solve("keycaptcha", params)
129
+ solve("keycaptcha", **params)
130
130
  end
131
131
 
132
132
  def capy(params)
133
- solve("capy", params)
133
+ solve("capy", **params)
134
134
  end
135
135
 
136
136
  def grid(params)
137
137
  params["recaptcha"] = 1
138
- solve("post", params)
138
+ solve("post", **params)
139
139
  end
140
140
 
141
141
  def canvas(params)
142
142
  params["recaptcha"] = 1
143
143
  params["canvas"] = 1
144
- solve("post", params)
144
+ solve("post", **params)
145
145
  end
146
146
 
147
147
  def coordinates(params)
148
148
  params["coordinatescaptcha"] = 1
149
149
 
150
- solve("post", params)
150
+ solve("post", **params)
151
151
  end
152
152
 
153
153
  def rotate(params)
154
- solve("rotatecaptcha", params)
154
+ solve("rotatecaptcha", **params)
155
155
  end
156
156
 
157
157
  def geetest_v4(params)
158
- solve("geetest_v4", params)
158
+ solve("geetest_v4", **params)
159
159
  end
160
160
 
161
161
  def lemin(params)
162
- solve("lemin", params)
162
+ solve("lemin", **params)
163
163
  end
164
164
 
165
165
  def turnstile(params)
166
- solve("turnstile", params)
166
+ solve("turnstile", **params)
167
167
  end
168
168
 
169
169
  def amazon_waf(params)
170
- solve("amazon_waf", params)
170
+ solve("amazon_waf", **params)
171
171
  end
172
172
 
173
173
  def audio(params)
@@ -178,23 +178,27 @@ module Api2Captcha
178
178
  "body" => Base64.strict_encode64(audio_content),
179
179
  "lang" => params["lang"]
180
180
  )
181
- solve("audio", params)
181
+ solve("audio", **params)
182
182
  end
183
183
 
184
184
  def yandex(params)
185
- solve("yandex", params)
185
+ solve("yandex", **params)
186
186
  end
187
187
 
188
188
  def cyber_siara(params)
189
- solve("cybersiara", params)
189
+ solve("cybersiara", **params)
190
190
  end
191
191
 
192
192
  def data_dome(params)
193
- solve("datadome", params)
193
+ solve("datadome", **params)
194
194
  end
195
195
 
196
196
  def mt_captcha(params)
197
- solve("mt_captcha", params)
197
+ solve("mt_captcha", **params)
198
+ end
199
+
200
+ def friendly(params)
201
+ solve("friendly_captcha", **params)
198
202
  end
199
203
 
200
204
  private
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Api2Captcha
4
- VERSION = "1.1.2"
4
+ VERSION = "1.1.4"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby-2captcha
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.2
4
+ version: 1.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - 2captcha.com
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-10-10 00:00:00.000000000 Z
11
+ date: 2024-01-23 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Ruby package for easy integration with the API of 2captcha captcha solving
14
14
  service to bypass recaptcha, hcaptcha, funcaptcha, geetest and solve any other captchas.