Download app/schemas/admin/source.py from binhugg2/api: direct link, hf CLI and curl.
- Browser
- Download file 1.22 kB
-
https://huggingface.co/spaces/binhugg2/api/resolve/main/app/schemas/admin/source.py
- Command line
-
hf download hf://spaces/binhugg2/api/app/schemas/admin/source.py
-
curl -L -o source.py https://huggingface.co/spaces/binhugg2/api/resolve/main/app/schemas/admin/source.py
1.22 kB
| from pydantic import BaseModel, Field, HttpUrl | |
| class SourceCreateRequest(BaseModel): | |
| name: str = Field(..., min_length=1, max_length=50) | |
| code: str = Field(..., min_length=1, max_length=30, pattern=r"^[a-zA-Z0-9_-]+$") | |
| base_url: str = Field(..., min_length=1, max_length=500) | |
| site_url: str | None = Field(None, max_length=500) | |
| play_from_m3u8: str | None = Field(None, max_length=30) | |
| play_from_yun: str | None = Field(None, max_length=30) | |
| parse_url: str | None = Field(None, max_length=500) | |
| sync_interval: int = Field(60, ge=1, le=10080) | |
| sort_order: int = Field(0, ge=0) | |
| remark: str | None = Field(None, max_length=200) | |
| class SourceUpdateRequest(BaseModel): | |
| name: str | None = Field(None, min_length=1, max_length=50) | |
| base_url: str | None = Field(None, min_length=1, max_length=500) | |
| site_url: str | None = Field(None, max_length=500) | |
| play_from_m3u8: str | None = Field(None, max_length=30) | |
| play_from_yun: str | None = Field(None, max_length=30) | |
| parse_url: str | None = Field(None, max_length=500) | |
| sync_interval: int | None = Field(None, ge=1, le=10080) | |
| sort_order: int | None = Field(None, ge=0) | |
| remark: str | None = Field(None, max_length=200) | |