mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-23 00:52:01 +00:00
Option --break-per-input
to apply --break-on... to each input URL
This commit is contained in:
parent
5e5be0c0b2
commit
b222c27145
@ -310,6 +310,8 @@ class YoutubeDL(object):
|
|||||||
file that is in the archive.
|
file that is in the archive.
|
||||||
break_on_reject: Stop the download process when encountering a video that
|
break_on_reject: Stop the download process when encountering a video that
|
||||||
has been filtered out.
|
has been filtered out.
|
||||||
|
break_per_url: Whether break_on_reject and break_on_existing
|
||||||
|
should act on each input URL as opposed to for the entire queue
|
||||||
cookiefile: File name where cookies should be read from and dumped to
|
cookiefile: File name where cookies should be read from and dumped to
|
||||||
cookiesfrombrowser: A tuple containing the name of the browser and the profile
|
cookiesfrombrowser: A tuple containing the name of the browser and the profile
|
||||||
name/path from where cookies are loaded.
|
name/path from where cookies are loaded.
|
||||||
@ -2968,8 +2970,12 @@ def wrapper(*args, **kwargs):
|
|||||||
res = func(*args, **kwargs)
|
res = func(*args, **kwargs)
|
||||||
except UnavailableVideoError as e:
|
except UnavailableVideoError as e:
|
||||||
self.report_error(e)
|
self.report_error(e)
|
||||||
|
except MaxDownloadsReached as e:
|
||||||
|
self.to_screen(f'[info] {e}')
|
||||||
|
raise
|
||||||
except DownloadCancelled as e:
|
except DownloadCancelled as e:
|
||||||
self.to_screen(f'[info] {e}')
|
self.to_screen(f'[info] {e}')
|
||||||
|
if not self.params.get('break_per_url'):
|
||||||
raise
|
raise
|
||||||
else:
|
else:
|
||||||
if self.params.get('dump_single_json', False):
|
if self.params.get('dump_single_json', False):
|
||||||
|
@ -701,6 +701,7 @@ def report_args_compat(arg, name):
|
|||||||
'download_archive': download_archive_fn,
|
'download_archive': download_archive_fn,
|
||||||
'break_on_existing': opts.break_on_existing,
|
'break_on_existing': opts.break_on_existing,
|
||||||
'break_on_reject': opts.break_on_reject,
|
'break_on_reject': opts.break_on_reject,
|
||||||
|
'break_per_url': opts.break_per_url,
|
||||||
'skip_playlist_after_errors': opts.skip_playlist_after_errors,
|
'skip_playlist_after_errors': opts.skip_playlist_after_errors,
|
||||||
'cookiefile': opts.cookiefile,
|
'cookiefile': opts.cookiefile,
|
||||||
'cookiesfrombrowser': opts.cookiesfrombrowser,
|
'cookiesfrombrowser': opts.cookiesfrombrowser,
|
||||||
|
@ -449,6 +449,14 @@ def _dict_from_options_callback(
|
|||||||
'--break-on-reject',
|
'--break-on-reject',
|
||||||
action='store_true', dest='break_on_reject', default=False,
|
action='store_true', dest='break_on_reject', default=False,
|
||||||
help='Stop the download process when encountering a file that has been filtered out')
|
help='Stop the download process when encountering a file that has been filtered out')
|
||||||
|
selection.add_option(
|
||||||
|
'--break-per-input',
|
||||||
|
action='store_true', dest='break_per_url', default=False,
|
||||||
|
help='Make --break-on-existing and --break-on-reject act only on the current input URL')
|
||||||
|
selection.add_option(
|
||||||
|
'--no-break-per-input',
|
||||||
|
action='store_false', dest='break_per_url',
|
||||||
|
help='--break-on-existing and --break-on-reject terminates the entire download queue')
|
||||||
selection.add_option(
|
selection.add_option(
|
||||||
'--skip-playlist-after-errors', metavar='N',
|
'--skip-playlist-after-errors', metavar='N',
|
||||||
dest='skip_playlist_after_errors', default=None, type=int,
|
dest='skip_playlist_after_errors', default=None, type=int,
|
||||||
|
Loading…
Reference in New Issue
Block a user