我使用完全相同的youtube-dl命令,没有播放列表选项来下载单独的音频文件,它起了作用。但是当我将它用于这个播放列表时,我会得到一个错误:无法下载视频并将音频解压缩到同一个文件中!使用"(ext)s.%(ext)s“代替"(ext)s”作为输出模板
运行在windows 10上。任何帮助都将不胜感激!!
PS C:\xxx\FFMPEG> .\YouTubeBatchAudioPlaylistIndexes.bat
C:\xxx\FFMPEG>call bin\youtube-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:\Users\xxx\Downloads\%(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:\Users\xxx\Downloads\(ext)s.%(ext)s" instead of "C:\Users\xxx\Downloads\(ext)s" as the output template发布于 2018-04-14 16:59:47
如果查看输出,就会发现输出模板中的百分比符号被吞噬了:
(...) '-oC:\\Users\\xxx\\Downloads\\(ext)s', '--verbose']这是因为在批处理文件中, if you want a percent sign,对于call来说是加倍的,如下所示:
call bin\youtube-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:\Users\xxx\Downloads\%%%%(title)s.%%%%(ext)s" --verbosehttps://stackoverflow.com/questions/49833527
复制相似问题