fix: yt-dlp android player_client ile bot-tespitini azalt

AyrisTech kanalı gerçekten canlıydı ama Coolify sunucusunun IP'si
YouTube'un "Sign in to confirm you're not a bot" duvarına takıldı
(bu ortamdan aynı komut sorunsuz çalıştı — IP itibarına bağlı).
Hem live-check hem capture çağrısına --extractor-args
"youtube:player_client=android" eklendi; bu client genelde aynı
PO-token doğrulamasına tabi değil.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
2026-08-30 16:02:03 +03:00
co-authored by Claude Sonnet 5
parent ad419f38b0
commit 81d71bd761
2 changed files with 12 additions and 4 deletions
+5 -3
View File
@@ -71,9 +71,11 @@ async function runCapture(job: Job<StreamIngestJob>): Promise<void> {
console.log(`[stream-ingest] starting capture for session ${sessionId}: ${youtubeUrl}`);
const ytdlp = spawn("yt-dlp", ["-f", "best", "-o", "-", youtubeUrl], {
stdio: ["ignore", "pipe", "pipe"],
});
const ytdlp = spawn(
"yt-dlp",
["--extractor-args", "youtube:player_client=android", "-f", "best", "-o", "-", youtubeUrl],
{ stdio: ["ignore", "pipe", "pipe"] },
);
const ffmpeg = spawn(
"ffmpeg",
+7 -1
View File
@@ -28,7 +28,13 @@ async function findLiveVideoId(channelId: string): Promise<string | null> {
try {
const { stdout } = await execFileAsync(
"yt-dlp",
["--simulate", "--no-warnings", "--print", "%(id)s", liveUrl],
[
"--simulate",
"--no-warnings",
"--extractor-args", "youtube:player_client=android",
"--print", "%(id)s",
liveUrl,
],
{ timeout: 20_000 },
);
lastPollErrors.delete(channelId);