mirror of
https://github.com/l1ving/youtube-dl
synced 2025-03-13 09:57:21 +08:00
add playlist-skip option
This commit is contained in:
parent
7073015a23
commit
15434866f7
@ -174,6 +174,8 @@ Alternatively, refer to the [developer instructions](#developer-instructions) fo
|
||||
downloaded videos in it.
|
||||
--include-ads Download advertisements as well
|
||||
(experimental)
|
||||
--playlist-skip Skip over playlist items that fail to
|
||||
download.
|
||||
|
||||
## Download Options:
|
||||
-r, --limit-rate RATE Maximum download rate in bytes per second
|
||||
|
@ -164,6 +164,7 @@ class YoutubeDL(object):
|
||||
playlist_items: Specific indices of playlist to download.
|
||||
playlistreverse: Download playlist items in reverse order.
|
||||
playlistrandom: Download playlist items in random order.
|
||||
playlistskip: Skip over playlist items that fail to download.
|
||||
matchtitle: Download only matching titles.
|
||||
rejecttitle: Reject downloads for matching titles.
|
||||
logger: Log messages to a logging.Logger instance.
|
||||
@ -957,9 +958,16 @@ class YoutubeDL(object):
|
||||
self.to_screen('[download] ' + reason)
|
||||
continue
|
||||
|
||||
entry_result = self.process_ie_result(entry,
|
||||
download=download,
|
||||
extra_info=extra)
|
||||
try:
|
||||
entry_result = self.process_ie_result(entry,
|
||||
download=download,
|
||||
extra_info=extra)
|
||||
except DownloadError:
|
||||
if self.params.get('playlistskip'):
|
||||
continue
|
||||
else:
|
||||
raise
|
||||
|
||||
playlist_results.append(entry_result)
|
||||
ie_result['entries'] = playlist_results
|
||||
self.to_screen('[download] Finished downloading playlist: %s' % playlist)
|
||||
|
@ -353,6 +353,7 @@ def _real_main(argv=None):
|
||||
'playlistend': opts.playlistend,
|
||||
'playlistreverse': opts.playlist_reverse,
|
||||
'playlistrandom': opts.playlist_random,
|
||||
'playlistskip': opts.playlist_skip,
|
||||
'noplaylist': opts.noplaylist,
|
||||
'logtostderr': opts.outtmpl == '-',
|
||||
'consoletitle': opts.consoletitle,
|
||||
|
@ -492,6 +492,10 @@ def parseOpts(overrideArguments=None):
|
||||
'--playlist-random',
|
||||
action='store_true',
|
||||
help='Download playlist videos in random order')
|
||||
selection.add_option(
|
||||
'--playlist-skip',
|
||||
action='store_true',
|
||||
help='Skip over playlist items that fail to download.')
|
||||
downloader.add_option(
|
||||
'--xattr-set-filesize',
|
||||
dest='xattr_set_filesize', action='store_true',
|
||||
|
Loading…
x
Reference in New Issue
Block a user