Files
Frank Schwenk 12cf6cab32 fix: normalize YouTube proxy URL and support dashboard fields
Rewrite https proxy URLs to http, allow HOST/PORT/USER/PASSWORD env vars,
and surface clearer errors when proxies fail on the wrong port.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-16 16:30:23 +02:00

36 lines
1.2 KiB
Python

from __future__ import annotations
from pydantic_settings import BaseSettings, SettingsConfigDict
class Settings(BaseSettings):
model_config = SettingsConfigDict(env_file=".env", env_file_encoding="utf-8", extra="ignore")
app_pin: str = "1234"
jwt_secret: str = "dev-secret-change-me"
jwt_expire_days: int = 90
openrouter_api_key: str = ""
openrouter_model: str = "google/gemini-2.5-flash"
db_path: str = "data/ytrecap.sqlite"
public_dir: str = "public"
app_url: str = "http://localhost:8000"
app_version: str = "1.0.0"
# YouTube transcript proxy (optional — for IP blocks)
# Option A: full URL — MUST include port, use http:// (not https://)
youtube_proxy: str = ""
# Option B: dashboard fields (Webshare etc.) — combined into a proxy URL
youtube_proxy_host: str = ""
youtube_proxy_port: int = 0
youtube_proxy_user: str = ""
youtube_proxy_password: str = ""
# Webshare rotating residential (paid package — NOT free "Proxy Server" tier)
webshare_proxy_username: str = ""
webshare_proxy_password: str = ""
webshare_proxy_locations: str = "" # comma-separated, e.g. de,es
settings = Settings() # type: ignore[call-arg]