1
0
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:
Tobias Bengfort 2017-05-16 09:07:26 +02:00
parent 7073015a23
commit 15434866f7
4 changed files with 18 additions and 3 deletions

View File

@ -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

View File

@ -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)

View File

@ -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,

View File

@ -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',