mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-23 02:25:11 +00:00
Fix bug in 23326151c4
This commit is contained in:
parent
b5899f4f19
commit
c4a62b99f6
1 changed files with 3 additions and 3 deletions
|
@ -251,7 +251,7 @@ def parse_retries(name, value):
|
||||||
def parse_sleep_func(expr):
|
def parse_sleep_func(expr):
|
||||||
NUMBER_RE = r'\d+(?:\.\d+)?'
|
NUMBER_RE = r'\d+(?:\.\d+)?'
|
||||||
op, start, limit, step, *_ = tuple(re.fullmatch(
|
op, start, limit, step, *_ = tuple(re.fullmatch(
|
||||||
rf'(?:(linear|exp)=)?({NUMBER_RE})(?::({NUMBER_RE}))?(?::({NUMBER_RE}))?',
|
rf'(?:(linear|exp)=)?({NUMBER_RE})(?::({NUMBER_RE})?)?(?::({NUMBER_RE}))?',
|
||||||
expr.strip()).groups()) + (None, None)
|
expr.strip()).groups()) + (None, None)
|
||||||
|
|
||||||
if op == 'exp':
|
if op == 'exp':
|
||||||
|
@ -266,8 +266,8 @@ def parse_sleep_func(expr):
|
||||||
continue
|
continue
|
||||||
try:
|
try:
|
||||||
opts.retry_sleep[key] = parse_sleep_func(expr)
|
opts.retry_sleep[key] = parse_sleep_func(expr)
|
||||||
except AttributeError as e:
|
except AttributeError:
|
||||||
raise ValueError(f'invalid {key} retry sleep expression {expr!r}: {e}')
|
raise ValueError(f'invalid {key} retry sleep expression {expr!r}')
|
||||||
|
|
||||||
# Bytes
|
# Bytes
|
||||||
def parse_bytes(name, value):
|
def parse_bytes(name, value):
|
||||||
|
|
Loading…
Reference in a new issue