- self._html_search_regex(r'iframe src="(?P<frame>.*?)"', webpage, 'video frame'),
- video_id)
- video_url = self._html_search_regex(
- r"v_path = '(?P<vid>http://.*?)'", iframe, 'url')
- thumb_url = self._html_search_regex(
- r"t_path = '(?P<thumb>http://.*?)'", iframe, 'thumbnail', fatal=False)
+ iframe_url, video_id, headers={'User-Agent': 'curl/7.50.1'},
+ note='Downloading video frame')
+ video_data = self._parse_json(self._search_regex(
+ r'video_data\s*=\s*([^;]+);', iframe, 'video data'), video_id)
+
+ formats = [{
+ 'url': source,
+ 'height': int_or_none(resolution),
+ } for source, resolution in zip(
+ video_data['sources'], video_data.get('resolutions', itertools.repeat(None)))]
+
+ self._sort_formats(formats)