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