From 82f4f60c9b6a7299e97bf53f8446c5b3980c8dd9 Mon Sep 17 00:00:00 2001 From: bashonly Date: Sat, 12 Jul 2025 16:55:36 -0500 Subject: [PATCH] strip whitespace from prefix Authored by: bashonly --- test/test_InfoExtractor.py | 2 +- yt_dlp/extractor/common.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/test/test_InfoExtractor.py b/test/test_InfoExtractor.py index e0b1df9126..7c3825f779 100644 --- a/test/test_InfoExtractor.py +++ b/test/test_InfoExtractor.py @@ -1964,7 +1964,7 @@ def test_search_nextjs_v13_data(self): - + diff --git a/yt_dlp/extractor/common.py b/yt_dlp/extractor/common.py index 3cd0dfa36b..c85949c3c6 100644 --- a/yt_dlp/extractor/common.py +++ b/yt_dlp/extractor/common.py @@ -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))