diff --git a/yt_dlp/__init__.py b/yt_dlp/__init__.py index 4ebdff298..c31f9f9e0 100644 --- a/yt_dlp/__init__.py +++ b/yt_dlp/__init__.py @@ -322,9 +322,10 @@ def validate_outtmpl(tmpl, msg): def parse_chapters(name, value): def parse_timestamp(x): - # FIXME: This should be smarter, e.g. 'inf-1day'? + # FIXME: Maybe there's a better way to remove parenthesis x = x.replace('(', '').replace(')', '') + # FIXME: This should be smarter, e.g. 'inf-1day'? if x in ('inf', 'infinite'): return float('inf') @@ -337,7 +338,7 @@ def parse_timestamp(x): for regex in value or []: if regex.startswith('*'): for range_ in map(str.strip, regex[1:].split(',')): - # FIXME: This is really sensible + # FIXME: This should match correctly '(now-1hour)-(now-20minutes)' mobj = range_ != '-' and re.fullmatch(r'(.+)?\s*-\s*(.+)?', range_) dur = mobj and (parse_timestamp(mobj.group(1) or '0'), parse_timestamp(mobj.group(2) or 'inf')) if None in (dur or [None]):