Compare commits

...

3 Commits

Author SHA1 Message Date
Trigus42
e5a3be2c75
Merge 6f08b513bf into e1b3fa242c 2024-07-28 01:28:57 +09:00
Trigus42
6f08b513bf
Allow for white spaces around ., (, ), [, ] and ,
https://github.com/ytdl-org/youtube-dl/pull/29897#pullrequestreview-744861659
2021-09-02 16:26:49 +02:00
Trigus42
6d88c72317 Fix json.decoder.JSONDecodeError: Extra data
Fix an error that occurs when `webpage` contains a JSON with multiple records.
2021-09-01 16:34:36 +02:00

View File

@ -430,7 +430,10 @@ Format: Layer, Start, End, Style, Name, MarginL, MarginR, MarginV, Effect, Text
if note_m:
raise ExtractorError(note_m)
mobj = re.search(r'Page\.messaging_box_controller\.addItems\(\[(?P<msg>{.+?})\]\)', webpage)
mobj = re.search(
r'Page\s*\.\s*messaging_box_controller\s*\.\s*addItems\s*\(\s*\[\s*(?P<msg>{(?!.*}\s*,\s*{).+?})\s*\]\s*\)',
webpage)
if mobj:
msg = json.loads(mobj.group('msg'))
if msg.get('type') == 'error':