atbCaptcha

To import this module:

from python_rucaptcha.atb_captcha import atbCaptcha
class python_rucaptcha.atb_captcha.atbCaptcha(websiteURL: str, appId: str, apiServer: str, method: str | atbCaptchaEnm = atbCaptchaEnm.AtbCaptchaTaskProxyless, *args, **kwargs)
__init__(websiteURL: str, appId: str, apiServer: str, method: str | atbCaptchaEnm = atbCaptchaEnm.AtbCaptchaTaskProxyless, *args, **kwargs)

The class is used to work with CapyPuzzle.

Parameters:
  • rucaptcha_key – User API key

  • websiteURL (str) – 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

  • appId (str) – The value of appId parameter in the website source code.

  • apiServer (str) – The value of apiServer parameter in the website source code.

  • method (str | atbCaptchaEnm) – Captcha type

Examples

>>> atbCaptcha(rucaptcha_key="aa9011f31111181111168611f1151122",
...             websiteURL="https://www.tencentcloud.com/account/register",
...             appId="2009899766",
...             apiServer="https://cap.aisecurius.com",
...             method=atbCaptchaEnm.AtbCaptchaTaskProxyless.value,
...             ).captcha_handler()
{
   "errorId":0,
   "status":"ready",
   "solution":{
        "token": "sl191suxzluwxxh6f:"
   },
   "cost":"0.00299",
   "ip":"1.2.3.4",
   "createTime":1692863536,
   "endTime":1692863556,
   "solveCount":1,
   "taskId":75190409731
}
>>> await atbCaptcha(rucaptcha_key="aa9011f31111181111168611f1151122",
...             websiteURL="https://www.tencentcloud.com/account/register",
...             appId="2009899766",
...             apiServer="https://cap.aisecurius.com",
...             method=atbCaptchaEnm.AtbCaptchaTaskProxyless.value,
...             ).aio_captcha_handler()
{
   "errorId":0,
   "status":"ready",
   "solution":{
        "token": "sl191suxzluwxxh6f:"
   },
   "cost":"0.00299",
   "ip":"1.2.3.4",
   "createTime":1692863536,
   "endTime":1692863556,
   "solveCount":1,
   "taskId":75190409731
}
Returns:

Dict with full server response

captcha_handler(**kwargs) dict

Sync solving method

Parameters:

kwargs – additional params for requests library

Returns:

Dict with full server response

Return type:

dict

Notes

Check class docstirng for more info

async aio_captcha_handler() dict

Async solving method

Returns:

Dict with full server response

Return type:

dict

Notes

Check class docstirng for more info