HCaptcha¶
To import this module:
from python3_capsolver.hcaptcha import HCaptcha
from python3_capsolver.hcaptcha import HCaptchaClassification
- class python3_capsolver.hcaptcha.HCaptcha(captcha_type: HCaptchaTypeEnm | str, websiteURL: str, websiteKey: str, *args, **kwargs)¶
The class is used to work with Capsolver HCaptcha methods.
- Parameters:
api_key – Capsolver API key
captcha_type (HCaptchaTypeEnm | str) – Captcha type name, like
HCaptchaTaskProxyless
and etc.websiteURL (str) – Address of a webpage with hCaptcha
websiteKey (str) – hCaptcha website key
Examples
>>> HCaptcha(api_key="CAI-BA9XXXXXXXXXXXXX2702E010", ... captcha_type='HCaptchaTaskProxyless', ... websiteURL="https://accounts.hcaptcha.com/demo", ... websiteKey="a5f74b19-9e45-40e0-b45d-47ff91b7a6c2", ... ).captcha_handler() CaptchaResponseSer(errorId=0, errorCode=None, errorDescription=None, taskId='73bdcd28-6c77-4414-8....', status=<ResponseStatusEnm.Ready: 'ready'>, solution={'gRecaptchaResponse': '44795sds...'} )
>>> HCaptcha(api_key="CAI-BA9XXXXXXXXXXXXX2702E010", ... captcha_type=HCaptchaTypeEnm.HCaptchaEnterpriseTaskProxyLess, ... websiteURL="https://accounts.hcaptcha.com/demo", ... websiteKey="a5f74b19-9e45-40e0-b45d-47ff91b7a6c2", ... ).captcha_handler() CaptchaResponseSer(errorId=0, errorCode=None, errorDescription=None, taskId='73bdcd28-6c77-4414-8....', status=<ResponseStatusEnm.Ready: 'ready'>, solution={'gRecaptchaResponse': '44795sds...'} )
>>> HCaptcha(api_key="CAI-BA9XXXXXXXXXXXXX2702E010", ... captcha_type=HCaptchaTypeEnm.HCaptchaTask, ... websiteURL="https://accounts.hcaptcha.com/demo", ... websiteKey="a5f74b19-9e45-40e0-b45d-47ff91b7a6c2", ... proxy="socks5:192.191.100.10:4780:user:pwd" ... isInvisible=True ... ).captcha_handler() CaptchaResponseSer(errorId=0, errorCode=None, errorDescription=None, taskId='73bdcd28-6c77-4414-8....', status=<ResponseStatusEnm.Ready: 'ready'>, solution={'gRecaptchaResponse': '44795sds...'} )
>>> await HCaptcha(api_key="CAI-BA9650D2B9C2786B21120D512702E010", ... captcha_type=HCaptchaTypeEnm.HCaptchaTaskProxyless, ... websiteURL="https://accounts.hcaptcha.com/demo", ... websiteKey="a5f74b19-9e45-40e0-b45d-47ff91b7a6c2", ... ).aio_captcha_handler() CaptchaResponseSer(errorId=0, errorCode=None, errorDescription=None, taskId='73bdcd28-6c77-4414-8....', status=<ResponseStatusEnm.Ready: 'ready'>, solution={'gRecaptchaResponse': '44795sds...'} )
- Returns:
CaptchaResponseSer model with full server response
- captcha_handler() CaptchaResponseSer ¶
Sync solving method
- Returns:
CaptchaResponseSer model with full service response
- Return type:
CaptchaResponseSer
Notes
Check class docstring for more info
- async aio_captcha_handler() CaptchaResponseSer ¶
Async method for captcha solving
- Returns:
CaptchaResponseSer model with full service response
- Return type:
CaptchaResponseSer
Notes
Check class docstring for more info
- class python3_capsolver.hcaptcha.HCaptchaClassification(queries: List[str], question: str, captcha_type: HCaptchaClassificationTypeEnm | str = HCaptchaClassificationTypeEnm.HCaptchaClassification, *args, **kwargs)¶
The class is used to work with Capsolver HCaptchaClassification methods.
- Parameters:
api_key – Capsolver API key
captcha_type (HCaptchaClassificationTypeEnm | str) – Captcha type name, like
HCaptchaClassification
and etc.queries (List[str]) – Base64 encoded image, do not include “data:image/***; base64,” Assembles the picture as a list: [base64,base64,base64…]
question (str) – English is supported only. Please convert other languages by yourself
Examples
>>> HCaptchaClassification(api_key="CAI-BA9XXXXXXXXXXXXX2702E010", ... captcha_type='HCaptchaClassification', ... images=["/9j/4AAQS.....", "/9j/4AAQ2.....",], ... question="Please click each image containing a chair", ... ).captcha_handler() CaptchaResponseSer(errorId=0, errorCode=None, errorDescription=None, taskId='73bdcd28-6c77-4414-8....', status=<ResponseStatusEnm.Ready: 'ready'>, solution={'gRecaptchaResponse': '44795sds...'} )
- Returns:
CaptchaResponseSer model with full server response
- captcha_handler() CaptchaResponseSer ¶
Sync solving method
- Returns:
CaptchaResponseSer model with full service response
- Return type:
CaptchaResponseSer
Notes
Check class docstring for more info
- async aio_captcha_handler() CaptchaResponseSer ¶
Async method for captcha solving
- Returns:
CaptchaResponseSer model with full service response
- Return type:
CaptchaResponseSer
Notes
Check class docstring for more info