Phase 3.1 — Configuration & Infrastructure: - Add youtube_proxy_enabled, yt_dlp_timeout, yt_dlp_cache_ttl config fields - Add yt-dlp and hls.js dependencies - Create models/youtube.py (request/response schemas) - Create service stubs (youtube_service, hls_proxy) - Create router stub and register in main.py - 11 config tests Phase 3.2 — YouTube URL Extraction: - yt-dlp wrapper with async extraction (run_in_executor) - Format selection: ≤480p video-only + highest-bitrate audio (VOD) - Combined format fallback: same URL for live streams - In-memory URL cache: 5min TTL live, 30min VOD - lru_cache singleton service for cache persistence - Error handling: DownloadError → 200 with error field - 18 extract tests, 82/82 total pass (zero regressions) Real-URL verified: VOD (5bF3tkO5jAA) 24 formats, Live (fN9uYWCjQaw) 6 HLS |
||
|---|---|---|
| .. | ||
| core | ||
| models | ||
| routers | ||
| services | ||
| test | ||
| utils | ||
| __init__.py | ||
| main.py | ||