feat: add optional YouTube proxy support for IP blocks

Route transcript fetching through YOUTUBE_PROXY or Webshare residential
config, with clearer errors when YouTube still blocks requests.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Frank Schwenk
2026-06-16 16:23:06 +02:00
parent 5b8042b173
commit 76de7c7a3a
6 changed files with 128 additions and 7 deletions
+21
View File
@@ -64,6 +64,27 @@ Traefik übernimmt TLS via `myresolver`. Persistente Daten liegen in `./data/`.
| `POST /api/recaps` | JWT | Recap erstellen |
| `POST /api/recaps/{video_id}/regenerate` | JWT | Neu generieren |
## YouTube IP-Block / Proxy
YouTube blockiert oft Server-IPs (Hetzner, AWS, …). Optional in `.env`:
```bash
# Statischer Proxy (z.B. aus Webshare „Proxy Server“ / Dashboard-Zeile)
YOUTUBE_PROXY=http://USER:PASS@HOST:PORT
```
Für yt-dlp-Fallback und VTT-Downloads wird dieselbe URL genutzt.
**Webshare-Hinweis:** Der kostenlose Tier und „Proxy Server“ (einzelne IP wie im Dashboard) funktionieren *manchmal* für wenige Recaps pro Tag — laut `youtube-transcript-api` aber unzuverlässig. Rotating **Residential** (kostenpflichtig) ist die robuste Lösung:
```bash
WEBSHARE_PROXY_USERNAME=...
WEBSHARE_PROXY_PASSWORD=...
WEBSHARE_PROXY_LOCATIONS=de
```
Öffentliche Gratis-Proxy-Listen: nein (langsam, unsicher, meist schon gebannt).
## Stack
- FastAPI + SQLite