1
0
mirror of https://github.com/yt-dlp/yt-dlp.git synced 2025-07-27 07:38:30 +00:00

strip whitespace from prefix

Authored by: bashonly
This commit is contained in:
bashonly 2025-07-12 16:55:36 -05:00
parent 861c487b1f
commit 82f4f60c9b
No known key found for this signature in database
GPG Key ID: 783F096F253D15B0
2 changed files with 2 additions and 2 deletions

View File

@ -1824,7 +1824,7 @@ def flatten(flight_data):
for f in flight_text.splitlines():
prefix, _, body = f.partition(':')
if body.startswith('[') and body.endswith(']') and re.fullmatch(r'[0-9a-f]{1,3}', prefix):
if body.startswith('[') and body.endswith(']') and re.fullmatch(r'[0-9a-f]{1,3}', prefix.strip()):
# The body isn't necessarily valid JSON, so this should always be non-fatal
flatten(self._parse_json(body, video_id, fatal=False, errnote=False))