Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2023 Andrei
Copyright (c) 2025 Andrei

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
1 change: 1 addition & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
mt_captcha,
re_captcha,
atb_captcha,
captcha_fox,
capy_puzzle,
fun_captcha,
key_captcha,
Expand Down
1 change: 1 addition & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ Check our other projects here - `RedPandaDev group <https://red-panda-dev.xyz/bl
modules/tencent/example.rst
modules/prosopo/example.rst
modules/atb-captcha/example.rst
modules/captcha-fox/example.rst
modules/control/example.rst

.. toctree::
Expand Down
12 changes: 12 additions & 0 deletions docs/modules/captcha-fox/example.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
CaptchaFox
==========

To import this module:

.. code-block:: python

from python_rucaptcha.captcha_fox import CaptchaFox


.. autoclass:: python_rucaptcha.captcha_fox.CaptchaFox
:members:
2 changes: 1 addition & 1 deletion docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
sphinx==8.3.0
pallets_sphinx_themes==2.3.0
myst-parser==4.0.1
enum-tools[sphinx]==0.12.0
enum-tools[sphinx]==0.13.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
zipp>=3.19.1 # not directly required, pinned by Snyk to avoid a vulnerability
4 changes: 1 addition & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,8 @@ keywords = [ "captcha",
"amazon_waf",
"friendly-captcha"
]
license = {text = "MIT License"}
license = "MIT"
classifiers = [
"License :: OSI Approved :: MIT License",
"License :: OSI Approved :: Mozilla Public License 2.0 (MPL 2.0)",
"Development Status :: 5 - Production/Stable",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
Expand Down
2 changes: 1 addition & 1 deletion src/python_rucaptcha/__version__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "6.3.2"
__version__ = "6.4.0"
124 changes: 124 additions & 0 deletions src/python_rucaptcha/captcha_fox.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
from .core.base import BaseCaptcha
from .core.enums import CaptchaFoxEnm


class CaptchaFox(BaseCaptcha):
def __init__(
self,
websiteURL: str,
websiteKey: str,
userAgent: str,
proxyType: str,
proxyAddress: str,
proxyPort: str,
*args,
**kwargs,
):
"""
The class is used to work with CaptchaFox.

Args:
rucaptcha_key: User API key
websiteURL: Full URL of the captcha page
websiteKey: The value of the `key` parameter.
It can be found in the page source code or captured in network requests during page loading.
userAgent: User-Agent of your browser will be used to load the captcha.
Use only modern browser's User-Agents
proxyType: Proxy type - `http`, `socks4`, `socks5`
proxyAddress: Proxy IP address or hostname
proxyPort: Proxy port
method: Captcha type
kwargs: Not required params for task creation request

Examples:
>>> CaptchaFox(rucaptcha_key="aa9011f31111181111168611f1151122",
... websiteURL="3ceb8624-1970-4e6b-91d5-70317b70b651",
... websiteKey="sk_xtNxpk6fCdFbxh1_xJeGflSdCE9tn99G",
... userAgent="Mozilla/5.0 .....",
... proxyType="socks5",
... proxyAddress="1.2.3.4",
... proxyPort="445",
... ).captcha_handler()
{
"errorId":0,
"status":"ready",
"solution":{
"token":"142000f.....er"
},
"cost":"0.002",
"ip":"1.2.3.4",
"createTime":1692863536,
"endTime":1692863556,
"solveCount":0,
"taskId": 73243152973,
}

>>> await CaptchaFox(rucaptcha_key="aa9011f31111181111168611f1151122",
... websiteURL="3ceb8624-1970-4e6b-91d5-70317b70b651",
... websiteKey="sk_xtNxpk6fCdFbxh1_xJeGflSdCE9tn99G",
... userAgent="Mozilla/5.0 .....",
... proxyType="socks5",
... proxyAddress="1.2.3.4",
... proxyPort="445",
... ).aio_captcha_handler()
{
"errorId":0,
"status":"ready",
"solution":{
"token":"142000f.....er"
},
"cost":"0.002",
"ip":"1.2.3.4",
"createTime":1692863536,
"endTime":1692863556,
"solveCount":0,
"taskId": 73243152973,
}

Returns:
Dict with full server response

Notes:
https://2captcha.com/api-docs/captchafox

https://rucaptcha.com/api-docs/captchafox
"""
super().__init__(method=CaptchaFoxEnm.CaptchaFoxTask, *args, **kwargs)

self.create_task_payload["task"].update(
{
"websiteURL": websiteURL,
"websiteKey": websiteKey,
"userAgent": userAgent,
"proxyType": proxyType,
"proxyAddress": proxyAddress,
"proxyPort": proxyPort,
}
)

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()
4 changes: 4 additions & 0 deletions src/python_rucaptcha/core/enums.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,3 +164,7 @@ class atbCaptchaEnm(str, MyEnum):
class ProsopoEnm(str, MyEnum):
ProsopoTask = "ProsopoTask"
ProsopoTaskProxyless = "ProsopoTaskProxyless "


class CaptchaFoxEnm(str, MyEnum):
CaptchaFoxTask = "CaptchaFoxTask"
4 changes: 2 additions & 2 deletions src/python_rucaptcha/datadome_captcha.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def __init__(
>>> DataDomeCaptcha(rucaptcha_key="aa9011f31111181111168611f1151122",
... websiteURL="3ceb8624-1970-4e6b-91d5-70317b70b651",
... captchaUrl="https://rucaptcha.com/demo/hcaptcha",
... userAgent="https://rucaptcha.com/demo/hcaptcha",
... userAgent="Mozilla/5.0 .....",
... proxyType="socks5",
... proxyAddress="1.2.3.4",
... proxyPort="445",
Expand All @@ -56,7 +56,7 @@ def __init__(
>>> await DataDomeCaptcha(rucaptcha_key="aa9011f31111181111168611f1151122",
... websiteURL="3ceb8624-1970-4e6b-91d5-70317b70b651",
... captchaUrl="https://rucaptcha.com/demo/hcaptcha",
... userAgent="https://rucaptcha.com/demo/hcaptcha",
... userAgent="Mozilla/5.0 .....",
... proxyType="socks5",
... proxyAddress="1.2.3.4",
... proxyPort="445",
Expand Down
Loading