youtube-dl 错误:无法下载视频并将音频提取到同一文件中



我使用了完全相同的youtube-dl命令,没有播放列表选项来下载单个音频文件,它起作用了。但是当我将其用于此播放列表时,出现错误:无法下载视频并将音频提取到同一文件中!使用 "(ext(s.%(ext(s" 而不是 "(ext(s" 作为输出模板

在窗口 10 上运行。任何帮助将不胜感激!

PS C:xxxFFMPEG> .YouTubeBatchAudioPlaylistIndexes.bat

C:xxxFFMPEG>call binyoutube-dl.exe -x --audio-format "mp3" --audio-quality 3 --batch-file="songs.txt" --playlist-items 4,6,7,8,10,11,16,17,20,21,23,25,27,28,31,33,36,38,39,41,43,45,46,48,50 -o"C:UsersxxxDownloads%(title)s.%(ext)s" --verbose
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: ['-x', '--audio-format', 'mp3', '--audio-quality', '3', '--batch-file=songs.txt', '--playlist-items', '4,6,7,8,10,11,16,17,20,21,23,25,27,28,31,33,36,38,39,41,43,45,46,48,50', '-oC:\Users\xxx\Downloads\(ext)s', '--verbose']
[debug] Batch file urls: ['https://www.youtube.com/watch?v=anurOHpo0aY&index=4&list=PLlRluznmnq9f7OMI4avwFyV2xMVxlV3_w&t=0s']
Usage: youtube-dl.exe [OPTIONS] URL [URL...]
youtube-dl.exe: error: Cannot download a video and extract audio into the same file! Use "C:UsersxxxDownloads(ext)s.%(ext)s" instead of "C:UsersxxxDownloads(ext)s" as the output template

如果您查看输出,您会发现输出模板中的百分号被吞噬了:

(...) '-oC:\Users\xxx\Downloads\(ext)s', '--verbose']

这是因为在批处理文件中,如果您想要百分号,则需要写入%%,并为call再次将其加倍,如下所示:

call binyoutube-dl.exe -x --audio-format "mp3" --audio-quality 3 ^
     --batch-file="songs.txt" --playlist-items ^
    4,6,7,8,10,11,16,17,20,21,23,25,27,28,31,33,36,38,39,41,43,45,46,48,50 ^
    -o "C:UsersxxxDownloads%%%%(title)s.%%%%(ext)s" --verbose

最新更新