---
name: reference_akp_youtube_proxy
description: "AKP-YouTube-Ingest läuft über Webshare Rotating Residential Proxy (IP-Auth, no creds); Setup + Recovery"
metadata: 
  node_type: memory
  type: reference
  originSessionId: d2fe3a93-b3b6-4da2-8273-4587f57ee0ec
---

Die AKP-YouTube-Video-Pipeline (`aria-akp-ingest.py`) holt Transcripts über einen **Webshare Rotating Residential Proxy** (sonst blockt YouTube die Datacenter-IP).

- **Config:** `YT_PROXY=http://p.webshare.io:80` in `/root/aria/.env` — **OHNE** Username/Password\! Webshare nutzt **IP-Authorization**: die Server-IP **`76.13.135.118`** ist in Webshare → Proxy → Rotating Residential → Proxy Settings → *IP Authorizations* freigegeben. Creds mitschicken → **407**.
- **Plan (verifiziert per Dashboard-Screenshot 16.06.):** **Rotating Residential Proxy, $75.60/Jahr** (≈$6.30/mo), **3 GB Bandbreite/Monat**, bis zu 80 Mio IPs/Monat, **1 IP-Authorization**, Thread/Concurrency 500, 3/3 Sub-Users. Renewal **11.06.2027**. (Korrigiert frühere Annahme "$3.50/mo / 1 GB free" — das stimmte nicht.) Daneben ein **gekündigter** Static-Residential-Plan ($50.40/Jahr, 20 Proxies, 250 GB/Monat) — der war der ~5-Wochen-Ausfall-Auslöser.
- **DNS-Caveat:** netcup-Resolver (`153.92.2.6`) gibt NXDOMAIN für `p.webshare.io`. Gefixt in `/etc/systemd/resolved.conf` → `DNS=1.1.1.1 8.8.8.8`. Wenn DNS wieder zickt: dort prüfen.
- **Webshare-API:** Proxy-List-Download-URL liegt in `/root/.aria-secrets/webshare.env` (`WEBSHARE_PROXY_LIST_URL`, chmod 600) → 20.000 Proxies programmatisch abrufbar. Liste hat **CRLF** → beim Parsen `\r` strippen.
- **Health-Check:** `aria-proxy-health.timer` (täglich 03:45) → `aria-proxy-health-check.py` testet Proxy+YouTube-Listing, schickt Telegram-Alert wenn tot. State: `/root/aria/state/proxy-health.json`.
- **Cookies:** frische YouTube-Cookies in `/root/.config/yt-dlp/cookies.txt` (chmod 600) als Zusatz-Robustheit; Kais exportiert sie aus eingeloggtem Browser (per SSH, nicht Telegram — [[feedback_no_secrets_via_telegram]]).

**Ausfall-Historie:** Proxy war ~5 Wochen tot (11.05.–14.06.), weil Webshares *Static-Residential-Plan gekündigt* wurde → stiller Pipeline-Tod. Deshalb der Health-Check. Voller Debug: KAR-741.

**Bandbreiten-Limit + KAR-742-Fix (16.06., DONE):** Der Rotating-Endpoint hatte ein Bandbreiten-Cap; einmaliger Backfill (112 Videos) schöpfte es aus → Proxy suspendiert → Pipeline down. Kais hat **1 GB → 3 GB/Monat upgraded** (Plan jetzt $75.60/Jahr, s.o.) → Proxy **wieder live** (Exit-IP-Test rc=200, 16.06. ~20:30).

**KAR-742 umgesetzt** in `aria-akp-ingest.py`: Transcript-Pfad auf `youtube_transcript_api` (v1.2.4, System-Python) umgestellt. WICHTIG: **`GenericProxyConfig(http_url/https_url)`** nutzen, NICHT `WebshareProxyConfig` (das will User/Pass — wir haben IP-Auth ohne Creds). yt-dlp `--write-auto-sub` nur noch gecappter Fallback (`yt_dlp_fallback_max: 5` in `.config.yaml`); `--dump-json` pro Channel-Video komplett raus (Metadaten aus `--flat-playlist`), bei Discovery nur noch nach erfolgreichem Transcript. Plus Block-Abort: bei `RequestBlocked/IpBlocked` bricht der Lauf ab statt Bandbreite zu verbrennen.

**Gemessener Wire-Bytes-Delta** (gleiches Video, via lokalem TCP-Zähl-Relay, = was Webshare zählt): ALT (dump-json + auto-sub) = **2381 KB/Video**, NEU (ytapi) = **339 KB/Video** → **~7× weniger / ~86%**. Korrektur zur ursprünglichen Issue-Annahme „KB statt MB": ytapi 1.2.4 lädt weiterhin die Watch-Page (für Innertube-Key), ist also ~340 KB, nicht wenige KB — aber Größenordnungs-Gewinn ggü. altem Doppel-Fetch. Backup vor Edit: `aria-akp-ingest.py.bak-20260616-201203`. Webshare-Mail-Buttons NICHT klicken → nur via `dashboard.webshare.io`.

**Vision-Backlog-Verify (offen, 16.06.):** Vision-Stage (`aria-akp-vision.py`, Stage 3.5, Timer 06:15 Europe/Berlin, VISION_MAX=5) hat in den letzten 7 Tagen **0 Frames** analysiert (`daily_costs.vision_usd=0`), obwohl **7 YouTube-Videos** (source=channel) als Issue/Skill/Spike klassifiziert waren — Frame-Extract (`claude-watch/scripts/extract.sh`) braucht den Proxy zum Video-Download, der war bis 16.06. ~20:30 tot. **TODO: nächsten 06:15-Lauf prüfen**, ob vision_usd>0 / Backlog abgearbeitet wird. Falls weiter 0 trotz lebendem Proxy → echter Bug in der Vision-Selektion, separat untersuchen. NB: Frame-Extract zieht mehr Proxy-Bandbreite als Transcript (Video-Segmente) — im 3-GB-Budget mitdenken.

Vgl. [[reference_aria_aws_access]] (gleiche Secrets-Disziplin), [[feedback_backup_before_live_nongit_edits]].
