Skip to content

Commit

Permalink
[webvtt] Allow spaces before newlines for CueBlock (#7681)
Browse files Browse the repository at this point in the history
  • Loading branch information
TSRBerry committed Nov 28, 2023
1 parent 9751a45 commit 15f22b4
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions yt_dlp/webvtt.py
Expand Up @@ -95,6 +95,7 @@ def __init__(self, parser):
_REGEX_EOF = re.compile(r'\Z')
_REGEX_NL = re.compile(r'(?:\r\n|[\r\n]|$)')
_REGEX_BLANK = re.compile(r'(?:\r\n|[\r\n])+')
_REGEX_OPTIONAL_WHITESPACE = re.compile(r'[ \t]*')


def _parse_ts(ts):
Expand Down Expand Up @@ -285,6 +286,7 @@ def parse(cls, parser):
m1 = parser.consume(_REGEX_TS)
if not m1:
return None
parser.consume(_REGEX_OPTIONAL_WHITESPACE)
m2 = parser.consume(cls._REGEX_SETTINGS)
if not parser.consume(_REGEX_NL):
return None
Expand Down

0 comments on commit 15f22b4

Please sign in to comment.