From 93fd7a95df20514544475b4d50919e6592b367a0 Mon Sep 17 00:00:00 2001 From: ayrisdev Date: Tue, 1 Sep 2026 17:36:58 +0300 Subject: [PATCH] =?UTF-8?q?fix:=20canl=C4=B1-tespit=20komutuna=20da=20--js?= =?UTF-8?q?-runtimes=20node=20ekle=20(n-challenge=20baz=C4=B1=20kanallarda?= =?UTF-8?q?=20metadata=20iste=C4=9Finde=20de=20tetikleniyor)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/api-daemon/src/youtubePolling.ts | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/apps/api-daemon/src/youtubePolling.ts b/apps/api-daemon/src/youtubePolling.ts index f57e1cd..8b44bc8 100644 --- a/apps/api-daemon/src/youtubePolling.ts +++ b/apps/api-daemon/src/youtubePolling.ts @@ -30,7 +30,9 @@ export const lastPollErrors = new Map(); * residential/ISP proxy (the Coolify server's own IP got flagged from a * day of heavy testing). No `-f` format selector here — resolving * downloadable formats is a separate, heavier check only needed later, - * in the actual capture. + * in the actual capture. `--js-runtimes node` (the n-challenge/EJS + * solver) is included too — some channels return "The page needs to be + * reloaded" on the plain metadata fetch too, not just format resolution. */ async function findLiveVideoId(channelId: string): Promise { const liveUrl = `https://www.youtube.com/channel/${channelId}/live`; @@ -38,7 +40,16 @@ async function findLiveVideoId(channelId: string): Promise { try { const { stdout } = await execFileAsync( "yt-dlp", - ["--simulate", "--no-warnings", ...(await ytdlpAntiBotArgs()), "--print", "%(id)s", liveUrl], + [ + "--simulate", + "--no-warnings", + "--js-runtimes", + "node", + ...(await ytdlpAntiBotArgs()), + "--print", + "%(id)s", + liveUrl, + ], { timeout: 20_000 }, ); lastPollErrors.delete(channelId);