Skip to content

Commit

Permalink
[webvtt] Allow spaces before newlines for CueBlock (yt-dlp#7681)
Browse files Browse the repository at this point in the history
  • Loading branch information
TSRBerry authored and aalsuwaidi committed Apr 21, 2024
1 parent d196385 commit 4e7fe81
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions yt_dlp/webvtt.py
Original file line number Diff line number Diff line change
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 4e7fe81

Please sign in to comment.