MT Captcha

To import this module:

from python3_capsolver.mt_captcha import MtCaptcha
class python3_capsolver.mt_captcha.MtCaptcha(captcha_type: MtCaptchaTypeEnm | str, websiteURL: str, websiteKey: str, *args, **kwargs)

The class is used to work with Capsolver MtCaptcha method.

Parameters:
  • api_key – Capsolver API key

  • captcha_type (MtCaptchaTypeEnm | str) – Captcha type name, like MtCaptchaTask and etc.

  • websiteURL (str) – Web address of the website using hcaptcha, generally it’s fixed value. (Ex: https://google.com)

  • websiteKey (str) – The domain public key, rarely updated. (Ex: sk=MTPublic-xxx public key)

Examples

>>> MtCaptcha(api_key="CAI-1324...",
...         captcha_type=MtCaptchaTypeEnm.MtCaptchaTaskProxyLess,
...         websiteURL="https://www.mtcaptcha.com/#mtcaptcha-demo",
...         websiteKey="MTPublic-tqNCRE0GS",
...        ).captcha_handler()
CaptchaResponseSer(errorId=0,
                   errorCode=None,
                   errorDescription=None,
                   taskId='73bdcd28-6c77-4414-8....',
                   status=<ResponseStatusEnm.Ready: 'ready'>,
                   solution={'token': 'v1(03,79a,MTPublic-tqNCRE0GS,c9...'}
                  )
>>> MtCaptcha(api_key="CAI-1324...",
...         captcha_type=MtCaptchaTypeEnm.MtCaptchaTask,
...         websiteURL="https://www.mtcaptcha.com/#mtcaptcha-demo",
...         websiteKey="MTPublic-tqNCRE0GS",
...         proxy="198.22.3.1:10001:user:pwd"
...        ).captcha_handler()
CaptchaResponseSer(errorId=0,
                   errorCode=None,
                   errorDescription=None,
                   taskId='73bdcd28-6c77-4414-8....',
                   status=<ResponseStatusEnm.Ready: 'ready'>,
                   solution={'token': 'v1(03,79a,MTPublic-tqNCRE0GS,c9...'}
                  )
>>> await MtCaptcha(api_key="CAI-1324...",
...         captcha_type=MtCaptchaTypeEnm.MtCaptchaTask,
...         websiteURL="https://www.mtcaptcha.com/#mtcaptcha-demo",
...         websiteKey="MTPublic-tqNCRE0GS",
...         proxy="198.22.3.1:10001:user:pwd"
...        ).aio_captcha_handler()
CaptchaResponseSer(errorId=0,
                   errorCode=None,
                   errorDescription=None,
                   taskId='73bdcd28-6c77-4414-8....',
                   status=<ResponseStatusEnm.Ready: 'ready'>,
                   solution={'token': 'v1(03,79a,MTPublic-tqNCRE0GS,c9...'}
                  )
>>> await MtCaptcha(api_key="CAI-1324...",
...         captcha_type=MtCaptchaTypeEnm.MtCaptchaTask,
...         websiteURL="https://www.mtcaptcha.com/#mtcaptcha-demo",
...         websiteKey="MTPublic-tqNCRE0GS",
...         proxy="198.22.3.1:10001:user:pwd"
...        ).aio_captcha_handler()
CaptchaResponseSer(errorId=0,
                   errorCode=None,
                   errorDescription=None,
                   taskId='73bdcd28-6c77-4414-8....',
                   status=<ResponseStatusEnm.Ready: 'ready'>,
                    solution={'token': 'v1(03,79a,MTPublic-tqNCRE0GS,c9...'}
                  )
Returns:

CaptchaResponseSer model with full server response

captcha_handler() CaptchaResponseSer

Sync method for captcha solving

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