2 from __future__ import unicode_literals
4 from .common import InfoExtractor
11 class UFCTVIE(InfoExtractor):
12 _VALID_URL = r'https?://(?:www\.)?ufc\.tv/video/(?P<id>[^/]+)'
14 'url': 'https://www.ufc.tv/video/ufc-219-countdown-full-episode',
18 'title': 'UFC 219 Countdown: Full Episode',
19 'description': 'md5:26d4e8bf4665ae5878842d7050c3c646',
20 'timestamp': 1513962360,
21 'upload_date': '20171222',
25 'skip_download': True,
29 def _real_extract(self, url):
30 display_id = self._match_id(url)
31 video_data = self._download_json(url, display_id, query={
34 video_id = str(video_data['id'])
35 title = video_data['name']
36 m3u8_url = self._download_json(
37 'https://www.ufc.tv/service/publishpoint', video_id, query={
42 'User-Agent': 'Mozilla/5.0 (iPhone; CPU iPhone OS 11_0_1 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/11.0 Mobile/15A402 Safari/604.1',
44 m3u8_url = m3u8_url.replace('_iphone.', '.')
45 formats = self._extract_m3u8_formats(m3u8_url, video_id, 'mp4')
46 self._sort_formats(formats)
51 'description': video_data.get('description'),
52 'duration': parse_duration(video_data.get('runtime')),
53 'timestamp': parse_iso8601(video_data.get('releaseDate')),