From fd21bbfb1445ffcb42a89f6a22550bc234924219 Mon Sep 17 00:00:00 2001 From: ayrisdev Date: Sun, 30 Aug 2026 17:55:43 +0300 Subject: [PATCH] fix: yt-dlp'ye Node.js JS runtime + EJS solver ekle (n-challenge) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Gerçek capture denemesinde debug endpoint'i asıl nedeni gösterdi: "n challenge solving failed" — YouTube'un imza çözme JS challenge'ı için yt-dlp'nin bir JS runtime'ı yoktu, bu da formatların eksik kalıp "page needs to be reloaded" ile sonuçlanmasına yol açıyordu. node:22-slim zaten Node 22 içeriyor (minimum gereksinim); yt-dlp'yi "yt-dlp[default]" (EJS solver dahil) olarak kurup capture çağrısına --js-runtimes node eklendi. Lokal olarak doğrulandı: aynı video artık formatları hatasız çözüyor. Co-Authored-By: Claude Sonnet 5 --- apps/api-daemon/Dockerfile | 2 +- apps/api-daemon/src/capture/streamIngest.ts | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/api-daemon/Dockerfile b/apps/api-daemon/Dockerfile index 505ebc0..3bfef28 100644 --- a/apps/api-daemon/Dockerfile +++ b/apps/api-daemon/Dockerfile @@ -2,7 +2,7 @@ FROM node:22-slim RUN apt-get update && apt-get install -y --no-install-recommends \ ffmpeg python3 python3-pip ca-certificates \ - && pip3 install --break-system-packages -U yt-dlp bgutil-ytdlp-pot-provider \ + && pip3 install --break-system-packages -U "yt-dlp[default]" bgutil-ytdlp-pot-provider \ && rm -rf /var/lib/apt/lists/* RUN corepack enable diff --git a/apps/api-daemon/src/capture/streamIngest.ts b/apps/api-daemon/src/capture/streamIngest.ts index 2e46b05..e919e2b 100644 --- a/apps/api-daemon/src/capture/streamIngest.ts +++ b/apps/api-daemon/src/capture/streamIngest.ts @@ -89,6 +89,7 @@ async function runCapture(job: Job): Promise { const ytdlp = spawn( "yt-dlp", [ + "--js-runtimes", "node", ...ytdlpAntiBotArgs(), "-f", "bestvideo+bestaudio/best", "-o", "-", youtubeUrl, ],