Delegate to RaiPlayIE
This commit is contained in:
parent
7d85663a85
commit
0a3a0abb4b
@ -225,45 +225,13 @@ class RaiPlayLiveIE(RaiBaseIE):
|
|||||||
webpage = self._download_webpage(url, channel)
|
webpage = self._download_webpage(url, channel)
|
||||||
re_id = r'<div([^>]*)data-uniquename=(["\'])[\w-]*(?P<id>%s)(\2)([^>]*?)>' % RaiBaseIE._UUID_RE
|
re_id = r'<div([^>]*)data-uniquename=(["\'])[\w-]*(?P<id>%s)(\2)([^>]*?)>' % RaiBaseIE._UUID_RE
|
||||||
video_id = self._html_search_regex(re_id, webpage, 'livestream-id', group='id')
|
video_id = self._html_search_regex(re_id, webpage, 'livestream-id', group='id')
|
||||||
url = 'http://www.raiplay.it/dirette/ContentItem-%s.html' % video_id
|
|
||||||
|
|
||||||
media = self._download_json(
|
return {
|
||||||
'%s?json' % url, video_id, 'Downloading video JSON')
|
'_type': 'url_transparent',
|
||||||
|
'url': 'http://www.raiplay.it/dirette/ContentItem-%s.html' % video_id,
|
||||||
title = media['name']
|
'ie_key': RaiPlayIE.ie_key()
|
||||||
video = media['video']
|
|
||||||
|
|
||||||
relinker_info = self._extract_relinker_info(video['contentUrl'], video_id)
|
|
||||||
self._sort_formats(relinker_info['formats'])
|
|
||||||
|
|
||||||
thumbnails = []
|
|
||||||
if 'images' in media:
|
|
||||||
for _, value in media.get('images').items():
|
|
||||||
if value:
|
|
||||||
thumbnails.append({
|
|
||||||
'url': value.replace('[RESOLUTION]', '600x400')
|
|
||||||
})
|
|
||||||
|
|
||||||
timestamp = unified_timestamp(try_get(
|
|
||||||
media, lambda x: x['availabilities'][0]['start'], compat_str))
|
|
||||||
|
|
||||||
subtitles = self._extract_subtitles(url, video.get('subtitles'))
|
|
||||||
|
|
||||||
info = {
|
|
||||||
'id': video_id,
|
|
||||||
'title': title,
|
|
||||||
'alt_title': media.get('subtitle'),
|
|
||||||
'description': media.get('description'),
|
|
||||||
'uploader': media.get('channel'),
|
|
||||||
'creator': media.get('editor'),
|
|
||||||
'timestamp': timestamp,
|
|
||||||
'thumbnails': thumbnails,
|
|
||||||
'subtitles': subtitles,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
info.update(relinker_info)
|
|
||||||
return info
|
|
||||||
|
|
||||||
|
|
||||||
class RaiIE(RaiBaseIE):
|
class RaiIE(RaiBaseIE):
|
||||||
_VALID_URL = r'https?://[^/]+\.(?:rai\.(?:it|tv)|rainews\.it)/dl/.+?-(?P<id>%s)(?:-.+?)?\.html' % RaiBaseIE._UUID_RE
|
_VALID_URL = r'https?://[^/]+\.(?:rai\.(?:it|tv)|rainews\.it)/dl/.+?-(?P<id>%s)(?:-.+?)?\.html' % RaiBaseIE._UUID_RE
|
||||||
|
Loading…
x
Reference in New Issue
Block a user