[tvplay] Fixed non-fatal bug when extracting JSON data

This commit is contained in:
Forthrin 2019-05-08 08:56:07 +02:00
parent 71ebd35d50
commit c61b56ee47

View File

@ -414,10 +414,10 @@ class ViafreeIE(InfoExtractor):
data = self._parse_json(
self._search_regex(
r'(?s)window\.App\s*=\s*({.+?})\s*;\s*</script',
r'(?s)window\.App\s*=\s*({.+?});\s*window\.',
webpage, 'data', default='{}'),
video_id, transform_source=lambda x: re.sub(
r'(?s)function\s+[a-zA-Z_][\da-zA-Z_]*\s*\([^)]*\)\s*{[^}]*}\s*',
r'(?s)(?<=":)function.+?}(?=,")',
'null', x), fatal=False)
video_id = None