-# coding: utf-8
-from __future__ import unicode_literals
-
from .common import InfoExtractor
-from ..utils import (
- int_or_none,
- try_get
-)
+from ..utils import int_or_none, try_get
class OlympicsReplayIE(InfoExtractor):
'upload_date': '20210801',
'timestamp': 1627783200,
'description': 'md5:c66af4a5bc7429dbcc43d15845ff03b3',
+ 'uploader': 'International Olympic Committee',
},
'params': {
- 'format': 'bestvideo',
'skip_download': True,
},
}, {
}]
def _real_extract(self, url):
- id = self._match_id(url)
+ video_id = self._match_id(url)
- webpage = self._download_webpage(url, id)
+ webpage = self._download_webpage(url, video_id)
title = self._html_search_meta(('title', 'og:title', 'twitter:title'), webpage)
uuid = self._html_search_meta('episode_uid', webpage)
m3u8_url = self._html_search_meta('video_url', webpage)
thumbnails.append({
'url': thumbnail,
'width': width,
- 'height': int_or_none(try_get(width, lambda x: x * height_a / width_a))
+ 'height': int_or_none(try_get(width, lambda x: x * height_a / width_a)),
})
m3u8_url = self._download_json(
f'https://olympics.com/tokenGenerator?url={m3u8_url}', uuid, note='Downloading m3u8 url')
- formats, subtitles = self._extract_m3u8_formats_and_subtitles(m3u8_url, uuid, m3u8_id='hls')
- self._sort_formats(formats)
+ formats, subtitles = self._extract_m3u8_formats_and_subtitles(m3u8_url, uuid, 'mp4', m3u8_id='hls')
return {
'id': uuid,
'title': title,
- 'timestamp': json_ld.get('timestamp'),
- 'description': json_ld.get('description'),
'thumbnails': thumbnails,
- 'duration': json_ld.get('duration'),
'formats': formats,
'subtitles': subtitles,
+ **json_ld,
}