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))