From 173361c693df3957155bce122ee1610d67a8efd6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 3 Feb 2025 17:18:58 +0000 Subject: [PATCH 01/10] Update isort requirement from ==5.* to ==6.* Updates the requirements on [isort](https://github.com/pycqa/isort) to permit the latest version. - [Release notes](https://github.com/pycqa/isort/releases) - [Changelog](https://github.com/PyCQA/isort/blob/main/CHANGELOG.md) - [Commits](https://github.com/pycqa/isort/compare/5.0.0...6.0.0) --- updated-dependencies: - dependency-name: isort dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- requirements.style.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.style.txt b/requirements.style.txt index 514ac380..cab6466d 100644 --- a/requirements.style.txt +++ b/requirements.style.txt @@ -1,4 +1,4 @@ # codestyle -isort==5.* +isort==6.* black==24.10.0 autoflake==2.* From bc43928d5d373d69adeb2168138a2146fcfa2d87 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 3 Feb 2025 17:42:43 +0000 Subject: [PATCH 02/10] Bump black from 24.10.0 to 25.1.0 Bumps [black](https://github.com/psf/black) from 24.10.0 to 25.1.0. - [Release notes](https://github.com/psf/black/releases) - [Changelog](https://github.com/psf/black/blob/main/CHANGES.md) - [Commits](https://github.com/psf/black/compare/24.10.0...25.1.0) --- updated-dependencies: - dependency-name: black dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- requirements.style.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.style.txt b/requirements.style.txt index cab6466d..8fbb0b9b 100644 --- a/requirements.style.txt +++ b/requirements.style.txt @@ -1,4 +1,4 @@ # codestyle isort==6.* -black==24.10.0 +black==25.1.0 autoflake==2.* From 6f85df5a8ac10e66d8b75440cc5847e61cbb48e0 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Wed, 12 Feb 2025 14:44:16 +0300 Subject: [PATCH 03/10] Update myst-parser from 4.0.0 to 4.0.1 --- docs/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/requirements.txt b/docs/requirements.txt index 1efdc651..28ceeda2 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -1,6 +1,6 @@ sphinx==8.1.3 pallets_sphinx_themes==2.3.0 -myst-parser==4.0.0 +myst-parser==4.0.1 enum-tools[sphinx]==0.12.0 requests>=2.32.0 # not directly required, pinned by Snyk to avoid a vulnerability urllib3>=2.2.2 # not directly required, pinned by Snyk to avoid a vulnerability From 76f555b060eb0f5bd306e1dbc1ede6a8ede091f9 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Sat, 22 Feb 2025 03:19:26 +0300 Subject: [PATCH 04/10] Update sphinx from 8.1.3 to 8.2.1 --- docs/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/requirements.txt b/docs/requirements.txt index 28ceeda2..3e1cdaaf 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -1,4 +1,4 @@ -sphinx==8.1.3 +sphinx==8.2.1 pallets_sphinx_themes==2.3.0 myst-parser==4.0.1 enum-tools[sphinx]==0.12.0 From 8373b4a85871c2b92392199328cb905fb8928780 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Mon, 3 Mar 2025 01:22:38 +0300 Subject: [PATCH 05/10] Update sphinx from 8.2.1 to 8.3.0 --- docs/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/requirements.txt b/docs/requirements.txt index 3e1cdaaf..516c08c2 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -1,4 +1,4 @@ -sphinx==8.2.1 +sphinx==8.3.0 pallets_sphinx_themes==2.3.0 myst-parser==4.0.1 enum-tools[sphinx]==0.12.0 From 3ebf270406b6b5afe9d7ee1e685a6a4540e13fd9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 3 Mar 2025 17:13:02 +0000 Subject: [PATCH 06/10] Bump sphinx from 8.2.1 to 8.2.3 Bumps [sphinx](https://github.com/sphinx-doc/sphinx) from 8.2.1 to 8.2.3. - [Release notes](https://github.com/sphinx-doc/sphinx/releases) - [Changelog](https://github.com/sphinx-doc/sphinx/blob/master/CHANGES.rst) - [Commits](https://github.com/sphinx-doc/sphinx/compare/v8.2.1...v8.2.3) --- updated-dependencies: - dependency-name: sphinx dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- docs/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/requirements.txt b/docs/requirements.txt index 3e1cdaaf..e9ccc070 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -1,4 +1,4 @@ -sphinx==8.2.1 +sphinx==8.2.3 pallets_sphinx_themes==2.3.0 myst-parser==4.0.1 enum-tools[sphinx]==0.12.0 From 2ede94bdacd92f49a37c82f9e6e48764026c7bb3 Mon Sep 17 00:00:00 2001 From: Andrei Date: Fri, 7 Mar 2025 23:22:24 +0300 Subject: [PATCH 07/10] v6.3.2 --- src/python_rucaptcha/__version__.py | 2 +- src/python_rucaptcha/atb_captcha.py | 1 + src/python_rucaptcha/control.py | 5 ++ src/python_rucaptcha/core/enums.py | 5 ++ src/python_rucaptcha/prosopo.py | 108 ++++++++++++++++++++++++++++ src/python_rucaptcha/tencent.py | 1 + 6 files changed, 121 insertions(+), 1 deletion(-) create mode 100644 src/python_rucaptcha/prosopo.py diff --git a/src/python_rucaptcha/__version__.py b/src/python_rucaptcha/__version__.py index 221cd932..123dd5c0 100644 --- a/src/python_rucaptcha/__version__.py +++ b/src/python_rucaptcha/__version__.py @@ -1 +1 @@ -__version__ = "6.3.1" +__version__ = "6.3.2" diff --git a/src/python_rucaptcha/atb_captcha.py b/src/python_rucaptcha/atb_captcha.py index d3efd0a6..42fd0607 100644 --- a/src/python_rucaptcha/atb_captcha.py +++ b/src/python_rucaptcha/atb_captcha.py @@ -71,6 +71,7 @@ def __init__( Notes: https://rucaptcha.com/api-docs/atb-captcha + https://2captcha.com/api-docs/atb-captcha """ super().__init__(method=method, *args, **kwargs) diff --git a/src/python_rucaptcha/control.py b/src/python_rucaptcha/control.py index 7e635ac9..040b5951 100644 --- a/src/python_rucaptcha/control.py +++ b/src/python_rucaptcha/control.py @@ -55,10 +55,15 @@ def __init__( Notes: https://rucaptcha.com/api-docs/get-balance + https://rucaptcha.com/api-docs/report-correct + https://rucaptcha.com/api-docs/report-incorrect + https://2captcha.com/api-docs/get-balance + https://2captcha.com/api-docs/report-correct + https://2captcha.com/api-docs/report-incorrect """ diff --git a/src/python_rucaptcha/core/enums.py b/src/python_rucaptcha/core/enums.py index cdf9a34a..9d1aa9a1 100644 --- a/src/python_rucaptcha/core/enums.py +++ b/src/python_rucaptcha/core/enums.py @@ -159,3 +159,8 @@ class TencentEnm(str, MyEnum): class atbCaptchaEnm(str, MyEnum): AtbCaptchaTask = "AtbCaptchaTask" AtbCaptchaTaskProxyless = "AtbCaptchaTaskProxyless" + + +class ProsopoEnm(str, MyEnum): + ProsopoTask = "ProsopoTask" + ProsopoTaskProxyless = "ProsopoTaskProxyless " diff --git a/src/python_rucaptcha/prosopo.py b/src/python_rucaptcha/prosopo.py new file mode 100644 index 00000000..2c055b94 --- /dev/null +++ b/src/python_rucaptcha/prosopo.py @@ -0,0 +1,108 @@ +from typing import Union + +from .core.base import BaseCaptcha +from .core.enums import ProsopoEnm + + +class Prosopo(BaseCaptcha): + def __init__( + self, + websiteURL: str, + websiteKey: str, + method: Union[str, ProsopoEnm] = ProsopoEnm.ProsopoTaskProxyless, + *args, + **kwargs, + ): + """ + The class is used to work with Prosopo. + + Args: + rucaptcha_key: User API key + websiteURL: The full URL of target web page where the captcha is loaded. + We do not open the page, not a problem if it is available + only for authenticated users + websiteKey: The value of `siteKey` parameter found on the page. + method: Captcha type + + Examples: + >>> Prosopo(rucaptcha_key="aa9011f31111181111168611f1151122", + ... websiteURL="https://www.example.com/", + ... websiteKey="5EPQoMZEDc5LpN7gtxMMzYPTzA6UeWqL2stk1rso9gy4Ahqt", + ... method=ProsopoEnm.ProsopoTaskProxyless.value, + ... ).captcha_handler() + { + "errorId":0, + "status":"ready", + "solution":{ + "token": "0x00016c68747470733950547a4136", + }, + "cost":"0.00299", + "ip":"1.2.3.4", + "createTime":1692863536, + "endTime":1692863556, + "solveCount":1, + "taskId":75190409731 + } + + >>> await Prosopo(rucaptcha_key="aa9011f31111181111168611f1151122", + ... websiteURL="https://www.example.com/", + ... websiteKey="5EPQoMZEDc5LpN7gtxMMzYPTzA6UeWqL2stk1rso9gy4Ahqt", + ... method=ProsopoEnm.ProsopoTaskProxyless.value, + ... ).aio_captcha_handler() + { + "errorId":0, + "status":"ready", + "solution":{ + "token": "0x00016c68747470733950547a4136", + }, + "cost":"0.00299", + "ip":"1.2.3.4", + "createTime":1692863536, + "endTime":1692863556, + "solveCount":1, + "taskId":75190409731 + } + + Returns: + Dict with full server response + + Notes: + https://rucaptcha.com/api-docs/prosopo-procaptcha + + https://rucaptcha.com/api-docs/prosopo-procaptcha + """ + super().__init__(method=method, *args, **kwargs) + + self.create_task_payload["task"].update({"websiteURL": websiteURL, "websiteKey": websiteKey}) + + # check user params + if method not in ProsopoEnm.list_values(): + raise ValueError(f"Invalid method parameter set, available - {ProsopoEnm.list_values()}") + + def captcha_handler(self, **kwargs) -> dict: + """ + Sync solving method + + Args: + kwargs: additional params for `requests` library + + Returns: + Dict with full server response + + Notes: + Check class docstirng for more info + """ + + return self._processing_response(**kwargs) + + async def aio_captcha_handler(self) -> dict: + """ + Async solving method + + Returns: + Dict with full server response + + Notes: + Check class docstirng for more info + """ + return await self._aio_processing_response() diff --git a/src/python_rucaptcha/tencent.py b/src/python_rucaptcha/tencent.py index 1b92c507..8d3e01f0 100644 --- a/src/python_rucaptcha/tencent.py +++ b/src/python_rucaptcha/tencent.py @@ -74,6 +74,7 @@ def __init__( Notes: https://rucaptcha.com/api-docs/tencent + https://2captcha.com/api-docs/tencent """ super().__init__(method=method, *args, **kwargs) From 20b7c1cdfddf311daa21f9a8e00bc18b2325db79 Mon Sep 17 00:00:00 2001 From: Andrei Date: Fri, 7 Mar 2025 23:28:16 +0300 Subject: [PATCH 08/10] Update conf.py --- docs/conf.py | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/conf.py b/docs/conf.py index b6c139e0..64a0643b 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -6,6 +6,7 @@ from python_rucaptcha import ( core, control, + prosopo, tencent, gee_test, hcaptcha, From 5aadd12bb25ee66369595ca1176178be7d3b9c09 Mon Sep 17 00:00:00 2001 From: Andrei Date: Fri, 7 Mar 2025 23:28:19 +0300 Subject: [PATCH 09/10] Create example.rst --- docs/modules/prosopo/example.rst | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 docs/modules/prosopo/example.rst diff --git a/docs/modules/prosopo/example.rst b/docs/modules/prosopo/example.rst new file mode 100644 index 00000000..58056e10 --- /dev/null +++ b/docs/modules/prosopo/example.rst @@ -0,0 +1,12 @@ +Prosopo +======= + +To import this module: + +.. code-block:: python + + from python_rucaptcha.prosopo import Prosopo + + +.. autoclass:: python_rucaptcha.prosopo.Prosopo + :members: From e019eb1b31a553263e38cc206be12bfb6dc890da Mon Sep 17 00:00:00 2001 From: Andrei Date: Fri, 7 Mar 2025 23:28:24 +0300 Subject: [PATCH 10/10] Update index.rst --- docs/index.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/index.rst b/docs/index.rst index a5b1552a..f53e67f4 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -50,6 +50,7 @@ Check our other projects here - `RedPandaDev group