Tencent

To import this module:

from python_rucaptcha.tencent import Tencent
class python_rucaptcha.tencent.Tencent(websiteURL: str, appId: str, method: str | TencentEnm = TencentEnm.TencentTaskProxyless, *args, **kwargs)
__init__(websiteURL: str, appId: str, method: str | TencentEnm = TencentEnm.TencentTaskProxyless, *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.

  • method (str | TencentEnm) – Captcha type

Examples

>>> Tencent(rucaptcha_key="aa9011f31111181111168611f1151122",
...             websiteURL="https://www.tencentcloud.com/account/register",
...             appId="2009899766",
...             method=TencentEnm.TencentTaskProxyless.value,
...             ).captcha_handler()
{
   "errorId":0,
   "status":"ready",
   "solution":{
        "appid": "190014885",
        "ret": 0,
        "ticket": "tr034XXXXXXXXXXXXXXXXXX*",
        "randstr": "@KVN"
   },
   "cost":"0.00299",
   "ip":"1.2.3.4",
   "createTime":1692863536,
   "endTime":1692863556,
   "solveCount":1,
   "taskId":75190409731
}
>>> await Tencent(rucaptcha_key="aa9011f31111181111168611f1151122",
...             websiteURL="https://www.tencentcloud.com/account/register",
...             appId="2009899766",
...             method=TencentEnm.TencentTaskProxyless.value,
...             ).aio_captcha_handler()
{
   "errorId":0,
   "status":"ready",
   "solution":{
        "appid": "190014885",
        "ret": 0,
        "ticket": "tr034XXXXXXXXXXXXXXXXXX*",
        "randstr": "@KVN"
   },
   "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