- description = self._og_search_description(webpage)
- duration = parse_duration(
- self._html_search_meta('duration', webpage, 'duration'))
+ formats = []
+ for video_file in video_info.find('files').iter('file'):
+ video_url = video_file.text
+ if video_url.startswith('/'):
+ continue
+ if video_url.endswith('.m3u8'):
+ formats.extend(self._extract_m3u8_formats(video_url, video_id, m3u8_id='hls'))
+ elif video_url.endswith('.f4m'):
+ formats.extend(self._extract_f4m_formats(video_url + '?hdcore=3.4.1.1', video_id, f4m_id='hds'))
+ else:
+ key = video_file.attrib.get('bitrate')
+ width, height, bitrate = re.search(r'(\d+)x(\d+)(?:_(\d+))?', key).groups()
+ formats.append({
+ 'format_id': key,
+ 'url': video_url,
+ 'width': int_or_none(width),
+ 'height': int_or_none(height),
+ 'tbr': int_or_none(bitrate),
+ })
+ self._sort_formats(formats)