__init__
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Literal
|
||||
|
||||
from pydantic import BaseModel, Field
|
||||
|
||||
AssetType = Literal["styles", "scripts", "images", "fonts", "media", "other"]
|
||||
SUPPORTED_ASSET_TYPES: tuple[AssetType, ...] = (
|
||||
"styles",
|
||||
"scripts",
|
||||
"images",
|
||||
"fonts",
|
||||
"media",
|
||||
"other",
|
||||
)
|
||||
|
||||
|
||||
class CaptureRequest(BaseModel):
|
||||
url: str = Field(min_length=1, max_length=2_048)
|
||||
include_external_assets: bool = True
|
||||
parallel_connections: int = Field(default=6, ge=1)
|
||||
download_asset_types: list[AssetType] = Field(
|
||||
default_factory=lambda: list(SUPPORTED_ASSET_TYPES), max_length=len(SUPPORTED_ASSET_TYPES)
|
||||
)
|
||||
skip_file_types: list[str] = Field(default_factory=list, max_length=24)
|
||||
use_proxy: bool = False
|
||||
max_pages: int = Field(default=150, ge=1)
|
||||
max_depth: int = Field(default=5, ge=0)
|
||||
max_bytes_mb: int = Field(default=100, ge=1)
|
||||
max_duration_seconds: int = Field(default=300, ge=10)
|
||||
retention_days: int = Field(default=7, ge=1)
|
||||
Reference in New Issue
Block a user