首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >youtube-dl错误:无法下载视频并将音频解压缩到同一个文件中。

youtube-dl错误:无法下载视频并将音频解压缩到同一个文件中。
EN

Stack Overflow用户
提问于 2018-04-14 16:15:49
回答 1查看 5.3K关注 0票数 1

我使用完全相同的youtube-dl命令,没有播放列表选项来下载单独的音频文件,它起了作用。但是当我将它用于这个播放列表时,我会得到一个错误:无法下载视频并将音频解压缩到同一个文件中!使用"(ext)s.%(ext)s“代替"(ext)s”作为输出模板

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

代码语言:javascript
复制
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
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2018-04-14 16:59:47

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

代码语言:javascript
复制
(...) '-oC:\\Users\\xxx\\Downloads\\(ext)s', '--verbose']

这是因为在批处理文件中, if you want a percent sign,对于call来说是加倍的,如下所示:

代码语言:javascript
复制
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
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/49833527

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档