我正在尝试下载bestaudo+bestvideo
高质量的 YouTube 播放列表。它下载了第一个视频,但下载第二个视频时出现错误ERROR: requested format not available
。
问题:
如果传递的质量不可用,如何让 youtube-dl 以其他质量获取第二个视频?
首先我发出了这个命令
youtube-dl -f bestaudio+bestvideo "https://www.youtube.com/playlist?list=PLvwB65U8V0HHCEyW2UTyOJym5FsdqfbHQ"
[youtube:playlist] PLvwB65U8V0HHCEyW2UTyOJym5FsdqfbHQ: Downloading webpage
[download] Downloading playlist: OpenCV Tutorials
[youtube:playlist] playlist OpenCV Tutorials: Downloading 11 videos
[download] Downloading video 1 of 11
[youtube] cgo0UitHfp8: Downloading webpage
[youtube] cgo0UitHfp8: Downloading video info webpage
[youtube] cgo0UitHfp8: Extracting video information
[youtube] cgo0UitHfp8: Downloading MPD manifest
ERROR: The first format must contain the video, try using "-f 136+141"
然后
OpenCV Tutorials [Kyle Hounslow] youtube-dl -f 136+141 "https://www.youtube.com/playlist?list=PLvwB65U8V0HHCEyW2UTyOJym5FsdqfbHQ"
[youtube:playlist] PLvwB65U8V0HHCEyW2UTyOJym5FsdqfbHQ: Downloading webpage
[download] Downloading playlist: OpenCV Tutorials
[youtube:playlist] playlist OpenCV Tutorials: Downloading 11 videos
[download] Downloading video 1 of 11
[youtube] cgo0UitHfp8: Downloading webpage
[youtube] cgo0UitHfp8: Downloading video info webpage
[youtube] cgo0UitHfp8: Extracting video information
[youtube] cgo0UitHfp8: Downloading MPD manifest
[download] OpenCV (All Versions) - Easy Installation Guide and Sample Project (VS 2010 C++)-cgo0UitHfp8.mp4 has already been downloaded and merged
[download] Downloading video 2 of 11
[youtube] OjNClUIDgt8: Downloading webpage
[youtube] OjNClUIDgt8: Downloading video info webpage
[youtube] OjNClUIDgt8: Extracting video information
[youtube] OjNClUIDgt8: Downloading MPD manifest
ERROR: requested format not available
答案1
如第一条错误消息所述:
错误:第一种格式必须包含视频
所以应该不是-f bestvideo+bestaudio
。-f bestaudio+bestvideo
此外,您根本不需要指定任何格式 - 默认情况下将自动下载最佳质量。