如何使用youtube dl脚本从播放列表中的某个索引开始下载?

2024-05-20 00:04:42 发布

您现在位置:Python中文网/ 问答频道 /正文

如何使用youtube-dl将播放列表从起始的某个数字下载到上限?

我试图在代码中使用:

youtube-dl -o '~/Documents/%(playlist)s/%(chapter_number)s - %(chapter)s/%(playlist_index)s - %(title)s.%(ext)s' URL
它在中间停了下来。我想从第i个编号的视频重新启动进程,而不是从头开始。


Tags: 代码urlnumberindex视频titleyoutube数字
2条回答

我的播放列表中总共有135个视频。我已经成功下载了38个。所以我手动使用了这个命令。

youtube-dl --playlist-start 39 -u uname@gmail.com -p mypassword https://www.udemy.com/learn-ethical-hacking-from-scratch/learn/v4/content

它正在下载我剩下的97个视频。

youtube-dl --help包含:

...

  Video Selection:
    --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.

...

因此,选项--playlist-start NUMBER应该可以帮助您在中间启动播放列表,由NUMBER指定。

相关问题 更多 >