Update PVideoDl to support custom download strategies and enhance cookie handling. Added new downloader registration system, updated README for clarity on downloaders, and introduced cookies configuration in settings. Frontend now includes a dedicated tab for download strategies and API endpoints for listing them.
This commit is contained in:
@@ -21,6 +21,11 @@ def _env_int(name: str, default: int) -> int:
|
||||
return default
|
||||
|
||||
|
||||
def _env_path_opt(name: str) -> Path | None:
|
||||
value = os.environ.get(name)
|
||||
return Path(value).expanduser().resolve() if value else None
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class Settings:
|
||||
# Куда складывать скачанные файлы.
|
||||
@@ -38,6 +43,11 @@ class Settings:
|
||||
# Хост/порт веб-сервера.
|
||||
host: str = os.environ.get("PVDL_HOST", "127.0.0.1")
|
||||
port: int = _env_int("PVDL_PORT", 8000)
|
||||
# Cookies для yt-dlp (сайты, блокирующие анонимные запросы: возрастной гейт,
|
||||
# логин, гео). Браузер: "chrome" | "firefox" | "edge" | … , можно "chrome:Профиль".
|
||||
cookies_from_browser: str | None = os.environ.get("PVDL_COOKIES_FROM_BROWSER") or None
|
||||
# Файл cookies в формате Netscape (cookies.txt).
|
||||
cookies_file: Path | None = _env_path_opt("PVDL_COOKIES_FILE")
|
||||
|
||||
|
||||
settings = Settings()
|
||||
|
||||
Reference in New Issue
Block a user