# Get JSON parameters
json_params = self._search_regex(
- r'var currentVideo = new Video\((.*)\)[,;]',
+ [r'videoJa?son\s*=\s*({.+})',
+ r'var\s+currentVideo\s*=\s*new\s+Video\((.+?)\)[,;]'],
webpage, 'JSON parameters')
try:
params = json.loads(json_params)
- except:
+ except ValueError:
raise ExtractorError('Invalid JSON')
self.report_extraction(video_id)