Represents a GeeTest V4 task payload. Attributes: type: Indicates the type of the task, defaulted and frozen as "GeeTestTask". websiteURL: Address of the page on which the captcha is solved. gt: The GeeTest identifier key gt for the domain. version: Version
| 49 | |
| 50 | |
| 51 | class GeeTestV4Task(TaskPayload, UserAgentPayload): |
| 52 | """ |
| 53 | Represents a GeeTest V4 task payload. |
| 54 | |
| 55 | Attributes: |
| 56 | type: Indicates the type of the task, defaulted and frozen as "GeeTestTask". |
| 57 | websiteURL: Address of the page on which the captcha is solved. |
| 58 | gt: The GeeTest identifier key gt for the domain. |
| 59 | version: Version of the GeeTest task, defaulted and frozen as 4. |
| 60 | initParameters: Extra parameters for v4, used with 'riskType' or challenge details. |
| 61 | geetestApiServerSubdomain: Geetest API subdomain server (must differ from api.geetest.com). |
| 62 | geetestGetLib: Path to a captcha script. Must be passed as a JSON string. |
| 63 | proxy: Proxy settings to be used for the task. |
| 64 | """ |
| 65 | type: str = Field(default="GeeTestTask", frozen=True) |
| 66 | websiteURL: str = Field(..., description="Address of the page on which the captcha is solved.") |
| 67 | gt: str = Field(..., description="The GeeTest identifier key gt for the domain.") |
| 68 | version: int = Field(default=4, frozen=True) |
| 69 | initParameters: Optional[object] = Field( |
| 70 | default=None, |
| 71 | description="Extra parameters for v4, used with 'riskType' or challenge details." |
| 72 | ) |
| 73 | geetestApiServerSubdomain: Optional[str] = Field( |
| 74 | default=None, description="Geetest API subdomain server (must differ from api.geetest.com)" |
| 75 | ) |
| 76 | geetestGetLib: Optional[str] = Field( |
| 77 | default=None, description="Path to captcha script. Must be passed as JSON string." |
| 78 | ) |
| 79 | proxy: Optional[ProxyPayload] = Field(default=None, description="Proxy settings.") |
| 80 | |
| 81 | def to_request(self) -> dict[str, Any]: |
| 82 | base = self.model_dump(exclude_none=True) |
| 83 | proxy_dict = base.pop("proxy", {}) |
| 84 | if proxy_dict: |
| 85 | base.update(proxy_dict) |
| 86 | return base |
no outgoing calls