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);