我想从Youtube下载一个完整的播放列表,但我也不希望它从播放列表中下载特定的视频。我事先知道这些视频的链接和名称,因此可以将这些信息提供给youtube-dl。
到目前为止,我拥有的最好的解决方案是下载播放列表,然后运行一个shell脚本来删除不想要的视频。这显然是非常有限的(每次我尝试下载添加到播放列表中的新视频时,都会下载该视频)
是否可以要求youtube-dl直接通过命令行或文件忽略特定的视频(包含不想要的视频的名称或urls )?
发布于 2020-12-24 14:35:03
是。
中。
youtube-dl -ij --flat-playlist "your_playlist" | jq -r '"https://youtu.be/\(.id)"' > listurl.txt
grep -vf unwanted.txt listurl.txt > download.txt
youtube-dl -ia download.txt
发布于 2022-06-14 12:56:04
是的,您可以通过传递以下标志来做到这一点。
--playlist-start NUMBER Playlist video to start at (default is
1)
--playlist-end NUMBER Playlist video to end at (default is
last)
--playlist-items ITEM_SPEC Playlist video items to download.
Specify indices of the videos in the
playlist separated by commas like: "--
playlist-items 1,2,5,8" if you want to
download videos indexed 1, 2, 5, 8 in
the playlist. You can specify range: "
--playlist-items 1-3,7,10-13", it will
download the videos at index 1, 2, 3,
7, 10, 11, 12 and 13.
https://stackoverflow.com/questions/65221611
复制相似问题