From 622c5553562eb2e46b36995b758612b545d31dd0 Mon Sep 17 00:00:00 2001 From: Elyse <26639800+elyse0@users.noreply.github.com> Date: Sat, 24 Jun 2023 14:43:50 -0600 Subject: [PATCH] Fix bug after merge --- yt_dlp/__init__.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/yt_dlp/__init__.py b/yt_dlp/__init__.py index 060b3a43f..894f53038 100644 --- a/yt_dlp/__init__.py +++ b/yt_dlp/__init__.py @@ -335,7 +335,7 @@ def parse_chapters(name, value, advanced=False): if advanced and regex == '*from-url': from_url = True continue - elif not regex.startswith('*') or not regex.startswith('#'): + elif not regex.startswith('*') and not regex.startswith('#'): try: chapters.append(re.compile(regex)) except re.error as err: @@ -344,8 +344,7 @@ def parse_chapters(name, value, advanced=False): for range_ in map(str.strip, regex[1:].split(',')): mobj = range_ != '-' and re.fullmatch(TIMESTAMP_RE, range_) - dur = mobj and [parse_timestamp(mobj.group('start') or '0'), - parse_timestamp(mobj.group('end') or 'inf')] + dur = mobj and [parse_timestamp(mobj.group('start') or '0'), parse_timestamp(mobj.group('end') or 'inf')] signs = mobj and (mobj.group('start_sign'), mobj.group('end_sign')) err = None