fix: canlı-tespit komutuna da --js-runtimes node ekle (n-challenge bazı kanallarda metadata isteğinde de tetikleniyor)
This commit is contained in:
@@ -30,7 +30,9 @@ export const lastPollErrors = new Map<string, string>();
|
|||||||
* residential/ISP proxy (the Coolify server's own IP got flagged from a
|
* residential/ISP proxy (the Coolify server's own IP got flagged from a
|
||||||
* day of heavy testing). No `-f` format selector here — resolving
|
* day of heavy testing). No `-f` format selector here — resolving
|
||||||
* downloadable formats is a separate, heavier check only needed later,
|
* 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> {
|
async function findLiveVideoId(channelId: string): Promise<string | null> {
|
||||||
const liveUrl = `https://www.youtube.com/channel/${channelId}/live`;
|
const liveUrl = `https://www.youtube.com/channel/${channelId}/live`;
|
||||||
@@ -38,7 +40,16 @@ async function findLiveVideoId(channelId: string): Promise<string | null> {
|
|||||||
try {
|
try {
|
||||||
const { stdout } = await execFileAsync(
|
const { stdout } = await execFileAsync(
|
||||||
"yt-dlp",
|
"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 },
|
{ timeout: 20_000 },
|
||||||
);
|
);
|
||||||
lastPollErrors.delete(channelId);
|
lastPollErrors.delete(channelId);
|
||||||
|
|||||||
Reference in New Issue
Block a user