Fix bug after merge

This commit is contained in:
Elyse 2023-06-24 14:43:50 -06:00
parent 99e6074c5d
commit 622c555356

View File

@ -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