From 65adf1e62382c7de488d4cac4b28338bf7418050 Mon Sep 17 00:00:00 2001 From: Maxim S Date: Mon, 24 Jun 2024 18:05:54 +0200 Subject: [PATCH 1/3] - Added links to balance and report methods. - Added text to the Error handling block. - Added a block of Userful articles. Signed-off-by: Maxim S --- README.md | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index cb27eb8..3690c76 100644 --- a/README.md +++ b/README.md @@ -355,6 +355,11 @@ result = solver.mtcaptcha(sitekey='MTPublic-KzqLY1cKH', [API method description.](https://2captcha.com/2captcha-api#friendly-captcha) Friendly Captcha solving method. Returns a token. + + + +> **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. + ```python result = solver.friendly_captcha(sitekey='FCMGEMUD2KTDSQ5H', url='https://friendlycaptcha.com/demo', @@ -415,12 +420,18 @@ code = solver.get_result(id) ``` ### balance + +[API method description.](https://2captcha.com/2captcha-api#additional-methods) + Use this method to get your account's balance ```python balance = solver.balance() ``` ### report + +[API method description.](https://2captcha.com/2captcha-api#complain) + Use this method to report good or bad captcha answers. ```python solver.report(id, True) # captcha solved correctly @@ -428,7 +439,8 @@ solver.report(id, False) # captcha solved incorrectly ``` ### Error handling -In case of an error, the captcha solver throws an exception. It's important to properly handle these cases. We recommend using `try except` to handle exceptions. +In case of an error, the captcha solver throws an exception. It's important to properly handle these cases. We recommend using `try except` to handle exceptions. +The list of all errors can be found in the [API documentation](https://2captcha.com/2captcha-api#list-of-inphp-errors). ```python try: result = solver.text('If tomorrow is Saturday, what day is today?') @@ -482,9 +494,14 @@ async def captchaSolver(image): captcha_result = asyncio.run(captchaSolver(image)) ``` -## Examples +### Examples Examples of solving all supported captcha types are located in the [examples] directory. +## Useful articles + +- Amazon captcha solver: Code example for bypassing the [Amazon captcha](https://2captcha.com/blog/amazon-captcha-solving) +- [Captcha bypass in Selenium](https://2captcha.com/blog/captcha-bypass-in-selenium) + [2Captcha]: https://2captcha.com/ [2captcha software catalog]: https://2captcha.com/software From f8f91ecc8bb7310d1550db17a2e49c4e8dc6d591 Mon Sep 17 00:00:00 2001 From: Dima Dub <38065632+dzmitry-duboyski@users.noreply.github.com> Date: Wed, 26 Jun 2024 10:39:16 +0000 Subject: [PATCH 2/3] Update important blocks --- README.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 3690c76..35c8b8c 100644 --- a/README.md +++ b/README.md @@ -83,7 +83,9 @@ solver = TwoCaptcha(**config) | recaptchaTimeout | 600 | Polling timeout for reCAPTCHA in seconds. Defines how long the module tries to get the answer from the `res.php` API endpoint | | pollingInterval | 10 | Interval in seconds between requests to the `res.php` API endpoint. Setting values less than 5 seconds is not recommended | -> **IMPORTANT:** Once `callback` is defined for the `TwoCaptcha` 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 the `TwoCaptcha` 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 @@ -356,9 +358,8 @@ result = solver.mtcaptcha(sitekey='MTPublic-KzqLY1cKH', Friendly Captcha solving method. Returns a token. - - -> **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. +> [!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. ```python result = solver.friendly_captcha(sitekey='FCMGEMUD2KTDSQ5H', From c65b51f6762dcd008af379d6d7330e3d9b7f0148 Mon Sep 17 00:00:00 2001 From: Dima Dub <38065632+dzmitry-duboyski@users.noreply.github.com> Date: Wed, 26 Jun 2024 10:47:20 +0000 Subject: [PATCH 3/3] Update README.md --- README.md | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 35c8b8c..76585f2 100644 --- a/README.md +++ b/README.md @@ -34,10 +34,11 @@ The easiest way to quickly integrate the [2Captcha] captcha-solving service into - [send / get_result](#send--get_result) - [balance](#balance) - [report](#report) - - [Error handling](#error-handling) - - [Proxies](#proxies) - - [Async calls](#async-calls) + - [Error handling](#error-handling) + - [Proxies](#proxies) + - [Async calls](#async-calls) - [Examples](#examples) + - [Useful articles](#useful-articles) ## Installation @@ -439,7 +440,7 @@ solver.report(id, True) # captcha solved correctly solver.report(id, False) # captcha solved incorrectly ``` -### Error handling +## Error handling In case of an error, the captcha solver throws an exception. It's important to properly handle these cases. We recommend using `try except` to handle exceptions. The list of all errors can be found in the [API documentation](https://2captcha.com/2captcha-api#list-of-inphp-errors). ```python @@ -460,7 +461,7 @@ except TimeoutException as e: ``` -### Proxies +## Proxies You can pass your proxy as an additional argument for the following methods: recaptcha, funcaptcha, geetest, geetest v4, hcaptcha, keycaptcha, capy puzzle, lemin, atbcaptcha, turnstile, amazon waf, mtcaptcha, friendly captcha, cutcaptcha. @@ -476,7 +477,7 @@ proxy={ } ``` -### Async calls +## Async calls You can also make async calls with [asyncio], for example: ```python @@ -495,7 +496,7 @@ async def captchaSolver(image): captcha_result = asyncio.run(captchaSolver(image)) ``` -### Examples +## Examples Examples of solving all supported captcha types are located in the [examples] directory. ## Useful articles