From 5a09a642d3d68b77238c7e689a826ca15ddacb78 Mon Sep 17 00:00:00 2001 From: Maxim S Date: Fri, 14 Jun 2024 12:15:58 +0200 Subject: [PATCH 1/4] - Added language 'fr' to audio in README.md - Added a description of the pagedata and useragent parameters to the turnstile method in solver.py - Updated the description in the documentation of the capy method in solver.py - Added tencent to the list of supported proxies in README.md Signed-off-by: Maxim S --- README.md | 4 ++-- examples/recaptcha_v2_options.py | 12 ++++++------ twocaptcha/solver.py | 7 ++++++- 3 files changed, 14 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index a595760..cb17190 100644 --- a/README.md +++ b/README.md @@ -111,7 +111,7 @@ result = solver.normal('https://site-with-captcha.com/path/to/captcha.jpg', para ### Audio Captcha To bypass an audio captcha (mp3 formats only) use the following method. -You must provide the language as `lang = 'en'`. Supported languages are "en", "ru", "de", "el", "pt". +You must provide the language as `lang = 'en'`. Supported languages are "en", "ru", "de", "el", "pt", "fr". ```python result = solver.audio('path/to/captcha.mp3', lang = 'lang', param1=..., ...) @@ -357,7 +357,7 @@ except TimeoutException as e: ### Proxies You can pass your proxy as an additional argument for methods: recaptcha, funcaptcha, geetest, geetest v4, hcaptcha, -keycaptcha, capy puzzle, lemin, atbcaptcha, turnstile, amazon waf, mtcaptcha, friendly captcha, cutcaptcha. +keycaptcha, capy puzzle, lemin, atbcaptcha, turnstile, tencent, amazon waf, mtcaptcha, friendly captcha, cutcaptcha. The proxy will be forwarded to the API to solve the captcha. We have our own proxies that we can offer you. [Buy residential proxies] for avoid restrictions and blocks. [Quick start]. diff --git a/examples/recaptcha_v2_options.py b/examples/recaptcha_v2_options.py index bce7843..a803edb 100644 --- a/examples/recaptcha_v2_options.py +++ b/examples/recaptcha_v2_options.py @@ -31,12 +31,12 @@ sitekey='6LdO5_IbAAAAAAeVBL9TClS19NUTt5wswEb3Q7C5', url='https://2captcha.com/demo/recaptcha-v2-invisible', invisible=1, - enterprise=0 -# proxy={ -# 'type': 'HTTPS', -# 'uri': 'login:password@IP_address:PORT' -# } - ) + enterprise=0, + # datas="bM-8CwwOmqyYCLWatmabvfyYR97ytF95tgu...", + # proxy={'type': 'HTTPS', + # 'uri': 'login:password@IP_address:PORT' + # } + ) except Exception as e: sys.exit(e) diff --git a/twocaptcha/solver.py b/twocaptcha/solver.py index 928eaa2..038751b 100755 --- a/twocaptcha/solver.py +++ b/twocaptcha/solver.py @@ -361,7 +361,7 @@ def capy(self, sitekey, url, **kwargs): api_server : str, optional The domain part of script URL you found on page. Default value: https://jp.api.capy.me/. version : str, optional - The version of captcha task: puzzle (assemble a puzzle) or avatar (drag an object). Default: puzzle. + The version of captcha task: "puzzle" (assemble a puzzle) or "avatar" (drag an object). Default: puzzle. softId : int, optional ID of software developer. Developers who integrated their software with 2Captcha get reward: 10% of spendings of their software users. @@ -643,11 +643,16 @@ def turnstile(self, sitekey, url, **kwargs): Value of sitekey parameter you found on page. url : str Full URL of the page where you see the captcha. + useragent : str + User-Agent of your browser. Must match the User-Agent you use to access the site. + Use only modern browsers released within the last 6 months. action : str. optional Value of optional action parameter you found on page, can be defined in data-action attribute or passed to turnstile.render call. data : str, optional The value of cData passed to turnstile.render call. Also can be defined in data-cdata attribute. + pagedata : str, optional + The value of the chlPageData parameter when calling turnstile.render. softId : int, optional ID of software developer. Developers who integrated their software with 2Captcha get reward: 10% of spendings of their software users. From d98ac4997fc35de86fd92b39ecdbd97de0bdc80b Mon Sep 17 00:00:00 2001 From: dzmitry-duboyski Date: Fri, 14 Jun 2024 14:52:07 +0400 Subject: [PATCH 2/4] v1.2.6 --- twocaptcha/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/twocaptcha/__init__.py b/twocaptcha/__init__.py index 2e35489..47db6ef 100644 --- a/twocaptcha/__init__.py +++ b/twocaptcha/__init__.py @@ -12,4 +12,4 @@ """ __author__ = '2captcha' -__version__ = '1.2.5' +__version__ = '1.2.6' From 74aab1d7a124cf27a85090d83414f1f5e42a6091 Mon Sep 17 00:00:00 2001 From: dzmitry-duboyski Date: Mon, 17 Jun 2024 13:29:52 +0400 Subject: [PATCH 3/4] Add examples to README.md --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index cb17190..4f40712 100644 --- a/README.md +++ b/README.md @@ -37,6 +37,7 @@ The easiest way to quickly integrate the 2Captcha captcha-solving service into y - [Error handling](#error-handling) - [Proxies](#proxies) - [Async calls](#async-calls) + - [Examples](#examples) ## Installation @@ -388,6 +389,8 @@ async def captchaSolver(image): captcha_result = asyncio.run(captchaSolver(image)) ``` +## Examples +Examples of solving all supported captcha types are located in the [examples] directory. [2Captcha]: https://2captcha.com/ @@ -399,3 +402,4 @@ captcha_result = asyncio.run(captchaSolver(image)) [asyncio]: https://docs.python.org/3/library/asyncio.html [Buy residential proxies]: https://2captcha.com/proxy/residential-proxies [Quick start]: https://2captcha.com/proxy?openAddTrafficModal=true +[examples]: ./examples From ca60a354d347bf9ce8160f6a7ac36b0031fd252f Mon Sep 17 00:00:00 2001 From: Maxim S Date: Mon, 17 Jun 2024 11:31:53 +0200 Subject: [PATCH 4/4] - Added a description for the send method and an example of manually sending a captcha for send to README.md - Added description of the method parameter for send() in solver.py Signed-off-by: Maxim S --- README.md | 17 ++++++++++++++++- twocaptcha/solver.py | 4 +++- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index cb17190..6429075 100644 --- a/README.md +++ b/README.md @@ -309,7 +309,11 @@ result = solver.tencent(app_id="197326679", ## Other methods ### send / get_result -These methods can be used for manual captcha submission and answer polling. +These methods can be used for manual captcha submission and answer polling. The `send()` method supports sending any captcha +type, to specify the captcha type you must send value `method` manually, for example `method='hcaptcha'` for solving hCapthca. +You can find the value of the `method` parameter in the [API documentation](https://2captcha.com/2captcha-api). + +Example for solving Normal captcha manually: ```python import time . . . . . @@ -318,6 +322,17 @@ import time id = solver.send(file='path/to/captcha.jpg') time.sleep(20) +code = solver.get_result(id) +``` +Example for solving hCaptcha manually: +```python +import time +. . . . . +id = solver.send(sitekey='41b778e7-8f20-45cc-a804-1f1ebb45c579', + url='https://2captcha.com/demo/hcaptcha?difficulty=easy', + method='hcaptcha') +print(id) +time.sleep(20) code = solver.get_result(id) ``` diff --git a/twocaptcha/solver.py b/twocaptcha/solver.py index 038751b..e40f0ff 100755 --- a/twocaptcha/solver.py +++ b/twocaptcha/solver.py @@ -879,8 +879,10 @@ def send(self, **kwargs): Parameters _________ + method : str + The name of the method must be found in the documentation https://2captcha.com/2captcha-api kwargs: dict - + All captcha params Returns """