mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-12-02 16:32:51 +01:00
Fix bug after merge
This commit is contained in:
parent
99e6074c5d
commit
622c555356
|
@ -335,7 +335,7 @@ def parse_chapters(name, value, advanced=False):
|
||||||
if advanced and regex == '*from-url':
|
if advanced and regex == '*from-url':
|
||||||
from_url = True
|
from_url = True
|
||||||
continue
|
continue
|
||||||
elif not regex.startswith('*') or not regex.startswith('#'):
|
elif not regex.startswith('*') and not regex.startswith('#'):
|
||||||
try:
|
try:
|
||||||
chapters.append(re.compile(regex))
|
chapters.append(re.compile(regex))
|
||||||
except re.error as err:
|
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(',')):
|
for range_ in map(str.strip, regex[1:].split(',')):
|
||||||
mobj = range_ != '-' and re.fullmatch(TIMESTAMP_RE, range_)
|
mobj = range_ != '-' and re.fullmatch(TIMESTAMP_RE, range_)
|
||||||
dur = mobj and [parse_timestamp(mobj.group('start') or '0'),
|
dur = mobj and [parse_timestamp(mobj.group('start') or '0'), parse_timestamp(mobj.group('end') or 'inf')]
|
||||||
parse_timestamp(mobj.group('end') or 'inf')]
|
|
||||||
signs = mobj and (mobj.group('start_sign'), mobj.group('end_sign'))
|
signs = mobj and (mobj.group('start_sign'), mobj.group('end_sign'))
|
||||||
|
|
||||||
err = None
|
err = None
|
||||||
|
|
Loading…
Reference in New Issue
Block a user