Represents a task payload for solving captchas on the DataDome platform. Attributes: websiteURL: A string that contains the address of the page where the captcha is solved. proxy: Optional proxy settings, represented as a ProxyPayload. Defaults to None. metadata: Ad
| 39 | |
| 40 | |
| 41 | class DataDomeTask(TaskPayload, UserAgentPayload): |
| 42 | """ |
| 43 | Represents a task payload for solving captchas on the DataDome platform. |
| 44 | |
| 45 | Attributes: |
| 46 | websiteURL: A string that contains the address of the page where the captcha is solved. |
| 47 | proxy: Optional proxy settings, represented as a ProxyPayload. Defaults to None. |
| 48 | metadata: Additional metadata about the captcha, represented as a DataDomeMetadata. |
| 49 | Defaults to None. |
| 50 | """ |
| 51 | type: str = Field(default="CustomTask", frozen=True) |
| 52 | class_: str = Field(default="DataDome", alias="class", frozen=True) |
| 53 | websiteURL: str = Field(..., description="Address of the page on which the captcha is solved.") |
| 54 | proxy: Optional[ProxyPayload] = Field(default=None, description="Proxy settings.") |
| 55 | metadata: DataDomeMetadata = Field(default=None, description="Additional data about the captcha.") |
| 56 | |
| 57 | def to_request(self) -> dict[str, Any]: |
| 58 | base = self.model_dump(exclude_none=True, by_alias=True) |
| 59 | proxy_dict = base.pop("proxy", {}) |
| 60 | if proxy_dict: |
| 61 | base.update(proxy_dict) |
| 62 | return base |
no outgoing calls