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:
@@ -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",
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user