diff --git a/README.md b/README.md index 97224a9..d07e1f8 100644 --- a/README.md +++ b/README.md @@ -12,19 +12,20 @@ This is the easiest way to quickly integrate [2Captcha] into your code and automate solving of any type of captcha. Examples of API requests for different captcha types are available on the [Ruby captcha solver](https://2captcha.com/lang/ruby) page. -A Ruby client for the 2Captcha API. - [Ruby 2Captcha API Client (captcha solver)](#ruby-2captcha-api-client-captcha-solver) - [Installation](#installation) - [Configuration](#configuration) - [Client instance options](#client-instance-options) - [Solve captcha](#solve-captcha) + - [Captcha options](#captcha-options) - [Normal Captcha](#normal-captcha) - - [Text](#text-captcha) + - [Text Captcha](#text-captcha) - [reCAPTCHA v2](#recaptcha-v2) - [reCAPTCHA v3](#recaptcha-v3) - [reCAPTCHA Enterprise](#recaptcha-enterprise) - [FunCaptcha](#funcaptcha) - [GeeTest](#geetest) + - [GeeTest V4](#geetest-v4) - [hCaptcha](#hcaptcha) - [KeyCaptcha](#keycaptcha) - [Capy](#capy) @@ -32,23 +33,25 @@ A Ruby client for the 2Captcha API. - [Canvas](#canvas) - [ClickCaptcha](#clickcaptcha) - [Rotate](#rotate) - - [AmazonWAF](#amazon-waf) - - [CloudflareTurnstile](#cloudflare-turnstile) + - [Amazon WAF](#amazon-waf) + - [Cloudflare Turnstile](#cloudflare-turnstile) - [Lemin Cropped Captcha](#lemin-cropped-captcha) - - [GeeTest V4](#geetest-v4) - - [Audio](#audio) + - [Audio Captcha](#audio-captcha) - [Yandex](#yandex) - [CyberSiARA](#cybersiara) - [DataDome](#datadome) - [MTCaptcha](#mtcaptcha) - [Friendly captcha](#friendly-captcha) - [Cutcaptcha](#cutcaptcha) + - [Tencent](#tencent) + - [atbCAPTCHA](#atbcaptcha) - [Other methods](#other-methods) - [send / get_result](#send--get_result) - [balance](#balance) - [report](#report) - [Proxies](#proxies) - [Error handling](#error-handling) + - [Examples](#examples) - [Get in touch](#get-in-touch) - [Join the team πŸ‘ͺ](#join-the-team-) - [License](#license) @@ -91,12 +94,14 @@ client.api_key = "YOUR_API_KEY" |Option |Default value|Description | |----------------|-------------|------------------------------------------------------------------------| -|soft_id |- |your software ID obtained after publishing in [2captcha sofware catalog]| +|soft_id |4584 |your software ID obtained after publishing in [2captcha sofware catalog]| |callback |- |URL of your web-sever that receives the captcha recognition result. The URl should be first registered in [pingback settings] of your account| |default_timeout |120 |Timeout in seconds for all captcha types except reCAPTCHA. Defines how long the module tries to get the answer from `res.php` API endpoint| |polling_interval|10 |Interval in seconds between requests to `res.php` API endpoint, setting values less than 5 seconds is not recommended| -> **IMPORTANT:** once `callback` is defined for `Client` instance, all methods return only the captcha ID and DO NOT poll the API to get the result. The result will be sent to the callback URL. +> [!IMPORTANT] +> Once `callback` is defined for `Client` instance, all methods return only the captcha ID and DO NOT poll the API to get the result. The result will be sent to the callback URL. + To get the answer manually use [get_result method](#send--get_result) ## Solve captcha @@ -119,6 +124,9 @@ Below you can find basic examples for every captcha type, check out the code bel ### Normal Captcha + +[API method description.](https://2captcha.com/2captcha-api#solving_normal_captcha) + To bypass a normal captcha (distorted text on image) use the following method. This method also can be used to recognize any text on the image. ```ruby result = client.normal({ image: 'path/to/captcha.jpg'}) @@ -129,6 +137,9 @@ result = client.normal({ ``` ### Text Captcha + +[API method description.](https://2captcha.com/2captcha-api#solving_text_captcha) + This method can be used to bypass a captcha that requires to answer a question provided in clear text. ```ruby result = client.text({ @@ -138,6 +149,9 @@ result = client.text({ ``` ### reCAPTCHA v2 + +[API method description.](https://2captcha.com/2captcha-api#solving_recaptchav2_new) + Use this method to solve reCAPTCHA V2 and obtain a token to bypass the protection. ```ruby result = client.recaptcha_v2({ @@ -148,6 +162,9 @@ result = client.recaptcha_v2({ ``` ### reCAPTCHA v3 + +[API method description.](https://2captcha.com/2captcha-api#solving_recaptchav3) + This method provides reCAPTCHA V3 solver and returns a token. ```ruby result = client.recaptcha_v3({ @@ -160,6 +177,9 @@ result = client.recaptcha_v3({ ``` ### reCAPTCHA Enterprise + +[API method description.](https://2captcha.com/2captcha-api#recaptcha-enterprise) + reCAPTCHA Enterprise can be used as reCAPTCHA V2 and reCAPTCHA V3. Below is a usage example for both versions. ```ruby @@ -182,6 +202,9 @@ result = client.recaptcha_v3({ ``` ### FunCaptcha + +[API method description.](https://2captcha.com/2captcha-api#solving_funcaptcha_new) + FunCaptcha (Arkoselabs) solving method. Returns a token. ```ruby @@ -192,6 +215,9 @@ result = client.funcaptcha({ ``` ### GeeTest + +[API method description.](https://2captcha.com/2captcha-api#solving_geetest) + Method to solve GeeTest puzzle captcha. Returns a set of tokens as JSON. ```ruby result = client.geetest({ @@ -202,7 +228,22 @@ result = client.geetest({ }) ``` +### GeeTest v4 + +[API method description.](https://2captcha.com/2captcha-api#geetest-v4) + +Use this method to solve GeeTest v4. Returns the response in JSON. +```ruby +result = client.geetest_v4({ + captcha_id: 'e392e1d7fd421dc63325744d5a2b9c73', + pageurl: 'https://www.site.com/page/' +}) +``` + ### hCaptcha + +[API method description.](https://2captcha.com/2captcha-api#solving_hcaptcha) + Use this method to solve hCaptcha challenge. Returns a token to bypass captcha. ```ruby result = client.hcaptcha({ @@ -212,6 +253,9 @@ result = client.hcaptcha({ ``` ### KeyCaptcha + +[API method description.](https://2captcha.com/2captcha-api#solving_keycaptcha) + Token-based method to solve KeyCaptcha. ```ruby result = client.keycaptcha({ @@ -224,6 +268,9 @@ result = client.keycaptcha({ ``` ### Capy + +[API method description.](https://2captcha.com/2captcha-api#solving_capy) + Token-based method to bypass Capy puzzle captcha. ```ruby result = client.capy({ @@ -234,6 +281,9 @@ result = client.capy({ ``` ### Grid + +[API method description.](https://2captcha.com/2captcha-api#grid) + Grid method is originally called Old reCAPTCHA V2 method. The method can be used to bypass any type of captcha where you can apply a grid on image and need to click specific grid boxes. Returns numbers of boxes. ```ruby result = client.grid({ @@ -248,6 +298,9 @@ result = client.grid({ ``` ### Canvas + +[API method description.](https://2captcha.com/2captcha-api#canvas) + Canvas method can be used when you need to draw a line around an object on image. Returns a set of points' coordinates to draw a polygon. ```ruby result = client.canvas({ @@ -260,6 +313,9 @@ result = client.canvas({ ``` ### ClickCaptcha + +[API method description.](https://2captcha.com/2captcha-api#coordinates) + ClickCaptcha method returns coordinates of points on captcha image. Can be used if you need to click on particular points on the image. ```ruby result = client.coordinates({ @@ -271,6 +327,9 @@ result = client.coordinates({ ``` ### Rotate + +[API method description.](https://2captcha.com/2captcha-api#solving_rotatecaptcha) + This method can be used to solve a captcha that asks to rotate an object. Mostly used to bypass FunCaptcha. Returns the rotation angle. ```ruby result = client.rotate({ @@ -283,7 +342,10 @@ result = client.rotate({ ``` ### Lemin Cropped Captcha -Use this method to solve hCaptcha challenge. Returns JSON with answer containing the following values: answer, challenge_id. + +[API method description.](https://2captcha.com/2captcha-api#lemin) + +Use this method to solve Lemin challenge. Returns JSON with answer containing the following values: answer, challenge_id. ```ruby result = client.lemin({ captcha_id: 'CROPPED_1abcd2f_a1234b567c890d12ef3a456bc78d901d', @@ -294,6 +356,9 @@ result = client.lemin({ ``` ### Cloudflare Turnstile + +[API method description.](https://2captcha.com/2captcha-api#turnstile) + Use this method to solve Cloudflare Turnstile. Returns JSON with the token and User-Agent. ```ruby result = client.turnstile({ @@ -308,6 +373,9 @@ result = client.turnstile({ ``` ### Amazon WAF + +[API method description.](https://2captcha.com/2captcha-api#amazon-waf) + Use this method to solve Amazon WAF Captcha also known as AWS WAF Captcha is a part of Intelligent threat mitigation for Amazon AWS. Returns JSON with the token. ```ruby result = client.amazon_waf({ @@ -320,20 +388,15 @@ result = client.amazon_waf({ }) ``` -### GeeTest v4 -Use this method to solve GeeTest v4. Returns the response in JSON. -```ruby -result = client.geetest_v4({ - captcha_id: 'e392e1d7fd421dc63325744d5a2b9c73', - pageurl: 'https://www.site.com/page/' -}) -``` +### Audio Captcha + +[API method description.](https://2captcha.com/2captcha-api#audio) -### Audio -This method can be used to solve a audio captcha +Use the following method to bypass an audio captcha (mp3 formats only). +You must provide the language as `lang = 'en'`. Supported languages are "en", "ru", "de", "el", "pt", "fr". ```ruby result = client.audio({ - audio: 'path/to/audio.jpg', + audio: 'path/to/audio.mp3', lang: "en" }) ``` @@ -348,6 +411,9 @@ result = client.yandex({ ``` ### CyberSiARA + +[API method description.](https://2captcha.com/2captcha-api#cybersiara) + Use this method to solve CyberSiARA and obtain a token to bypass the protection. ```ruby result = client.cyber_siara({ @@ -357,8 +423,15 @@ result = client.cyber_siara({ ``` ### DataDome + +[API method description.](https://2captcha.com/2captcha-api#datadome) + Use this method to solve DataDome and obtain a token to bypass the protection. -To solve the DataDome captcha, you must use a proxy. + + +> [!IMPORTANT] +> To solve the DataDome captcha, you must use a proxy. It is recommended to use [residential proxies]. + ```ruby result = client.data_dome({ pageurl: "https://test.com", @@ -369,6 +442,9 @@ result = client.data_dome({ ``` ### MTCaptcha + +[API method description.](https://2captcha.com/2captcha-api#mtcaptcha) + Use this method to solve MTCaptcha and obtain a token to bypass the protection. ```ruby result = client.mt_captcha({ @@ -378,7 +454,14 @@ result = client.mt_captcha({ ``` ### Friendly captcha + +[API method description.](https://2captcha.com/2captcha-api#friendly-captcha) + Use this method to solve Friendly captcha and obtain a token to bypass the protection. + +> [!IMPORTANT] +> To successfully use the received token, the captcha widget must not be loaded on the page. To do this, you need to abort request to `/friendlycaptcha/...module.min.js` on the page. When the captcha widget is already loaded on the page, there is a high probability that the received token will not work. + ```ruby result = client.friendly({ pageurl: "https://example.com", @@ -387,6 +470,9 @@ result = client.friendly({ ``` ### Cutcaptcha + +[API method description.](https://2captcha.com/2captcha-api#cutcaptcha) + Use this method to solve Cutcaptcha and obtain a token to bypass the protection. ```ruby result = client.cutcaptcha({ @@ -396,6 +482,31 @@ result = client.cutcaptcha({ }) ``` +### Tencent + +[API method description.](https://2captcha.com/2captcha-api#tencent) + +Token-based method for automated solving of Tencent captcha. +```ruby +result = client.tencent({ + app_id: "197326679", + pageurl: "https://mysite.com/page/with/tencent" +}) +``` + +### atbCAPTCHA + +[API method description.](https://2captcha.com/2captcha-api#atb-captcha) + +Token-based method for automated solving of atbCAPTCHA. +```ruby +result = client.atb_captcha({ + app_id: "197326679", + api_server: "api.atb_captcha.com", + pageurl: "https://mysite.com/page/with/atb_captcha" +}) +``` + ## Other methods ### send / get_result @@ -422,6 +533,9 @@ result = client.get_result(captcha_id) ``` ### balance + +[API method description.](https://2captcha.com/2captcha-api#additional-methods) + Use this method to get your account's balance ```ruby @@ -429,6 +543,9 @@ balance = client.get_balance ``` ### report + +[API method description.](https://2captcha.com/2captcha-api#complain) + Use this method to report good or bad captcha answer. ```ruby client.report(captcha_id, True) # captcha solved correctly @@ -471,6 +588,10 @@ In case of an error, the captcha solver throws an exception. It's important to p end ``` +## Examples + +Examples of solving all supported captcha types are located in the [examples] directory. + ## Get in touch @@ -498,3 +619,5 @@ The graphics and trademarks included in this repository are not covered by the M [list of supported languages]: https://2captcha.com/2captcha-api#language [Buy residential proxies]: https://2captcha.com/proxy/residential-proxies [Quick start]: https://2captcha.com/proxy?openAddTrafficModal=true +[examples]: ./examples/ +[residential proxies]: https://2captcha.com/proxy/residential-proxies \ No newline at end of file diff --git a/README.ru.md b/README.ru.md index 1b5f340..4041eaf 100644 --- a/README.ru.md +++ b/README.ru.md @@ -7,46 +7,48 @@ -# Ruby 2Captcha API Client +# Ruby 2Captcha API Client (captcha solver) Π­Ρ‚ΠΎ самый простой способ быстро ΠΈΠ½Ρ‚Π΅Π³Ρ€ΠΈΡ€ΠΎΠ²Π°Ρ‚ΡŒ [2Captcha] Π² ваш ΠΊΠΎΠ΄ ΠΈ Π°Π²Ρ‚ΠΎΠΌΠ°Ρ‚ΠΈΠ·ΠΈΡ€ΠΎΠ²Π°Ρ‚ΡŒ Ρ€Π΅ΡˆΠ΅Π½ΠΈΠ΅ любого Ρ‚ΠΈΠΏΠ° ΠΊΠ°ΠΏΡ‡ΠΈ. ΠŸΡ€ΠΈΠΌΠ΅Ρ€Ρ‹ API-запросов для Ρ€Π°Π·Π»ΠΈΡ‡Π½Ρ‹Ρ… Ρ‚ΠΈΠΏΠΎΠ² ΠΊΠ°ΠΏΡ‡ доступны Π½Π° страницС [Ruby captcha solver](https://2captcha.com/lang/ruby). -Ruby-ΠΊΠ»ΠΈΠ΅Π½Ρ‚ для API 2Captcha. - -- [Установка](#установка) -- [Настройка](#настройка) - - [ΠžΠΏΡ†ΠΈΠΈ экзСмпляра ΠΊΠ»ΠΈΠ΅Π½Ρ‚Π°](#ΠΎΠΏΡ†ΠΈΠΈ-экзСмпляра-ΠΊΠ»ΠΈΠ΅Π½Ρ‚Π°) -- [РСшСниС ΠΊΠ°ΠΏΡ‡ΠΈ](#Ρ€Π΅ΡˆΠ΅Π½ΠΈΠ΅-ΠΊΠ°ΠΏΡ‡ΠΈ) - - [ΠžΠ±Ρ‹Ρ‡Π½Π°Ρ ΠΊΠ°ΠΏΡ‡Π°](#обычная-ΠΊΠ°ΠΏΡ‡Π°) - - [ВСкстовая ΠΊΠ°ΠΏΡ‡Π°](#тСкстовая-ΠΊΠ°ΠΏΡ‡Π°) - - [reCAPTCHA v2](#recaptcha-v2) - - [reCAPTCHA v3](#recaptcha-v3) - - [FunCaptcha](#funcaptcha) - - [GeeTest](#geetest) - - [hCaptcha](#hcaptcha) - - [KeyCaptcha](#keycaptcha) - - [Capy](#capy) - - [Grid](#grid) - - [Canvas](#canvas) - - [ClickCaptcha](#clickcaptcha) - - [Rotate](#rotate) - - [AmazonWAF](#amazon-waf) - - [CloudflareTurnstile](#cloudflare-turnstile) - - [Lemin Cropped Captcha](#lemin-cropped-captcha) - - [GeeTest V4](#geetest-v4) - - [Аудио](#audio) - - [CyberSiARA](#cybersiara) - - [DataDome](#datadome) - - [MTCaptcha](#mtcaptcha) - - [Friendly captcha](#friendly-captcha) - - [Cutcaptcha](#cutcaptcha) -- [Π”Ρ€ΡƒΠ³ΠΈΠ΅ ΠΌΠ΅Ρ‚ΠΎΠ΄Ρ‹](#Π΄Ρ€ΡƒΠ³ΠΈΠ΅-ΠΌΠ΅Ρ‚ΠΎΠ΄Ρ‹) - - [send / get_result](#send--get_result) - - [Баланс](#баланс) - - [ΠžΡ‚Ρ‡Π΅Ρ‚](#ΠΎΡ‚Ρ‡Π΅Ρ‚) -- [ΠŸΡ€ΠΎΠΊΡΠΈ](#прокси) -- [ΠžΠ±Ρ€Π°Π±ΠΎΡ‚ΠΊΠ° ошибок](#ΠΎΠ±Ρ€Π°Π±ΠΎΡ‚ΠΊΠ°-ошибок) +- [Ruby 2Captcha API Client (captcha solver)](#ruby-2captcha-api-client-captcha-solver) + - [Установка](#установка) + - [Настройка](#настройка) + - [ΠžΠΏΡ†ΠΈΠΈ экзСмпляра ΠΊΠ»ΠΈΠ΅Π½Ρ‚Π°](#ΠΎΠΏΡ†ΠΈΠΈ-экзСмпляра-ΠΊΠ»ΠΈΠ΅Π½Ρ‚Π°) + - [РСшСниС ΠΊΠ°ΠΏΡ‡ΠΈ](#Ρ€Π΅ΡˆΠ΅Π½ΠΈΠ΅-ΠΊΠ°ΠΏΡ‡ΠΈ) + - [ΠžΠ±Ρ‹Ρ‡Π½Π°Ρ ΠΊΠ°ΠΏΡ‡Π°](#обычная-ΠΊΠ°ΠΏΡ‡Π°) + - [ВСкстовая ΠΊΠ°ΠΏΡ‡Π°](#тСкстовая-ΠΊΠ°ΠΏΡ‡Π°) + - [reCAPTCHA v2](#recaptcha-v2) + - [reCAPTCHA v3](#recaptcha-v3) + - [FunCaptcha](#funcaptcha) + - [GeeTest](#geetest) + - [GeeTest V4](#geetest-v4) + - [hCaptcha](#hcaptcha) + - [KeyCaptcha](#keycaptcha) + - [Capy](#capy) + - [Grid](#grid) + - [Canvas](#canvas) + - [ClickCaptcha](#clickcaptcha) + - [Rotate](#rotate) + - [Amazon WAF](#amazon-waf) + - [Cloudflare Turnstile](#cloudflare-turnstile) + - [Lemin Cropped Captcha](#lemin-cropped-captcha) + - [РаспознаваниС Π°ΡƒΠ΄ΠΈΠΎ](#распознаваниС-Π°ΡƒΠ΄ΠΈΠΎ) + - [CyberSiARA](#cybersiara) + - [DataDome](#datadome) + - [MTCaptcha](#mtcaptcha) + - [Friendly captcha](#friendly-captcha) + - [Cutcaptcha](#cutcaptcha) + - [Tencent](#tencent) + - [atbCAPTCHA](#atbcaptcha) + - [Π”Ρ€ΡƒΠ³ΠΈΠ΅ ΠΌΠ΅Ρ‚ΠΎΠ΄Ρ‹](#Π΄Ρ€ΡƒΠ³ΠΈΠ΅-ΠΌΠ΅Ρ‚ΠΎΠ΄Ρ‹) + - [send / get_result](#send--get_result) + - [Баланс](#баланс) + - [ΠžΡ‚Ρ‡Π΅Ρ‚](#ΠΎΡ‚Ρ‡Π΅Ρ‚) + - [ΠŸΡ€ΠΎΠΊΡΠΈ](#прокси) + - [ΠžΠ±Ρ€Π°Π±ΠΎΡ‚ΠΊΠ° ошибок](#ΠΎΠ±Ρ€Π°Π±ΠΎΡ‚ΠΊΠ°-ошибок) + - [ΠŸΡ€ΠΈΠΌΠ΅Ρ€Ρ‹](#ΠΏΡ€ΠΈΠΌΠ΅Ρ€Ρ‹) - [Π‘Π²ΡΠΆΠΈΡ‚Π΅ΡΡŒ с Π½Π°ΠΌΠΈ](#ΡΠ²ΡΠΆΠΈΡ‚Π΅ΡΡŒ-с-Π½Π°ΠΌΠΈ) - [ΠŸΡ€ΠΈΡΠΎΠ΅Π΄ΠΈΠ½ΡΠΉΡ‚Π΅ΡΡŒ ΠΊ ΠΊΠΎΠΌΠ°Π½Π΄Π΅ πŸ‘ͺ](#join-the-team) - [ЛицСнзия](#лицСнзия) @@ -76,7 +78,7 @@ gem install ruby-2captcha ОписаниС всСх Π½Π΅ΠΎΠ±Ρ…ΠΎΠ΄ΠΈΠΌΡ‹Ρ… ΠΏΠ°Ρ€Π°ΠΌΠ΅Ρ‚Ρ€ΠΎΠ² для настройки установлСнного Π³Π΅ΠΌΠ°. -ЭкзСмпляр класса Api2Captcha ΠΌΠΎΠΆΠ½ΠΎ ΡΠΎΠ·Π΄Π°Ρ‚ΡŒ ΡΠ»Π΅Π΄ΡƒΡŽΡ‰ΠΈΠΌ ΠΎΠ±Ρ€Π°Π·ΠΎΠΌ: +ЭкзСмпляр класса `Api2Captcha` ΠΌΠΎΠΆΠ½ΠΎ ΡΠΎΠ·Π΄Π°Ρ‚ΡŒ ΡΠ»Π΅Π΄ΡƒΡŽΡ‰ΠΈΠΌ ΠΎΠ±Ρ€Π°Π·ΠΎΠΌ: ```ruby require 'api_2captcha' @@ -84,7 +86,7 @@ require 'api_2captcha' client = Api2Captcha.new("YOUR_API_KEY") ``` ### ΠžΠΏΡ†ΠΈΠΈ экзСмпляра ΠΊΠ»ΠΈΠ΅Π½Ρ‚Π° -Π£ вас Ρ‚Π°ΠΊΠΆΠ΅ Π΅ΡΡ‚ΡŒ Π²ΠΎΠ·ΠΌΠΎΠΆΠ½ΠΎΡΡ‚ΡŒ Π½Π°ΡΡ‚Ρ€ΠΎΠΈΡ‚ΡŒ Π½Π΅ΠΊΠΎΡ‚ΠΎΡ€Ρ‹Π΅ ΠΏΠ°Ρ€Π°ΠΌΠ΅Ρ‚Ρ€Ρ‹ экзСмпляра Api2Captcha: +Π£ вас Ρ‚Π°ΠΊΠΆΠ΅ Π΅ΡΡ‚ΡŒ Π²ΠΎΠ·ΠΌΠΎΠΆΠ½ΠΎΡΡ‚ΡŒ Π½Π°ΡΡ‚Ρ€ΠΎΠΈΡ‚ΡŒ Π½Π΅ΠΊΠΎΡ‚ΠΎΡ€Ρ‹Π΅ ΠΏΠ°Ρ€Π°ΠΌΠ΅Ρ‚Ρ€Ρ‹ экзСмпляра `Api2Captcha`: ```ruby client.soft_id(123) @@ -94,28 +96,34 @@ client.default_timeout(120) client.polling_interval(10) ``` -**Π’ΠΠ–ΠΠž**: послС опрСдСлСния ΠΎΠ±Ρ€Π°Ρ‚Π½ΠΎΠ³ΠΎ Π²Ρ‹Π·ΠΎΠ²Π° для экзСмпляра , всС ΠΌΠ΅Ρ‚ΠΎΠ΄Ρ‹ Π²ΠΎΠ·Π²Ρ€Π°Ρ‰Π°ΡŽΡ‚ Ρ‚ΠΎΠ»ΡŒΠΊΠΎ ΠΈΠ΄Π΅Π½Ρ‚ΠΈΡ„ΠΈΠΊΠ°Ρ‚ΠΎΡ€ ΠΊΠ°ΠΏΡ‡ΠΈ ΠΈ НЕ Π·Π°ΠΏΡ€Π°ΡˆΠΈΠ²Π°ΡŽΡ‚ Ρ€Π΅Π·ΡƒΠ»ΡŒΡ‚Π°Ρ‚ Ρƒ API. Π Π΅Π·ΡƒΠ»ΡŒΡ‚Π°Ρ‚ Π±ΡƒΠ΄Π΅Ρ‚ ΠΎΡ‚ΠΏΡ€Π°Π²Π»Π΅Π½ Π½Π° URL ΠΎΠ±Ρ€Π°Ρ‚Π½ΠΎΠ³ΠΎ Π²Ρ‹Π·ΠΎΠ²Π°. Π§Ρ‚ΠΎΠ±Ρ‹ ΠΏΠΎΠ»ΡƒΡ‡ΠΈΡ‚ΡŒ ΠΎΡ‚Π²Π΅Ρ‚ Π²Ρ€ΡƒΡ‡Π½ΡƒΡŽ, ΠΈΡΠΏΠΎΠ»ΡŒΠ·ΡƒΠΉΡ‚Π΅ ΠΌΠ΅Ρ‚ΠΎΠ΄ get_result. +> [!IMPORTANT] +> ПослС опрСдСлСния ΠΎΠ±Ρ€Π°Ρ‚Π½ΠΎΠ³ΠΎ Π²Ρ‹Π·ΠΎΠ²Π° для экзСмпляра, всС ΠΌΠ΅Ρ‚ΠΎΠ΄Ρ‹ Π²ΠΎΠ·Π²Ρ€Π°Ρ‰Π°ΡŽΡ‚ Ρ‚ΠΎΠ»ΡŒΠΊΠΎ ΠΈΠ΄Π΅Π½Ρ‚ΠΈΡ„ΠΈΠΊΠ°Ρ‚ΠΎΡ€ ΠΊΠ°ΠΏΡ‡ΠΈ ΠΈ НЕ Π·Π°ΠΏΡ€Π°ΡˆΠΈΠ²Π°ΡŽΡ‚ Ρ€Π΅Π·ΡƒΠ»ΡŒΡ‚Π°Ρ‚ Ρƒ API. Π Π΅Π·ΡƒΠ»ΡŒΡ‚Π°Ρ‚ Π±ΡƒΠ΄Π΅Ρ‚ ΠΎΡ‚ΠΏΡ€Π°Π²Π»Π΅Π½ Π½Π° URL ΠΎΠ±Ρ€Π°Ρ‚Π½ΠΎΠ³ΠΎ Π²Ρ‹Π·ΠΎΠ²Π°. + +Π§Ρ‚ΠΎΠ±Ρ‹ ΠΏΠΎΠ»ΡƒΡ‡ΠΈΡ‚ΡŒ ΠΎΡ‚Π²Π΅Ρ‚ Π²Ρ€ΡƒΡ‡Π½ΡƒΡŽ, ΠΈΡΠΏΠΎΠ»ΡŒΠ·ΡƒΠΉΡ‚Π΅ ΠΌΠ΅Ρ‚ΠΎΠ΄ [get_result](#send--get_result). ## РСшСниС ΠΊΠ°ΠΏΡ‡ΠΈ -ΠŸΡ€ΠΈ ΠΎΡ‚ΠΏΡ€Π°Π²ΠΊΠ΅ любой ΠΊΠ°ΠΏΡ‡ΠΈ, основанной Π½Π° ΠΈΠ·ΠΎΠ±Ρ€Π°ΠΆΠ΅Π½ΠΈΠΈ, Π²Ρ‹ ΠΌΠΎΠΆΠ΅Ρ‚Π΅ ΠΏΡ€Π΅Π΄ΠΎΡΡ‚Π°Π²ΠΈΡ‚ΡŒ Π΄ΠΎΠΏΠΎΠ»Π½ΠΈΡ‚Π΅Π»ΡŒΠ½Ρ‹Π΅ ΠΏΠ°Ρ€Π°ΠΌΠ΅Ρ‚Ρ€Ρ‹, Ρ‡Ρ‚ΠΎΠ±Ρ‹ ΠΏΠΎΠΌΠΎΡ‡ΡŒ Ρ€Π°Π±ΠΎΡ‚Π½ΠΈΠΊΠ°ΠΌ 2Captcha ΠΏΡ€Π°Π²ΠΈΠ»ΡŒΠ½ΠΎ Π΅Π΅ Ρ€Π΅ΡˆΠΈΡ‚ΡŒ. +ΠŸΡ€ΠΈ ΠΎΡ‚ΠΏΡ€Π°Π²ΠΊΠ΅ любой ΠΊΠ°ΠΏΡ‡ΠΈ, основанной Π½Π° ΠΈΠ·ΠΎΠ±Ρ€Π°ΠΆΠ΅Π½ΠΈΠΈ, Π²Ρ‹ ΠΌΠΎΠΆΠ΅Ρ‚Π΅ ΠΏΡ€Π΅Π΄ΠΎΡΡ‚Π°Π²ΠΈΡ‚ΡŒ Π΄ΠΎΠΏΠΎΠ»Π½ΠΈΡ‚Π΅Π»ΡŒΠ½Ρ‹Π΅ ΠΏΠ°Ρ€Π°ΠΌΠ΅Ρ‚Ρ€Ρ‹, Ρ‡Ρ‚ΠΎΠ±Ρ‹ ΠΏΠΎΠΌΠΎΡ‡ΡŒ Ρ€Π°Π±ΠΎΡ‚Π½ΠΈΠΊΠ°ΠΌ 2Captcha ΠΏΡ€Π°Π²ΠΈΠ»ΡŒΠ½ΠΎ Π΅Ρ‘ Ρ€Π΅ΡˆΠΈΡ‚ΡŒ. ### ΠŸΠ°Ρ€Π°ΠΌΠ΅Ρ‚Ρ€Ρ‹ ΠΊΠ°ΠΏΡ‡ΠΈ -| ΠŸΠ°Ρ€Π°ΠΌΠ΅Ρ‚Ρ€ | Π—Π½Π°Ρ‡Π΅Π½ΠΈΠ΅ ΠΏΠΎ ΡƒΠΌΠΎΠ»Ρ‡Π°Π½ΠΈΡŽ | ОписаниС | -|-------------------|---------------|-------------------------------------------------------------------------------------------------------------------------------| -| numeric | 0 | ΠžΠΏΡ€Π΅Π΄Π΅Π»ΡΠ΅Ρ‚, содСрТит Π»ΠΈ ΠΊΠ°ΠΏΡ‡Π° числа ΠΈΠ»ΠΈ Π΄Ρ€ΡƒΠ³ΠΈΠ΅ символы [ΠΏΠΎΠ΄Ρ€ΠΎΠ±Π½Π΅Π΅ см. Π² Π΄ΠΎΠΊΡƒΠΌΠ΅Π½Ρ‚Π°Ρ†ΠΈΠΈ ΠΏΠΎ API](https://2captcha.com/2captcha-api#solving_normal_captcha) | -| min_len | 0 | Минимальная Π΄Π»ΠΈΠ½Π° ΠΎΡ‚Π²Π΅Ρ‚Π° length | -| max_len | 0 | Максимальная Π΄Π»ΠΈΠ½Π° ΠΎΡ‚Π²Π΅Ρ‚Π° length | -| phrase | 0 | ΠžΠΏΡ€Π΅Π΄Π΅Π»ΡΠ΅Ρ‚, содСрТит Π»ΠΈ ΠΎΡ‚Π²Π΅Ρ‚ нСсколько слов ΠΈΠ»ΠΈ Π½Π΅Ρ‚ | -| case_sensitive | 0 | ΠžΠΏΡ€Π΅Π΄Π΅Π»ΡΠ΅Ρ‚, учитываСтся Π»ΠΈ рСгистр Π² ΠΎΡ‚Π²Π΅Ρ‚Π΅ | -| calc | 0 | ΠžΠΏΡ€Π΅Π΄Π΅Π»ΡΠ΅Ρ‚, трСбуСтся Π»ΠΈ вычислСниС Π² Ρ€Π΅ΡˆΠ΅Π½ΠΈΠΈ ΠΊΠ°ΠΏΡ‡ΠΈ | +| ΠŸΠ°Ρ€Π°ΠΌΠ΅Ρ‚Ρ€ | Π—Π½Π°Ρ‡Π΅Π½ΠΈΠ΅ ΠΏΠΎ ΡƒΠΌΠΎΠ»Ρ‡Π°Π½ΠΈΡŽ | ОписаниС | +|-------------------|---------------|--------------------------------------------------------------------------------------------------------------------| +| numeric | 0 | ΠžΠΏΡ€Π΅Π΄Π΅Π»ΡΠ΅Ρ‚, содСрТит Π»ΠΈ ΠΊΠ°ΠΏΡ‡Π° числа ΠΈΠ»ΠΈ Π΄Ρ€ΡƒΠ³ΠΈΠ΅ символы [ΠΏΠΎΠ΄Ρ€ΠΎΠ±Π½Π΅Π΅ см. Π² Π΄ΠΎΠΊΡƒΠΌΠ΅Π½Ρ‚Π°Ρ†ΠΈΠΈ ΠΏΠΎ API](https://2captcha.com/2captcha-api#solving_normal_captcha) | +| min_len | 0 | Минимальная Π΄Π»ΠΈΠ½Π° ΠΎΡ‚Π²Π΅Ρ‚Π° length | +| max_len | 0 | Максимальная Π΄Π»ΠΈΠ½Π° ΠΎΡ‚Π²Π΅Ρ‚Π° length | +| phrase | 0 | ΠžΠΏΡ€Π΅Π΄Π΅Π»ΡΠ΅Ρ‚, содСрТит Π»ΠΈ ΠΎΡ‚Π²Π΅Ρ‚ нСсколько слов ΠΈΠ»ΠΈ Π½Π΅Ρ‚ | +| case_sensitive | 0 | ΠžΠΏΡ€Π΅Π΄Π΅Π»ΡΠ΅Ρ‚, учитываСтся Π»ΠΈ рСгистр Π² ΠΎΡ‚Π²Π΅Ρ‚Π΅ | +| calc | 0 | ΠžΠΏΡ€Π΅Π΄Π΅Π»ΡΠ΅Ρ‚, трСбуСтся Π»ΠΈ вычислСниС Π² Ρ€Π΅ΡˆΠ΅Π½ΠΈΠΈ ΠΊΠ°ΠΏΡ‡ΠΈ | | lang | - | ΠžΠΏΡ€Π΅Π΄Π΅Π»ΡΠ΅Ρ‚ язык ΠΊΠ°ΠΏΡ‡ΠΈ, см. [список ΠΏΠΎΠ΄Π΄Π΅Ρ€ΠΆΠΈΠ²Π°Π΅ΠΌΡ‹Ρ… языков](https://2captcha.com/2captcha-api#language) | -| hint_image | - | Π˜Π·ΠΎΠ±Ρ€Π°ΠΆΠ΅Π½ΠΈΠ΅ с подсказкой, ΠΏΠΎΠΊΠ°Π·Ρ‹Π²Π°Π΅ΠΌΠΎΠ΅ Ρ€Π°Π±ΠΎΡ‚Π½ΠΈΠΊΠ°ΠΌ с ΠΊΠ°ΠΏΡ‡Π΅ΠΉ, ΠΏΠ΅Ρ€Π΅Π²Π΅Π΄Π΅Π½Π½ΠΎΠ΅ ΠΈΠ· ΠΏΠ°Ρ€Π°ΠΌΠ΅Ρ‚Ρ€Π° API instructionsimg | -| hint_text | - | Подсказка ΠΈΠ»ΠΈ тСкст задания, ΠΏΠΎΠΊΠ°Π·Ρ‹Π²Π°Π΅ΠΌΡ‹Π΅ Ρ€Π°Π±ΠΎΡ‚Π½ΠΈΠΊΠ°ΠΌ с ΠΊΠ°ΠΏΡ‡Π΅ΠΉ | +| hint_image | - | Π˜Π·ΠΎΠ±Ρ€Π°ΠΆΠ΅Π½ΠΈΠ΅ с подсказкой, ΠΏΠΎΠΊΠ°Π·Ρ‹Π²Π°Π΅ΠΌΠΎΠ΅ Ρ€Π°Π±ΠΎΡ‚Π½ΠΈΠΊΠ°ΠΌ с ΠΊΠ°ΠΏΡ‡Π΅ΠΉ, ΠΏΠ΅Ρ€Π΅Π²Π΅Π΄Π΅Π½Π½ΠΎΠ΅ ΠΈΠ· ΠΏΠ°Ρ€Π°ΠΌΠ΅Ρ‚Ρ€Π° API instructionsimg | +| hint_text | - | Подсказка ΠΈΠ»ΠΈ тСкст задания, ΠΏΠΎΠΊΠ°Π·Ρ‹Π²Π°Π΅ΠΌΡ‹Π΅ Ρ€Π°Π±ΠΎΡ‚Π½ΠΈΠΊΠ°ΠΌ с ΠΊΠ°ΠΏΡ‡Π΅ΠΉ | НиТС Π²Ρ‹ Π½Π°ΠΉΠ΄Π΅Ρ‚Π΅ основныС ΠΏΡ€ΠΈΠΌΠ΅Ρ€Ρ‹ для ΠΊΠ°ΠΆΠ΄ΠΎΠ³ΠΎ Ρ‚ΠΈΠΏΠ° ΠΊΠ°ΠΏΡ‡ΠΈ. ΠžΠ·Π½Π°ΠΊΠΎΠΌΡŒΡ‚Π΅ΡΡŒ с ΠΊΠΎΠ΄ΠΎΠΌ Π½ΠΈΠΆΠ΅. ### ΠžΠ±Ρ‹Ρ‡Π½Π°Ρ ΠΊΠ°ΠΏΡ‡Π° + +[ОписаниС ΠΌΠ΅Ρ‚ΠΎΠ΄Π° API.](https://2captcha.com/2captcha-api#solving_normal_captcha) + Для ΠΎΠ±Ρ…ΠΎΠ΄Π° ΠΎΠ±Ρ‹Ρ‡Π½ΠΎΠΉ ΠΊΠ°ΠΏΡ‡ΠΈ (искаТСнный тСкст Π½Π° ΠΊΠ°Ρ€Ρ‚ΠΈΠ½ΠΊΠ΅) ΠΈΡΠΏΠΎΠ»ΡŒΠ·ΡƒΠΉΡ‚Π΅ ΡΠ»Π΅Π΄ΡƒΡŽΡ‰ΠΈΠΉ ΠΌΠ΅Ρ‚ΠΎΠ΄. Π­Ρ‚ΠΎΡ‚ ΠΌΠ΅Ρ‚ΠΎΠ΄ Ρ‚Π°ΠΊΠΆΠ΅ ΠΌΠΎΠΆΠ΅Ρ‚ ΠΈΡΠΏΠΎΠ»ΡŒΠ·ΠΎΠ²Π°Ρ‚ΡŒΡΡ для распознавания любого тСкста Π½Π° ΠΊΠ°Ρ€Ρ‚ΠΈΠ½ΠΊΠ΅. ```ruby @@ -125,8 +133,11 @@ result = client.normal({ image: 'https://site-with-captcha.com/path/to/captcha.jpg' }) ``` + ### ВСкстовая ΠΊΠ°ΠΏΡ‡Π° +[ОписаниС ΠΌΠ΅Ρ‚ΠΎΠ΄Π° API.](https://2captcha.com/2captcha-api#solving_text_captcha) + Π­Ρ‚ΠΎΡ‚ ΠΌΠ΅Ρ‚ΠΎΠ΄ ΠΌΠΎΠΆΠ΅Ρ‚ ΠΈΡΠΏΠΎΠ»ΡŒΠ·ΠΎΠ²Π°Ρ‚ΡŒΡΡ для ΠΎΠ±Ρ…ΠΎΠ΄Π° ΠΊΠ°ΠΏΡ‡ΠΈ, которая Ρ‚Ρ€Π΅Π±ΡƒΠ΅Ρ‚ ΠΎΡ‚Π²Π΅Ρ‚ΠΈΡ‚ΡŒ Π½Π° вопрос, прСдставлСнный Π² явном Π²ΠΈΠ΄Π΅. ```ruby @@ -137,6 +148,9 @@ result = client.text({ ``` ### reCAPTCHA v2 + +[ОписаниС ΠΌΠ΅Ρ‚ΠΎΠ΄Π° API.](https://2captcha.com/2captcha-api#solving_recaptchav2_new) + Π˜ΡΠΏΠΎΠ»ΡŒΠ·ΡƒΠΉΡ‚Π΅ этот ΠΌΠ΅Ρ‚ΠΎΠ΄ для Ρ€Π΅ΡˆΠ΅Π½ΠΈΡ reCAPTCHA v2 ΠΈ получСния Ρ‚ΠΎΠΊΠ΅Π½Π° для ΠΎΠ±Ρ…ΠΎΠ΄Π° Π·Π°Ρ‰ΠΈΡ‚Ρ‹. ```ruby @@ -148,6 +162,9 @@ result = client.recaptcha_v2({ ``` ### reCAPTCHA v3 + +[ОписаниС ΠΌΠ΅Ρ‚ΠΎΠ΄Π° API.](https://2captcha.com/2captcha-api#solving_recaptchav3) + Π­Ρ‚ΠΎΡ‚ ΠΌΠ΅Ρ‚ΠΎΠ΄ прСдоставляСт Ρ€Π΅ΡˆΠ΅Π½ΠΈΠ΅ для reCAPTCHA v3 ΠΈ Π²ΠΎΠ·Π²Ρ€Π°Ρ‰Π°Π΅Ρ‚ Ρ‚ΠΎΠΊΠ΅Π½. ```ruby @@ -161,6 +178,9 @@ result = client.recaptcha_v3({ ``` ### FunCaptcha + +[ОписаниС ΠΌΠ΅Ρ‚ΠΎΠ΄Π° API.](https://2captcha.com/2captcha-api#solving_funcaptcha_new) + ΠœΠ΅Ρ‚ΠΎΠ΄ Ρ€Π΅ΡˆΠ΅Π½ΠΈΡ FunCaptcha (Arkoselabs). Он Π²ΠΎΠ·Π²Ρ€Π°Ρ‰Π°Π΅Ρ‚ Ρ‚ΠΎΠΊΠ΅Π½. ```ruby @@ -171,6 +191,9 @@ result = client.funcaptcha({ ``` ### GeeTest + +[ОписаниС ΠΌΠ΅Ρ‚ΠΎΠ΄Π° API.](https://2captcha.com/2captcha-api#solving_geetest) + ΠœΠ΅Ρ‚ΠΎΠ΄ для Ρ€Π΅ΡˆΠ΅Π½ΠΈΡ Π³ΠΎΠ»ΠΎΠ²ΠΎΠ»ΠΎΠΌΠΊΠΈ GeeTest captcha. Он Π²ΠΎΠ·Π²Ρ€Π°Ρ‰Π°Π΅Ρ‚ Π½Π°Π±ΠΎΡ€ Ρ‚ΠΎΠΊΠ΅Π½ΠΎΠ² Π² Ρ„ΠΎΡ€ΠΌΠ°Ρ‚Π΅ JSON. ```ruby @@ -182,7 +205,23 @@ result = client.geetest({ }) ``` +### GeeTest v4 + +[ОписаниС ΠΌΠ΅Ρ‚ΠΎΠ΄Π° API.](https://2captcha.com/2captcha-api#geetest-v4) + +Π˜ΡΠΏΠΎΠ»ΡŒΠ·ΡƒΠΉΡ‚Π΅ этот ΠΌΠ΅Ρ‚ΠΎΠ΄ для Ρ€Π΅ΡˆΠ΅Π½ΠΈΡ GeeTest v4. Он Π²ΠΎΠ·Π²Ρ€Π°Ρ‰Π°Π΅Ρ‚ ΠΎΡ‚Π²Π΅Ρ‚ Π² Ρ„ΠΎΡ€ΠΌΠ°Ρ‚Π΅ JSON. + +```ruby +result = client.geetest_v4({ + captcha_id: 'e392e1d7fd421dc63325744d5a2b9c73', + pageurl: 'https://www.site.com/page/' +}) +``` + ### hCaptcha + +[ОписаниС ΠΌΠ΅Ρ‚ΠΎΠ΄Π° API.](https://2captcha.com/2captcha-api#solving_hcaptcha) + ΠœΠ΅Ρ‚ΠΎΠ΄ Ρ€Π΅ΡˆΠ΅Π½ΠΈΡ hCaptcha. Он Π²ΠΎΠ·Π²Ρ€Π°Ρ‰Π°Π΅Ρ‚ Ρ‚ΠΎΠΊΠ΅Π½ для ΠΎΠ±Ρ…ΠΎΠ΄Π° ΠΊΠ°ΠΏΡ‡ΠΈ. ```ruby @@ -193,6 +232,9 @@ result = client.hcaptcha({ ``` ### KeyCaptcha + +[ОписаниС ΠΌΠ΅Ρ‚ΠΎΠ΄Π° API.](https://2captcha.com/2captcha-api#solving_keycaptcha) + ΠœΠ΅Ρ‚ΠΎΠ΄ Π½Π° основС Ρ‚ΠΎΠΊΠ΅Π½ΠΎΠ² для Ρ€Π΅ΡˆΠ΅Π½ΠΈΡ KeyCaptcha. ```ruby @@ -206,6 +248,9 @@ result = client.keycaptcha({ ``` ### Capy + +[ОписаниС ΠΌΠ΅Ρ‚ΠΎΠ΄Π° API.](https://2captcha.com/2captcha-api#solving_capy) + ΠœΠ΅Ρ‚ΠΎΠ΄ основан Π½Π° использовании Ρ‚ΠΎΠΊΠ΅Π½ΠΎΠ² для ΠΎΠ±Ρ…ΠΎΠ΄Π° ΠΏΠ°Π·Π·Π»Π° Capy. ```ruby @@ -217,6 +262,9 @@ result = client.capy({ ``` ### Grid + +[ОписаниС ΠΌΠ΅Ρ‚ΠΎΠ΄Π° API.](https://2captcha.com/2captcha-api#grid) + ΠœΠ΅Ρ‚ΠΎΠ΄ сСтки ΠΈΠ·Π½Π°Ρ‡Π°Π»ΡŒΠ½ΠΎ называСтся ΠΌΠ΅Ρ‚ΠΎΠ΄ΠΎΠΌ Old ReCaptcha V2. Π­Ρ‚ΠΎΡ‚ ΠΌΠ΅Ρ‚ΠΎΠ΄ ΠΌΠΎΠΆΠ΅Ρ‚ Π±Ρ‹Ρ‚ΡŒ использован для ΠΎΠ±Ρ…ΠΎΠ΄Π° любого Ρ‚ΠΈΠΏΠ° ΠΊΠ°ΠΏΡ‡ΠΈ, Π³Π΄Π΅ Π²Ρ‹ ΠΌΠΎΠΆΠ΅Ρ‚Π΅ ΠΏΡ€ΠΈΠΌΠ΅Π½ΠΈΡ‚ΡŒ сСтку ΠΊ ΠΈΠ·ΠΎΠ±Ρ€Π°ΠΆΠ΅Π½ΠΈΡŽ ΠΈ Π½Π΅ΠΎΠ±Ρ…ΠΎΠ΄ΠΈΠΌΠΎ ΠΊΠ»ΠΈΠΊΠ½ΡƒΡ‚ΡŒ ΠΏΠΎ ΠΎΠΏΡ€Π΅Π΄Π΅Π»Π΅Π½Π½Ρ‹ΠΌ ячСйкам сСтки. Он Π²ΠΎΠ·Π²Ρ€Π°Ρ‰Π°Π΅Ρ‚ количСство Π²Ρ‹Π±Ρ€Π°Π½Π½Ρ‹Ρ… ячССк. ```ruby @@ -232,6 +280,9 @@ result = client.grid({ ``` ### Canvas + +[ОписаниС ΠΌΠ΅Ρ‚ΠΎΠ΄Π° API.](https://2captcha.com/2captcha-api#canvas) + ΠœΠ΅Ρ‚ΠΎΠ΄ Canvas ΠΌΠΎΠΆΠ΅Ρ‚ Π±Ρ‹Ρ‚ΡŒ использован, ΠΊΠΎΠ³Π΄Π° Π²Π°ΠΌ Π½Π΅ΠΎΠ±Ρ…ΠΎΠ΄ΠΈΠΌΠΎ Π½Π°Ρ€ΠΈΡΠΎΠ²Π°Ρ‚ΡŒ линию Π²ΠΎΠΊΡ€ΡƒΠ³ ΠΎΠ±ΡŠΠ΅ΠΊΡ‚Π° Π½Π° ΠΈΠ·ΠΎΠ±Ρ€Π°ΠΆΠ΅Π½ΠΈΠΈ. Он Π²ΠΎΠ·Π²Ρ€Π°Ρ‰Π°Π΅Ρ‚ Π½Π°Π±ΠΎΡ€ ΠΊΠΎΠΎΡ€Π΄ΠΈΠ½Π°Ρ‚ Ρ‚ΠΎΡ‡Π΅ΠΊ для рисования ΠΌΠ½ΠΎΠ³ΠΎΡƒΠ³ΠΎΠ»ΡŒΠ½ΠΈΠΊΠ°. ```ruby @@ -245,6 +296,9 @@ result = client.canvas({ ``` ### ClickCaptcha + +[ОписаниС ΠΌΠ΅Ρ‚ΠΎΠ΄Π° API.](https://2captcha.com/2captcha-api#coordinates) + ΠœΠ΅Ρ‚ΠΎΠ΄ ClickCaptcha Π²ΠΎΠ·Π²Ρ€Π°Ρ‰Π°Π΅Ρ‚ ΠΊΠΎΠΎΡ€Π΄ΠΈΠ½Π°Ρ‚Ρ‹ Ρ‚ΠΎΡ‡Π΅ΠΊ Π½Π° ΠΈΠ·ΠΎΠ±Ρ€Π°ΠΆΠ΅Π½ΠΈΠΈ ΠΊΠ°ΠΏΡ‡ΠΈ. ΠœΠΎΠΆΠ΅Ρ‚ Π±Ρ‹Ρ‚ΡŒ использован, Ссли Π²Π°ΠΌ Π½Π΅ΠΎΠ±Ρ…ΠΎΠ΄ΠΈΠΌΠΎ ΠΊΠ»ΠΈΠΊΠ½ΡƒΡ‚ΡŒ ΠΏΠΎ ΠΎΠΏΡ€Π΅Π΄Π΅Π»Π΅Π½Π½Ρ‹ΠΌ Ρ‚ΠΎΡ‡ΠΊΠ°ΠΌ Π½Π° ΠΈΠ·ΠΎΠ±Ρ€Π°ΠΆΠ΅Π½ΠΈΠΈ. ```ruby @@ -257,6 +311,9 @@ result = client.coordinates({ ``` ### Rotate + +[ОписаниС ΠΌΠ΅Ρ‚ΠΎΠ΄Π° API.](https://2captcha.com/2captcha-api#solving_rotatecaptcha) + Π­Ρ‚ΠΎΡ‚ ΠΌΠ΅Ρ‚ΠΎΠ΄ ΠΌΠΎΠΆΠ΅Ρ‚ Π±Ρ‹Ρ‚ΡŒ использован для Ρ€Π΅ΡˆΠ΅Π½ΠΈΡ ΠΊΠ°ΠΏΡ‡ΠΈ, которая просит ΠΏΠΎΠ²Π΅Ρ€Π½ΡƒΡ‚ΡŒ ΠΎΠ±ΡŠΠ΅ΠΊΡ‚. Π’ основном ΠΈΡΠΏΠΎΠ»ΡŒΠ·ΡƒΠ΅Ρ‚ΡΡ для ΠΎΠ±Ρ…ΠΎΠ΄Π° FunCaptcha. Он Π²ΠΎΠ·Π²Ρ€Π°Ρ‰Π°Π΅Ρ‚ ΡƒΠ³ΠΎΠ» ΠΏΠΎΠ²ΠΎΡ€ΠΎΡ‚Π°. ```ruby @@ -271,7 +328,10 @@ result = client.rotate({ ### Lemin Cropped Captcha -Π˜ΡΠΏΠΎΠ»ΡŒΠ·ΡƒΠΉΡ‚Π΅ этот ΠΌΠ΅Ρ‚ΠΎΠ΄ для Ρ€Π΅ΡˆΠ΅Π½ΠΈΡ задания hCaptcha. Он Π²ΠΎΠ·Π²Ρ€Π°Ρ‰Π°Π΅Ρ‚ JSON-ΠΎΡ‚Π²Π΅Ρ‚ с ΡƒΠΊΠ°Π·Π°Π½Π½Ρ‹ΠΌΠΈ значСниями: ΠΎΡ‚Π²Π΅Ρ‚ (answer) ΠΈ ΠΈΠ΄Π΅Π½Ρ‚ΠΈΡ„ΠΈΠΊΠ°Ρ‚ΠΎΡ€ задания (challenge_id). + +[ОписаниС ΠΌΠ΅Ρ‚ΠΎΠ΄Π° API.](https://2captcha.com/2captcha-api#lemin) + +Π˜ΡΠΏΠΎΠ»ΡŒΠ·ΡƒΠΉΡ‚Π΅ этот ΠΌΠ΅Ρ‚ΠΎΠ΄ для Ρ€Π΅ΡˆΠ΅Π½ΠΈΡ задания Lemin. Он Π²ΠΎΠ·Π²Ρ€Π°Ρ‰Π°Π΅Ρ‚ JSON-ΠΎΡ‚Π²Π΅Ρ‚ с ΡƒΠΊΠ°Π·Π°Π½Π½Ρ‹ΠΌΠΈ значСниями: ΠΎΡ‚Π²Π΅Ρ‚ (answer) ΠΈ ΠΈΠ΄Π΅Π½Ρ‚ΠΈΡ„ΠΈΠΊΠ°Ρ‚ΠΎΡ€ задания (challenge_id). ```ruby result = client.lemin({ @@ -284,6 +344,9 @@ result = client.lemin({ ### Cloudflare Turnstile + +[ОписаниС ΠΌΠ΅Ρ‚ΠΎΠ΄Π° API.](https://2captcha.com/2captcha-api#turnstile) + Π˜ΡΠΏΠΎΠ»ΡŒΠ·ΡƒΠΉΡ‚Π΅ этот ΠΌΠ΅Ρ‚ΠΎΠ΄ для Ρ€Π΅ΡˆΠ΅Π½ΠΈΡ Π·Π°Π΄Π°Ρ‡ΠΈ Cloudflare Turnstile. Он Π²ΠΎΠ·Π²Ρ€Π°Ρ‰Π°Π΅Ρ‚ JSON с Ρ‚ΠΎΠΊΠ΅Π½ΠΎΠΌ. ```ruby @@ -294,6 +357,9 @@ result = client.turnstile({ ``` ### Amazon WAF + +[ОписаниС ΠΌΠ΅Ρ‚ΠΎΠ΄Π° API.](https://2captcha.com/2captcha-api#amazon-waf) + Π˜ΡΠΏΠΎΠ»ΡŒΠ·ΡƒΠΉΡ‚Π΅ этот ΠΌΠ΅Ρ‚ΠΎΠ΄ для Ρ€Π΅ΡˆΠ΅Π½ΠΈΡ Captcha Amazon WAF, Ρ‚Π°ΠΊΠΆΠ΅ извСстного ΠΊΠ°ΠΊ AWS WAF Captcha, ΠΊΠΎΡ‚ΠΎΡ€Ρ‹ΠΉ являСтся Ρ‡Π°ΡΡ‚ΡŒΡŽ ΠΈΠ½Ρ‚Π΅Π»Π»Π΅ΠΊΡ‚ΡƒΠ°Π»ΡŒΠ½ΠΎΠΉ Π·Π°Ρ‰ΠΈΡ‚Ρ‹ ΠΎΡ‚ ΡƒΠ³Ρ€ΠΎΠ· для Amazon AWS. Он Π²ΠΎΠ·Π²Ρ€Π°Ρ‰Π°Π΅Ρ‚ JSON с Ρ‚ΠΎΠΊΠ΅Π½ΠΎΠΌ. ```ruby @@ -307,27 +373,25 @@ result = client.amazon_waf({ }) ``` -### GeeTest v4 -Π˜ΡΠΏΠΎΠ»ΡŒΠ·ΡƒΠΉΡ‚Π΅ этот ΠΌΠ΅Ρ‚ΠΎΠ΄ для Ρ€Π΅ΡˆΠ΅Π½ΠΈΡ GeeTest v4. Он Π²ΠΎΠ·Π²Ρ€Π°Ρ‰Π°Π΅Ρ‚ ΠΎΡ‚Π²Π΅Ρ‚ Π² Ρ„ΠΎΡ€ΠΌΠ°Ρ‚Π΅ JSON. +### РаспознаваниС Π°ΡƒΠ΄ΠΈΠΎ -```ruby -result = client.geetest_v4({ - captcha_id: 'e392e1d7fd421dc63325744d5a2b9c73', - pageurl: 'https://www.site.com/page/' -}) -``` +[ОписаниС ΠΌΠ΅Ρ‚ΠΎΠ΄Π° API.](https://2captcha.com/2captcha-api#audio) + +Π­Ρ‚ΠΎΡ‚ ΠΌΠ΅Ρ‚ΠΎΠ΄ ΠΌΠΎΠΆΠ½ΠΎ ΠΈΡΠΏΠΎΠ»ΡŒΠ·ΠΎΠ²Π°Ρ‚ΡŒ ΠΊΠ°ΠΊ для Ρ€Π΅ΡˆΠ΅Π½ΠΈΡ Π°ΡƒΠ΄ΠΈΠΎ ΠΊΠ°ΠΏΡ‡ΠΈ, Ρ‚Π°ΠΊ ΠΈ для распознавания любой аудиозаписи. -### Audio -Π­Ρ‚ΠΎΡ‚ ΠΌΠ΅Ρ‚ΠΎΠ΄ ΠΌΠΎΠΆΠ½ΠΎ ΠΈΡΠΏΠΎΠ»ΡŒΠ·ΠΎΠ²Π°Ρ‚ΡŒ для Ρ€Π΅ΡˆΠ΅Π½ΠΈΡ Π°ΡƒΠ΄ΠΈΠΎ-ΠΊΠ°ΠΏΡ‡ΠΈ. +ΠŸΠΎΠ΄Π΄Π΅Ρ€ΠΆΠΈΠ²Π°Π΅ΠΌΡ‹Π΅ языки: "en", "ru", "de", "el", "pt", "fr". ```ruby result = client.audio({ - audio: 'path/to/audio.jpg', + audio: 'path/to/audio.mp3', lang: "en" }) ``` ### CyberSiARA + +[ОписаниС ΠΌΠ΅Ρ‚ΠΎΠ΄Π° API.](https://2captcha.com/2captcha-api#cybersiara) + ΠœΠ΅Ρ‚ΠΎΠ΄ Ρ€Π΅ΡˆΠ΅Π½ΠΈΡ CyberSiARA. Он Π²ΠΎΠ·Π²Ρ€Π°Ρ‰Π°Π΅Ρ‚ Ρ‚ΠΎΠΊΠ΅Π½ для ΠΎΠ±Ρ…ΠΎΠ΄Π° ΠΊΠ°ΠΏΡ‡ΠΈ. ```ruby @@ -338,8 +402,13 @@ result = client.cyber_siara({ ``` ### DataDome -ΠœΠ΅Ρ‚ΠΎΠ΄ Ρ€Π΅ΡˆΠ΅Π½ΠΈΡ DataDome Π²Π΅Ρ€Π½Π΅Ρ‚ Ρ‚ΠΎΠΊΠ΅Π½ для ΠΎΠ±Ρ…ΠΎΠ΄Π° ΠΊΠ°ΠΏΡ‡ΠΈ. -Π§Ρ‚ΠΎΠ±Ρ‹ Ρ€Π΅ΡˆΠΈΡ‚ΡŒ ΠΊΠ°ΠΏΡ‡Ρƒ DataDome Π²Ρ‹ Π΄ΠΎΠ»ΠΆΠ½Ρ‹ ΠΎΠ±ΡΠ·Π°Ρ‚Π΅Π»ΡŒΠ½ΠΎ ΠΈΡΠΏΠΎΠ»ΡŒΠ·ΠΎΠ²Π°Ρ‚ΡŒ прокси. + +[ОписаниС ΠΌΠ΅Ρ‚ΠΎΠ΄Π° API.](https://2captcha.com/2captcha-api#datadome) + +ΠœΠ΅Ρ‚ΠΎΠ΄ Ρ€Π΅ΡˆΠ΅Π½ΠΈΡ DataDome Π²Π΅Ρ€Π½Π΅Ρ‚ `cookies` для ΠΎΠ±Ρ…ΠΎΠ΄Π° ΠΊΠ°ΠΏΡ‡ΠΈ. + +> [!IMPORTANT] +> Π§Ρ‚ΠΎΠ±Ρ‹ Ρ€Π΅ΡˆΠΈΡ‚ΡŒ ΠΊΠ°ΠΏΡ‡Ρƒ DataDome Π²Ρ‹ Π΄ΠΎΠ»ΠΆΠ½Ρ‹ ΠΎΠ±ΡΠ·Π°Ρ‚Π΅Π»ΡŒΠ½ΠΎ ΠΈΡΠΏΠΎΠ»ΡŒΠ·ΠΎΠ²Π°Ρ‚ΡŒ прокси. РСкомСндуСтся ΠΈΡΠΏΠΎΠ»ΡŒΠ·ΠΎΠ²Π°Ρ‚ΡŒ [Ρ€Π΅Π·ΠΈΠ΄Π΅Π½Ρ‚Π½Ρ‹Π΅ прокси]. ```ruby result = client.data_dome({ @@ -352,6 +421,9 @@ result = client.data_dome({ ### MTCaptcha + +[ОписаниС ΠΌΠ΅Ρ‚ΠΎΠ΄Π° API.](https://2captcha.com/2captcha-api#mtcaptcha) + ΠœΠ΅Ρ‚ΠΎΠ΄ Ρ€Π΅ΡˆΠ΅Π½ΠΈΡ MTCaptcha. Он Π²ΠΎΠ·Π²Ρ€Π°Ρ‰Π°Π΅Ρ‚ Ρ‚ΠΎΠΊΠ΅Π½ для ΠΎΠ±Ρ…ΠΎΠ΄Π° ΠΊΠ°ΠΏΡ‡ΠΈ. ```ruby @@ -363,8 +435,14 @@ result = client.mt_captcha({ ### Friendly captcha + +[ОписаниС ΠΌΠ΅Ρ‚ΠΎΠ΄Π° API.](https://2captcha.com/2captcha-api#friendly-captcha) + ΠœΠ΅Ρ‚ΠΎΠ΄ Ρ€Π΅ΡˆΠ΅Π½ΠΈΡ Friendly captcha. Он Π²ΠΎΠ·Π²Ρ€Π°Ρ‰Π°Π΅Ρ‚ Ρ‚ΠΎΠΊΠ΅Π½ для ΠΎΠ±Ρ…ΠΎΠ΄Π° ΠΊΠ°ΠΏΡ‡ΠΈ. +> [!IMPORTANT] +> Π§Ρ‚ΠΎΠ±Ρ‹ ΡƒΡΠΏΠ΅ΡˆΠ½ΠΎ ΠΈΡΠΏΠΎΠ»ΡŒΠ·ΠΎΠ²Π°Ρ‚ΡŒ ΠΏΠΎΠ»ΡƒΡ‡Π΅Π½Π½Ρ‹ΠΉ Ρ‚ΠΎΠΊΠ΅Π½, Π²ΠΈΠ΄ΠΆΠ΅Ρ‚ ΠΊΠ°ΠΏΡ‡ΠΈ Π½Π΅ Π΄ΠΎΠ»ΠΆΠ΅Π½ Π±Ρ‹Ρ‚ΡŒ Π·Π°Π³Ρ€ΡƒΠΆΠ΅Π½ Π½Π° страницС. Для этого Π½Π΅ΠΎΠ±Ρ…ΠΎΠ΄ΠΈΠΌΠΎ ΠΏΡ€Π΅Ρ€Π²Π°Ρ‚ΡŒ запрос ΠΊ `/friendlycaptcha/...module.min.js` Π½Π° страницС. Если Π²ΠΈΠ΄ΠΆΠ΅Ρ‚ ΠΊΠ°ΠΏΡ‡ΠΈ ΡƒΠΆΠ΅ Π·Π°Π³Ρ€ΡƒΠΆΠ΅Π½ Π½Π° страницС, сущСствуСт высокая Π²Π΅Ρ€ΠΎΡΡ‚Π½ΠΎΡΡ‚ΡŒ, Ρ‡Ρ‚ΠΎ ΠΏΠΎΠ»ΡƒΡ‡Π΅Π½Π½Ρ‹ΠΉ Ρ‚ΠΎΠΊΠ΅Π½ Π½Π΅ Π±ΡƒΠ΄Π΅Ρ‚ Ρ€Π°Π±ΠΎΡ‚Π°Ρ‚ΡŒ. + ```ruby result = client.friendly({ pageurl: "https://example.com", @@ -372,8 +450,10 @@ result = client.friendly({ }) ``` - ### Cutcaptcha + +[ОписаниС ΠΌΠ΅Ρ‚ΠΎΠ΄Π° API.](https://2captcha.com/2captcha-api#cutcaptcha) + ΠœΠ΅Ρ‚ΠΎΠ΄ Ρ€Π΅ΡˆΠ΅Π½ΠΈΡ Cutcaptcha. Он Π²ΠΎΠ·Π²Ρ€Π°Ρ‰Π°Π΅Ρ‚ Ρ‚ΠΎΠΊΠ΅Π½ для ΠΎΠ±Ρ…ΠΎΠ΄Π° ΠΊΠ°ΠΏΡ‡ΠΈ. ```ruby @@ -384,6 +464,31 @@ result = client.cutcaptcha({ }) ``` +### Tencent + +[ОписаниС ΠΌΠ΅Ρ‚ΠΎΠ΄Π° API.](https://2captcha.com/2captcha-api#tencent) + +ΠžΡΠ½ΠΎΠ²Π°Π½Π½Ρ‹ΠΉ Π½Π° Ρ‚ΠΎΠΊΠ΅Π½Π°Ρ… ΠΌΠ΅Ρ‚ΠΎΠ΄ Π°Π²Ρ‚ΠΎΠΌΠ°Ρ‚ΠΈΠ·ΠΈΡ€ΠΎΠ²Π°Π½Π½ΠΎΠ³ΠΎ Ρ€Π΅ΡˆΠ΅Π½ΠΈΡ ΠΊΠ°ΠΏΡ‡ΠΈ Tencent. +```ruby +result = client.tencent({ + app_id: "197326679", + pageurl: "https://mysite.com/page/with/tencent" +}) +``` + +### atbCAPTCHA + +[ОписаниС ΠΌΠ΅Ρ‚ΠΎΠ΄Π° API.](https://2captcha.com/2captcha-api#atb-captcha) + +ΠžΡΠ½ΠΎΠ²Π°Π½Π½Ρ‹ΠΉ Π½Π° Ρ‚ΠΎΠΊΠ΅Π½Π°Ρ… ΠΌΠ΅Ρ‚ΠΎΠ΄ Π°Π²Ρ‚ΠΎΠΌΠ°Ρ‚ΠΈΠ·ΠΈΡ€ΠΎΠ²Π°Π½Π½ΠΎΠ³ΠΎ Ρ€Π΅ΡˆΠ΅Π½ΠΈΡ ΠΊΠ°ΠΏΡ‡ΠΈ atbCAPTCHA. +```ruby +result = client.atb_captcha({ + app_id: "197326679", + api_server: "api.atb_captcha.com", + pageurl: "https://mysite.com/page/with/atb_captcha" +}) +``` + ## Π”Ρ€ΡƒΠ³ΠΈΠ΅ ΠΌΠ΅Ρ‚ΠΎΠ΄Ρ‹ @@ -409,6 +514,9 @@ time.sleep(20) result = client.get_result(captcha_id) ``` ### Баланс + +[ОписаниС ΠΌΠ΅Ρ‚ΠΎΠ΄Π° API.](https://2captcha.com/2captcha-api#additional-methods) + Π˜ΡΠΏΠΎΠ»ΡŒΠ·ΡƒΠΉΡ‚Π΅ этот ΠΌΠ΅Ρ‚ΠΎΠ΄, Ρ‡Ρ‚ΠΎΠ±Ρ‹ ΠΏΠΎΡΠΌΠΎΡ‚Ρ€Π΅Ρ‚ΡŒ баланс Π² вашСм Π°ΠΊΠΊΠ°ΡƒΠ½Ρ‚Π΅. ```ruby @@ -416,6 +524,9 @@ balance = client.get_balance ``` ### ΠžΡ‚Ρ‡Π΅Ρ‚ + +[ОписаниС ΠΌΠ΅Ρ‚ΠΎΠ΄Π° API.](https://2captcha.com/2captcha-api#complain) + Π˜ΡΠΏΠΎΠ»ΡŒΠ·ΡƒΠΉΡ‚Π΅ этот ΠΌΠ΅Ρ‚ΠΎΠ΄ для ΠΎΡ‚ΠΏΡ€Π°Π²ΠΊΠΈ ΠΎΡ‚Ρ‡Π΅Ρ‚Π° ΠΎ ΠΏΡ€Π°Π²ΠΈΠ»ΡŒΠ½ΠΎΠΌ ΠΈΠ»ΠΈ Π½Π΅ΠΏΡ€Π°Π²ΠΈΠ»ΡŒΠ½ΠΎΠΌ ΠΎΡ‚Π²Π΅Ρ‚Π΅ Π½Π° ΠΊΠ°ΠΏΡ‡Ρƒ. ```ruby @@ -462,6 +573,10 @@ result = client.recaptcha_v2({ end ``` +## ΠŸΡ€ΠΈΠΌΠ΅Ρ€Ρ‹ + +ΠŸΡ€ΠΈΠΌΠ΅Ρ€Ρ‹ Ρ€Π΅ΡˆΠ΅Π½ΠΈΡ ΠΏΠΎΠ΄Π΄Π΅Ρ€ΠΆΠΈΠ²Π°Π΅ΠΌΡ‹Ρ… Ρ‚ΠΈΠΏΠΎΠ² ΠΊΠ°ΠΏΡ‡ΠΈ находятся Π² Π΄ΠΈΡ€Π΅ΠΊΡ‚ΠΎΡ€ΠΈΠΈ [examples]. + ## Π‘Π²ΡΠΆΠΈΡ‚Π΅ΡΡŒ с Π½Π°ΠΌΠΈ @@ -484,4 +599,6 @@ result = client.recaptcha_v2({ [2Captcha]: https://2captcha.com/ [ΠšΡƒΠΏΠΈΡ‚ΡŒ рСзидСнтскиС прокси]: https://2captcha.com/proxy/residential-proxies -[Быстрый старт]: https://2captcha.com/proxy?openAddTrafficModal=true \ No newline at end of file +[Быстрый старт]: https://2captcha.com/proxy?openAddTrafficModal=true +[Ρ€Π΅Π·ΠΈΠ΄Π΅Π½Ρ‚Π½Ρ‹Π΅ прокси]: https://2captcha.com/proxy/residential-proxies +[examples]: ./examples/ \ No newline at end of file diff --git a/api_2captcha.gemspec b/api_2captcha.gemspec index 564302f..ac762e7 100644 --- a/api_2captcha.gemspec +++ b/api_2captcha.gemspec @@ -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. diff --git a/examples/atb_captcha_example.rb b/examples/atb_captcha_example.rb new file mode 100644 index 0000000..725ede9 --- /dev/null +++ b/examples/atb_captcha_example.rb @@ -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}" \ No newline at end of file diff --git a/examples/audio_example.rb b/examples/audio_example.rb new file mode 100644 index 0000000..1a7b103 --- /dev/null +++ b/examples/audio_example.rb @@ -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}" \ No newline at end of file diff --git a/examples/grid_captcha_example.rb b/examples/grid_captcha_example.rb new file mode 100644 index 0000000..20c2646 --- /dev/null +++ b/examples/grid_captcha_example.rb @@ -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}" \ No newline at end of file diff --git a/examples/media/example.mp3 b/examples/media/example.mp3 new file mode 100644 index 0000000..c063a6a Binary files /dev/null and b/examples/media/example.mp3 differ diff --git a/examples/media/normal_2.jpg b/examples/media/normal_2.jpg new file mode 100644 index 0000000..a1f5035 Binary files /dev/null and b/examples/media/normal_2.jpg differ diff --git a/examples/media/recaptchaGrid4x4.jpg b/examples/media/recaptchaGrid4x4.jpg new file mode 100644 index 0000000..05aa85c Binary files /dev/null and b/examples/media/recaptchaGrid4x4.jpg differ diff --git a/examples/media/recaptchaGridImginstructions4x4.jpg b/examples/media/recaptchaGridImginstructions4x4.jpg new file mode 100644 index 0000000..6c99556 Binary files /dev/null and b/examples/media/recaptchaGridImginstructions4x4.jpg differ diff --git a/examples/normal_captcha_example.rb b/examples/normal_captcha_example.rb new file mode 100644 index 0000000..ee3a816 --- /dev/null +++ b/examples/normal_captcha_example.rb @@ -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}" \ No newline at end of file diff --git a/examples/recaptcha_v2_example.rb b/examples/recaptcha_v2_example.rb new file mode 100644 index 0000000..fe1838d --- /dev/null +++ b/examples/recaptcha_v2_example.rb @@ -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}" \ No newline at end of file diff --git a/examples/tencent_example.rb b/examples/tencent_example.rb new file mode 100644 index 0000000..d46a489 --- /dev/null +++ b/examples/tencent_example.rb @@ -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}" \ No newline at end of file diff --git a/lib/api_2captcha/client.rb b/lib/api_2captcha/client.rb index d3a03a0..a8e624b 100644 --- a/lib/api_2captcha/client.rb +++ b/lib/api_2captcha/client.rb @@ -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( @@ -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