mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2025-12-26 17:41:46 +00:00
Merge branch 'master' into wait-retries
This commit is contained in:
@@ -231,9 +231,11 @@ def validate_options(opts):
|
||||
elif value in ('inf', 'infinite'):
|
||||
return float('inf')
|
||||
try:
|
||||
return int(value)
|
||||
int_value = int(value)
|
||||
except (TypeError, ValueError):
|
||||
validate(False, f'{name} retry count', value)
|
||||
validate_positive(f'{name} retry count', int_value)
|
||||
return int_value
|
||||
|
||||
def parse_range_with_arg(name, arg_name, value,
|
||||
parse_limits=parse_duration, parse_arg=parse_retries):
|
||||
@@ -253,7 +255,6 @@ def validate_options(opts):
|
||||
if opts.wait_for_video is not None:
|
||||
min_wait, max_wait, wait_retries = parse_range_with_arg(
|
||||
'time range to wait for video', 'waiting', opts.wait_for_video)
|
||||
validate_positive('waiting retry count', wait_retries)
|
||||
opts.wait_for_video = (min_wait, max_wait, wait_retries)
|
||||
|
||||
# Format sort
|
||||
|
||||
Reference in New Issue
Block a user