fix: canlı-tespit komutuna da --js-runtimes node ekle (n-challenge bazı kanallarda metadata isteğinde de tetikleniyor)

This commit is contained in:
2026-09-01 17:36:58 +03:00
parent f00fc73b0b
commit 93fd7a95df
+13 -2
View File
@@ -30,7 +30,9 @@ export const lastPollErrors = new Map<string, string>();
* 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<string | null> {
const liveUrl = `https://www.youtube.com/channel/${channelId}/live`;
@@ -38,7 +40,16 @@ async function findLiveVideoId(channelId: string): Promise<string | null> {
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);