mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2026-05-10 17:35:54 +00:00
Make sure the retry options are positive or 0.
This commit is contained in:
parent
0b6b7742c2
commit
cac5eedcfc
@ -261,9 +261,11 @@ def validate_options(opts):
|
|||||||
elif value in ('inf', 'infinite'):
|
elif value in ('inf', 'infinite'):
|
||||||
return float('inf')
|
return float('inf')
|
||||||
try:
|
try:
|
||||||
return int(value)
|
ival = int(value)
|
||||||
except (TypeError, ValueError):
|
except (TypeError, ValueError):
|
||||||
validate(False, f'{name} retry count', value)
|
validate(False, f'{name} retry count', value)
|
||||||
|
validate_positive(f'{name} retry count', ival)
|
||||||
|
return ival
|
||||||
|
|
||||||
opts.retries = parse_retries('download', opts.retries)
|
opts.retries = parse_retries('download', opts.retries)
|
||||||
opts.fragment_retries = parse_retries('fragment', opts.fragment_retries)
|
opts.fragment_retries = parse_retries('fragment', opts.fragment_retries)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user