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}`); console.log(`[stream-ingest] starting capture for session ${sessionId}: ${youtubeUrl}`);
const ytdlp = spawn("yt-dlp", ["-f", "best", "-o", "-", youtubeUrl], { const ytdlp = spawn(
stdio: ["ignore", "pipe", "pipe"], "yt-dlp",
}); ["--extractor-args", "youtube:player_client=android", "-f", "best", "-o", "-", youtubeUrl],
{ stdio: ["ignore", "pipe", "pipe"] },
);
const ffmpeg = spawn( const ffmpeg = spawn(
"ffmpeg", "ffmpeg",
+7 -1
View File
@@ -28,7 +28,13 @@ 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", "--print", "%(id)s", liveUrl], [
"--simulate",
"--no-warnings",
"--extractor-args", "youtube:player_client=android",
"--print", "%(id)s",
liveUrl,
],
{ timeout: 20_000 }, { timeout: 20_000 },
); );
lastPollErrors.delete(channelId); lastPollErrors.delete(channelId);