diff --git a/README.md b/README.md index d07e1f8..09ab67b 100644 --- a/README.md +++ b/README.md @@ -288,12 +288,12 @@ Grid method is originally called Old reCAPTCHA V2 method. The method can be used ```ruby result = client.grid({ image: 'path/to/captcha.jpg', - rows: 3, - cols: 3, + recaptcharows: 3, + recaptchacols: 3, previous_id: 0, lang: 'en', - hint_image: 'path/to/hint.jpg', - hint_text: 'Select all images with an Orange' + imginstructions: 'path/to/hint.jpg', + textinstructions: 'Select all images with an Orange' }) ``` diff --git a/README.ru.md b/README.ru.md index 4041eaf..2f512f2 100644 --- a/README.ru.md +++ b/README.ru.md @@ -270,12 +270,12 @@ result = client.capy({ ```ruby result = client.grid({ image: 'path/to/captcha.jpg', - rows: 3, - cols: 3, + recaptcharows: 3, + recaptchacols: 3, previous_id: 0, lang: 'en', - hint_image: 'path/to/hint.jpg', - hint_text: 'Select all images with an Orange' + imginstructions: 'path/to/hint.jpg', + textinstructions: 'Select all images with an Orange' }) ``` diff --git a/examples/amazon_waf_example.rb b/examples/amazon_waf_example.rb new file mode 100644 index 0000000..fd6c468 --- /dev/null +++ b/examples/amazon_waf_example.rb @@ -0,0 +1,14 @@ +require 'api_2captcha' + +client = Api2Captcha.new("YOUR_API_KEY") + +result = client.amazon_waf({ + sitekey: '0x1AAAAAAAAkg0s2VIOD34y5', + iv: 'CgAHbCe2GgAAAAAj', + context: '9BUgmlm48F92WUoqv97a49ZuEJJ50TCk9MVr3C7WMtQ0X6flVbufM4n8mjFLmbLVAPgaQ1Jydeaja94iAS49ljb+sUNLoukWedAQZKrlY4RdbOOzvcFqmD/ZepQFS9N5w15Exr4VwnVq+HIxTsDJwRviElWCdzKDebN/mk8/eX2n7qJi5G3Riq0tdQw9+C4diFZU5E97RSeahejOAAJTDqduqW6uLw9NsjJBkDRBlRjxjn5CaMMo5pYOxYbGrM8Un1JH5DMOLeXbq1xWbC17YSEoM1cRFfTgOoc+VpCe36Ai9Kc=', + pageurl: 'https://non-existent-example.execute-api.us-east-1.amazonaws.com/latest', + challenge_script: "https://41bcdd4fb3cb.610cd090.us-east-1.token.awswaf.com/41bcdd4fb3cb/0d21de737ccb/cd77baa6c832/challenge.js", + captcha_script: "https://41bcdd4fb3cb.610cd090.us-east-1.captcha.awswaf.com/41bcdd4fb3cb/0d21de737ccb/cd77baa6c832/captcha.js" +}) + +puts "Result: #{result.inspect}" \ No newline at end of file diff --git a/examples/canvas_example.rb b/examples/canvas_example.rb new file mode 100644 index 0000000..82f8809 --- /dev/null +++ b/examples/canvas_example.rb @@ -0,0 +1,13 @@ +require 'api_2captcha' + +client = Api2Captcha.new("YOUR_API_KEY") + +result = client.canvas({ + image: 'path/to/captcha.jpg', + previous_id: 0, + lang: 'en', + hint_image: 'path/to/hint.jpg', + hint_text: 'Draw around apple' +}) + +puts "Result: #{result.inspect}" diff --git a/examples/capy_example.rb b/examples/capy_example.rb new file mode 100644 index 0000000..a43aa31 --- /dev/null +++ b/examples/capy_example.rb @@ -0,0 +1,11 @@ +require 'api_2captcha' + +client = Api2Captcha.new("YOUR_API_KEY") + +result = client.capy({ + sitekey: 'PUZZLE_Abc1dEFghIJKLM2no34P56q7rStu8v', + pageurl: 'http://mysite.com/', + api_server: 'https://jp.api.capy.me/' +}) + +puts "Result: #{result.inspect}" \ No newline at end of file diff --git a/examples/cloudflare_turnstile_example.rb b/examples/cloudflare_turnstile_example.rb new file mode 100644 index 0000000..d42aa7c --- /dev/null +++ b/examples/cloudflare_turnstile_example.rb @@ -0,0 +1,15 @@ +require 'api_2captcha' + +client = Api2Captcha.new("YOUR_API_KEY") + +result = client.turnstile({ + sitekey: "0x0AAAAAAADnPIDROzbs0Aaj", + data: "7fab0000b0e0ff00", + pagedata: "3gAFo2...0ME1UVT0=", + pageurl: "https://2captcha.com/", + action: "managed", + userAgent: "Mozilla/5.0 ... Chrome/116.0.0.0 Safari/537.36", + json: 1 +}) + +puts "Result: #{result.inspect}" \ No newline at end of file diff --git a/examples/coordinates_example.rb b/examples/coordinates_example.rb new file mode 100644 index 0000000..6cd8a28 --- /dev/null +++ b/examples/coordinates_example.rb @@ -0,0 +1,12 @@ +require 'api_2captcha' + +client = Api2Captcha.new("YOUR_API_KEY") + +result = client.coordinates({ + image: 'path/to/captcha.jpg', + lang: 'en', + hint_image: 'path/to/hint.jpg', + hint_text: 'Connect the dots' +}) + +puts "Result: #{result.inspect}" \ No newline at end of file diff --git a/examples/cut_captcha_example.rb b/examples/cut_captcha_example.rb new file mode 100644 index 0000000..8852138 --- /dev/null +++ b/examples/cut_captcha_example.rb @@ -0,0 +1,11 @@ +require 'api_2captcha' + +client = Api2Captcha.new("YOUR_API_KEY") + +result = client.cutcaptcha({ + misery_key: "a1488b66da00bf332a1488993a5443c79047e752", + api_key: "SAb83IIB", + pageurl: "https://example.cc/foo/bar.html" +}) + +puts "Result: #{result.inspect}" \ No newline at end of file diff --git a/examples/cyber_siara_example.rb b/examples/cyber_siara_example.rb new file mode 100644 index 0000000..568915f --- /dev/null +++ b/examples/cyber_siara_example.rb @@ -0,0 +1,10 @@ +require 'api_2captcha' + +client = Api2Captcha.new("YOUR_API_KEY") + +result = client.cyber_siara({ + pageurl: "https://test.com", + master_url_id: "12333-3123123" +}) + +puts "Result: #{result.inspect}" \ No newline at end of file diff --git a/examples/datadome_example.rb b/examples/datadome_example.rb new file mode 100644 index 0000000..ca63e6a --- /dev/null +++ b/examples/datadome_example.rb @@ -0,0 +1,12 @@ +require 'api_2captcha' + +client = Api2Captcha.new("YOUR_API_KEY") + +result = client.data_dome({ + pageurl: "https://test.com", + captcha_url: "https://test.com/captcha/", + proxytype: "http", + proxy: "proxyuser:strongPassword@123.123.123.123:3128" +}) + +puts "Result: #{result.inspect}" \ No newline at end of file diff --git a/examples/friendly_captcha_example.rb b/examples/friendly_captcha_example.rb new file mode 100644 index 0000000..e2fc3db --- /dev/null +++ b/examples/friendly_captcha_example.rb @@ -0,0 +1,10 @@ +require 'api_2captcha' + +client = Api2Captcha.new("YOUR_API_KEY") + +result = client.friendly({ + pageurl: "https://example.com", + sitekey: "2FZFEVS1FZCGQ9" +}) + +puts "Result: #{result.inspect}" \ No newline at end of file diff --git a/examples/funcaptcha_example.rb b/examples/funcaptcha_example.rb new file mode 100644 index 0000000..84450ea --- /dev/null +++ b/examples/funcaptcha_example.rb @@ -0,0 +1,10 @@ +require 'api_2captcha' + +client = Api2Captcha.new("YOUR_API_KEY") + +result = client.funcaptcha({ + publickey: "69A21A01-CC7B-B9C6-0F9A-E7FA06677FFC", + pageurl: "https://mysite.com/page/with/funcaptcha", + surl: "https://client-api.arkoselabs.com"}) + +puts "Result: #{result.inspect}" \ No newline at end of file diff --git a/examples/geetest_example.rb b/examples/geetest_example.rb new file mode 100644 index 0000000..b66bbaf --- /dev/null +++ b/examples/geetest_example.rb @@ -0,0 +1,12 @@ +require 'api_2captcha' + +client = Api2Captcha.new("YOUR_API_KEY") + +result = client.geetest({ + gt: 'f1ab2cdefa3456789012345b6c78d90e', + api_server: 'api-na.geetest.com', + challenge: '12345678abc90123d45678ef90123a456b', + pageurl: 'https://www.site.com/page/' +}) + +puts "Result: #{result.inspect}" \ No newline at end of file diff --git a/examples/geetest_v4_example.rb b/examples/geetest_v4_example.rb new file mode 100644 index 0000000..d4a4c2c --- /dev/null +++ b/examples/geetest_v4_example.rb @@ -0,0 +1,10 @@ +require 'api_2captcha' + +client = Api2Captcha.new("YOUR_API_KEY") + +result = client.geetest_v4({ + captcha_id: 'e392e1d7fd421dc63325744d5a2b9c73', + pageurl: 'https://www.site.com/page/' +}) + +puts "Result: #{result.inspect}" \ No newline at end of file diff --git a/examples/hcaptcha_example.rb b/examples/hcaptcha_example.rb new file mode 100644 index 0000000..6a5cefb --- /dev/null +++ b/examples/hcaptcha_example.rb @@ -0,0 +1,10 @@ +require 'api_2captcha' + +client = Api2Captcha.new("YOUR_API_KEY") + +result = client.hcaptcha({ + sitekey: '10000000-ffff-ffff-ffff-000000000001', + pageurl: 'https://www.site.com/page/' +}) + +puts "Result: #{result.inspect}" \ No newline at end of file diff --git a/examples/key_captcha_example.rb b/examples/key_captcha_example.rb new file mode 100644 index 0000000..6272c1e --- /dev/null +++ b/examples/key_captcha_example.rb @@ -0,0 +1,13 @@ +require 'api_2captcha' + +client = Api2Captcha.new("YOUR_API_KEY") + +result = client.keycaptcha({ + s_s_c_user_id: 10, + s_s_c_session_id: '493e52c37c10c2bcdf4a00cbc9ccd1e8', + s_s_c_web_server_sign: '9006dc725760858e4c0715b835472f22-pz-', + s_s_c_web_server_sign2: '2ca3abe86d90c6142d5571db98af6714', + pageurl: 'https://www.keycaptcha.ru/demo-magnetic/' +}) + +puts "Result: #{result.inspect}" \ No newline at end of file diff --git a/examples/lemin_example.rb b/examples/lemin_example.rb new file mode 100644 index 0000000..ac8d2ff --- /dev/null +++ b/examples/lemin_example.rb @@ -0,0 +1,12 @@ +require 'api_2captcha' + +client = Api2Captcha.new("YOUR_API_KEY") + +result = client.lemin({ + captcha_id: 'CROPPED_1abcd2f_a1234b567c890d12ef3a456bc78d901d', + div_id: 'lemin-cropped-captcha', + pageurl: 'https://www.site.com/page/', + api_server: "https://api.leminnow.com/" +}) + +puts "Result: #{result.inspect}" \ No newline at end of file diff --git a/examples/mt_captcha_example.rb b/examples/mt_captcha_example.rb new file mode 100644 index 0000000..a3fe9b0 --- /dev/null +++ b/examples/mt_captcha_example.rb @@ -0,0 +1,10 @@ +require 'api_2captcha' + +client = Api2Captcha.new("YOUR_API_KEY") + +result = client.mt_captcha({ + pageurl: "https://service.mtcaptcha.com/mtcv1/demo/index.html", + sitekey: "MTPublic-DemoKey9M" +}) + +puts "Result: #{result.inspect}" \ No newline at end of file diff --git a/examples/rotate_example.rb b/examples/rotate_example.rb new file mode 100644 index 0000000..a0d7c90 --- /dev/null +++ b/examples/rotate_example.rb @@ -0,0 +1,13 @@ +require 'api_2captcha' + +client = Api2Captcha.new("YOUR_API_KEY") + +result = client.rotate({ + image: 'path/to/captcha.jpg', + angle: 40, + lang: 'en', + hint_image: 'path/to/hint.jpg', + hint_text: 'Put the images in the correct way' +}) + +puts "Result: #{result.inspect}" \ No newline at end of file diff --git a/examples/text_example.rb b/examples/text_example.rb new file mode 100644 index 0000000..a1be5a7 --- /dev/null +++ b/examples/text_example.rb @@ -0,0 +1,10 @@ +require 'api_2captcha' + +client = Api2Captcha.new("YOUR_API_KEY") + +result = client.text({ + textcaptcha:'If tomorrow is Saturday, what day is today?', + lang: "en" +}) + +puts "Result: #{result.inspect}" \ No newline at end of file diff --git a/examples/yandex_example.rb b/examples/yandex_example.rb new file mode 100644 index 0000000..a33e5b1 --- /dev/null +++ b/examples/yandex_example.rb @@ -0,0 +1,10 @@ +require 'api_2captcha' + +client = Api2Captcha.new("YOUR_API_KEY") + +result = client.yandex({ + sitekey: 'Y5Lh0tiycconMJGsFd3EbbuNKSp1yaZESUOIHfeV', + url: "https://rutube.ru" +}) + +puts "Result: #{result.inspect}" \ No newline at end of file diff --git a/lib/api_2captcha/client.rb b/lib/api_2captcha/client.rb index 42d4825..8228c2e 100644 --- a/lib/api_2captcha/client.rb +++ b/lib/api_2captcha/client.rb @@ -134,7 +134,7 @@ def capy(params) end def grid(params) - params["recaptcha"] = 1 + params[:recaptcha] = 1 solve("post", **params) end