从播放列表下载特定视频
这是Youtube-dl的另一个有用功能。它允许我们从包含数百个视频的播放列表中下载特定的歌曲。
例如,要从播放列表下载第10个文件,请运行:
$ youtube-dl --playlist-items 10 <playlist_url>
同样地,要下载多个随机文件,只需指定播放列表中视频的索引,以逗号分隔,如下所示:
$ youtube-dl --playlist-items 2,3,7,10 <playlist_url>
您还可以指定歌曲范围。要从某个视频,比如第10个视频,开始下载视频播放列表:
$ youtube-dl --playlist-start 10 <playlist_url>
要仅下载播放列表中从第2个到第5个的文件,请使用:
$ youtube-dl --playlist-start 2 --playlist-end 5 <playlist_url>
如果有200个视频的播放列表,并且它在127处卡住了,您应该按照以下相同的顺序使用-ciw来避免在错误期间停止。
youtube-dl -ciw --playlist-start 127 <then past the playlist link after the 127>
要仅下载视频中的音频,请执行以下操作
youtube-dl -ciw -x --audio-format mp3 --playlist-start 127 <then past the playlist link after the 127>
例如:
youtube-dl -ciw -x --audio-format mp3 --playlist-start 127 https://www.youtube.com/playlist?list=PLjzdNLPsCsPeeO49mvhHP5uyKdYkAbON8