FunCaptcha¶
To import this module:
from python3_anticaptcha.fun_captcha import FunCaptcha
- class python3_anticaptcha.fun_captcha.FunCaptcha(api_key: str, captcha_type: CaptchaTypeEnm | str, websiteURL: str, websitePublicKey: str, funcaptchaApiJSSubdomain: str | None = None, data: str | None = None, proxyType: ProxyTypeEnm | str | None = None, proxyAddress: str | None = None, proxyPort: int | None = None, proxyLogin: str | None = None, proxyPassword: str | None = None, userAgent: str | None = None, sleep_time: int | None = 10)¶
- __init__(api_key: str, captcha_type: CaptchaTypeEnm | str, websiteURL: str, websitePublicKey: str, funcaptchaApiJSSubdomain: str | None = None, data: str | None = None, proxyType: ProxyTypeEnm | str | None = None, proxyAddress: str | None = None, proxyPort: int | None = None, proxyLogin: str | None = None, proxyPassword: str | None = None, userAgent: str | None = None, sleep_time: int | None = 10)¶
The class is used to work with FunCaptcha.
- Parameters:
api_key (str) – Capsolver API key
captcha_type (CaptchaTypeEnm | str) – Captcha type
websiteURL (str) – Address of the webpage
websitePublicKey (str) – Arkose Labs public key.
proxyType (ProxyTypeEnm | str | None) – Type of the proxy
proxyAddress (str | None) – Proxy IP address IPv4/IPv6. Not allowed to use: host names instead of IPs, transparent proxies (where client IP is visible), proxies from local networks (192.., 10.., 127…)
proxyPort (int | None) – Proxy port.
proxyLogin (str | None) – Proxy login.
proxyPassword (str | None) – Proxy password.
userAgent (str | None) – Browser UserAgent.
sleep_time (int | None) – The waiting time between requests to get the result of the Captcha
Examples
>>> FunCaptcha(api_key="99d7d111a0111dc11184111c8bb111da", ... captcha_type="FunCaptchaTaskProxyless", ... websiteURL="https://demo.arkoselabs.com", ... websitePublicKey="DF9C4D87-CB7B-4062-9FEB-BADB6ADA61E6" ... ).captcha_handler() { "errorId": 0, "errorCode": None, "errorDescription": None, "status":"ready", "solution":{ "token":"0.Qz0.....f1" }, "cost": 0.002, "ip": "46.53.249.230", "createTime": 1679004358, "endTime": 1679004368, "solveCount": 0, "taskId": 396687629 }
>>> await FunCaptcha(api_key="99d7d111a0111dc11184111c8bb111da", ... captcha_type="FunCaptchaTaskProxyless", ... websiteURL="https://demo.arkoselabs.com", ... websitePublicKey="DF9C4D87-CB7B-4062-9FEB-BADB6ADA61E6" ... ).aio_captcha_handler() { "errorId": 0, "errorCode": None, "errorDescription": None, "status":"ready", "solution":{ "token":"0.Qz0.....f1" }, "cost": 0.002, "ip": "46.53.249.230", "createTime": 1679004358, "endTime": 1679004368, "solveCount": 0, "taskId": 396687629 }
>>> FunCaptcha(api_key="99d7d111a0111dc11184111c8bb111da", ... captcha_type="FunCaptchaTask", ... websiteURL="https://demo.arkoselabs.com", ... websitePublicKey="DF9C4D87-CB7B-4062-9FEB-BADB6ADA61E6", ... proxyType="http", ... proxyAddress="0.0.0.0", ... proxyPort=9988, ... proxyLogin="proxy_login", ... proxyPassword="proxy_password", ... userAgent="some_real_user_agent", ... ).captcha_handler() { "errorId": 0, "errorCode": None, "errorDescription": None, "status":"ready", "solution":{ "token":"0.Qz0.....f1" }, "cost": 0.002, "ip": "46.53.249.230", "createTime": 1679004358, "endTime": 1679004368, "solveCount": 0, "taskId": 396687629 }