fix(youtube): prevent playlist URLs from stalling yt-dlp probes (#180)

This commit is contained in:
2026-08-01 22:56:28 -07:00
committed by GitHub
parent 6607c333bc
commit 4d65dec340
9 changed files with 87 additions and 26 deletions
+3 -3
View File
@@ -2,7 +2,7 @@ import fs from 'node:fs';
import path from 'node:path';
import { spawn } from 'node:child_process';
import type { YoutubeTrackOption } from './track-probe';
import { getYoutubeYtDlpCommand } from './ytdlp-command';
import { getYoutubeYtDlpCommand, YTDLP_SINGLE_VIDEO_ARG } from './ytdlp-command';
import {
convertYoutubeTimedTextToVtt,
isYoutubeTimedTextExtension,
@@ -126,14 +126,14 @@ function pickLatestSubtitleFileForLanguage(
return candidates[0] ?? null;
}
function buildDownloadArgs(input: {
export function buildDownloadArgs(input: {
targetUrl: string;
outputTemplate: string;
sourceLanguages: string[];
includeAutoSubs: boolean;
includeManualSubs: boolean;
}): string[] {
const args = ['--skip-download', '--no-warnings'];
const args = [YTDLP_SINGLE_VIDEO_ARG, '--skip-download', '--no-warnings'];
if (input.includeAutoSubs) {
args.push('--write-auto-subs');
}