3 from .common
import InfoExtractor
11 class HuffPostIE(InfoExtractor
):
12 IE_DESC
= 'Huffington Post'
14 https?://(embed\.)?live\.huffingtonpost\.com/
17 HPLEmbedPlayer/\?segmentId=
20 _EMBED_REGEX
= [r
'<iframe[^>]+?src=(["\'])(?P
<url
>https?
://embed\
.live\
.huffingtonpost\
.com
/.+?
)\
1']
23 'url
': 'http
://live
.huffingtonpost
.com
/r
/segment
/legalese
-it
/52dd3e4b02a7602131000677
',
24 'md5
': '55f5e8981c1c80a64706a44b74833de8
',
26 'id': '52dd3e4b02a7602131000677
',
28 'title
': 'Legalese It
! with
@MikeSacksHP',
29 'description
': 'This week on Legalese It
, Mike talks to David Bosco about his new book on the ICC
, "Rough Justice," he also discusses the Virginia AG
\'s historic stance on gay marriage
, the execution of Edgar Tamayo
, the ICC
\'s delay of Kenya
\'s President
and more
. ',
31 'upload_date
': '20140124',
35 'skip_download
': True,
37 'expected_warnings
': ['HTTP Error
404: Not Found
'],
40 def _real_extract(self, url):
41 video_id = self._match_id(url)
43 api_url = f'http
://embed
.live
.huffingtonpost
.com
/api
/segments
/{video_id}
.json
'
44 data = self._download_json(api_url, video_id)['data
']
46 video_title = data['title
']
47 duration = parse_duration(data.get('running_time
'))
48 upload_date = unified_strdate(
49 data.get('schedule
', {}).get('starts_at
') or data.get('segment_start_date_time
'))
50 description = data.get('description
')
53 for url in filter(None, data['images
'].values()):
54 m = re.match(r'.*-([0-9]+x
[0-9]+)\
.', url)
59 'resolution
': m.group(1),
63 sources = data.get('sources
', {})
64 live_sources = list(sources.get('live
', {}).items()) + list(sources.get('live_again
', {}).items())
65 for key, url in live_sources:
66 ext = determine_ext(url)
68 formats.extend(self._extract_m3u8_formats(
69 url, video_id, ext='mp4
', m3u8_id='hls
', fatal=False))
71 formats.extend(self._extract_f4m_formats(
72 url + '?hdcore
=2.9.5', video_id, f4m_id='hds
', fatal=False))
76 'format_id
': key.replace('/', '.'),
79 'vcodec
': 'none
' if key.startswith('audio
/') else None,
85 'description
': description,
88 'upload_date
': upload_date,
89 'thumbnails
': thumbnails,