From c4a62b99f682bac966ede4a58d1b20f0f3f49f1e Mon Sep 17 00:00:00 2001 From: pukkandan Date: Sun, 22 May 2022 17:26:43 +0530 Subject: [PATCH] Fix bug in 23326151c45b632c3d5948bd018e80abb370e676 --- yt_dlp/__init__.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yt_dlp/__init__.py b/yt_dlp/__init__.py index 180b92a11..66fee95cd 100644 --- a/yt_dlp/__init__.py +++ b/yt_dlp/__init__.py @@ -251,7 +251,7 @@ def parse_retries(name, value): def parse_sleep_func(expr): NUMBER_RE = r'\d+(?:\.\d+)?' 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) if op == 'exp': @@ -266,8 +266,8 @@ def parse_sleep_func(expr): continue try: opts.retry_sleep[key] = parse_sleep_func(expr) - except AttributeError as e: - raise ValueError(f'invalid {key} retry sleep expression {expr!r}: {e}') + except AttributeError: + raise ValueError(f'invalid {key} retry sleep expression {expr!r}') # Bytes def parse_bytes(name, value):