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