1 from __future__ import unicode_literals
5 from .common import InfoExtractor
12 class HuffPostIE(InfoExtractor):
13 IE_DESC = 'Huffington Post'
15 https?://(embed\.)?live\.huffingtonpost\.com/
18 HPLEmbedPlayer/\?segmentId=
23 'url': 'http://live.huffingtonpost.com/r/segment/legalese-it/52dd3e4b02a7602131000677',
24 'file': '52dd3e4b02a7602131000677.mp4',
28 'description': 'TODO',
33 def _real_extract(self, url):
34 mobj = re.match(self._VALID_URL, url)
35 video_id = mobj.group('id')
37 api_url = 'http://embed.live.huffingtonpost.com/api/segments/%s.json' % video_id
38 data = self._download_json(api_url, video_id)['data']
40 video_title = data['title']
41 duration = parse_duration(data['running_time'])
42 upload_date = unified_strdate(data['schedule']['started_at'])
45 for url in data['images'].values():
46 m = re.match('.*-([0-9]+x[0-9]+)\.', url)
51 'resolution': m.group(1),
56 'format_id': key.replace('/', '.'),
59 'vcodec': 'none' if key.startswith('audio/') else None,
60 } for key, url in data['sources']['live'].items()]
61 self._sort_formats(formats)
68 'upload_date': upload_date,
69 'thumbnails': thumbnails,