- jwconfig = self._search_regex(r'\svar jwconfig = (\{.*?\});\s', embed_script, 'metadata')
- metadata = self._parse_json(jwconfig, video_id)
-
- formats = [{
- 'url': source['file'],
- 'ext': source['type'],
- 'format_id': self._search_regex(r'&format=(.*)$', source['file'], 'video format'),
- 'format': source['label'],
- 'height': int(source['label'].rstrip('p')),
- } for source in metadata['playlist'][0]['sources']]
- self._sort_formats(formats)
+ jwconfig = self._parse_json(self._search_regex(
+ r'initCallback\((.*)\);', embed_script, 'metadata'), video_id)['config']