Skip to content

☁️ Turnstile#

capmonster_python.TurnstileTask #

Bases: TaskPayload

Represents a TurnstileTask used for solving captcha.

Attributes:

Name Type Description
websiteURL str

A required string containing the page address where the captcha is solved.

websiteKey str

A required string for the Turnstile key.

pageAction Optional[str]

An optional string representing the action field that can be found in the callback function to load the captcha.

data Optional[str]

An optional string containing the value of the data field, which can be obtained from the cData parameter.

capmonster_python.TurnstileCloudFlareTask #

Bases: TurnstileTask

Represents a Turnstile task for Cloudflare challenges.

Attributes:

Name Type Description
cloudflareTaskType Literal['token', 'cf_clearance']

Specifies the Cloudflare challenge type. Expected values are "token" or "cf_clearance".

userAgent str

Browser User-Agent string, must originate from a Windows OS.

apiJsUrl Optional[str]

Optional captcha script URL, applicable only for "token" type tasks.

htmlPageBase64 Optional[str]

Base64-encoded HTML page content, required for tasks with "cf_clearance" type.

proxy Optional[ProxyPayload]

Optional proxy settings; mandatory for the "cf_clearance" type and omitted for the "token" type.

Raises:

Type Description
CapmonsterValidationException

When field requirements specific to the cloudflareTaskType are not satisfied.