Spaces:
Sleeping
Sleeping
File size: 770 Bytes
de68d43 fccdd05 de68d43 1532ef0 de68d43 efd4911 de68d43 efd4911 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
from __future__ import annotations
from typing import Literal
from pydantic import BaseModel, Field, HttpUrl
class ViewPortModel(BaseModel):
width: int = 1280
height: int = 720
class PageModel(BaseModel):
color_scheme: Literal["light", "dark", "no-preference"] | None = "no-preference"
java_script_enabled: bool | None = True
viewport: ViewPortModel | None = None
proxy: dict | None = None
no_viewport: bool | None = False
class GetContentModel(BaseModel):
url: HttpUrl
new_browser: bool | None = False
query_selector: str | None = None
ms_delay: int = Field(default=0.0, ge=0, le=15_000)
class ScreenshotModel(GetContentModel):
full_page: bool | None = False
image_type: Literal["png", "jpeg"] = "jpeg"
|