mirror of
https://github.com/l1ving/youtube-dl
synced 2025-03-07 04:47:17 +08:00
[Rai] Fix extraction (Fix #22846)
Fix for single URL and Playlist like https://www.raiplay.it/video/2019/08/Ricky-Zoom-S1E1-Collaudato-e-sicuro-1193c631-4c4b-4103-9cbd-110f30c1d5c8.html and https://www.raiplay.it/programmi/rickyzoom
This commit is contained in:
parent
2c482bff7c
commit
5537dbf3fa
@ -169,15 +169,17 @@ class RaiPlayIE(RaiBaseIE):
|
|||||||
def _real_extract(self, url):
|
def _real_extract(self, url):
|
||||||
mobj = re.match(self._VALID_URL, url)
|
mobj = re.match(self._VALID_URL, url)
|
||||||
url, video_id = mobj.group('url', 'id')
|
url, video_id = mobj.group('url', 'id')
|
||||||
|
|
||||||
|
json_url = url[:-4] + "json"
|
||||||
|
|
||||||
media = self._download_json(
|
media = self._download_json(
|
||||||
'%s?json' % url, video_id, 'Downloading video JSON')
|
'%s?json' % json_url, video_id, 'Downloading video JSON')
|
||||||
|
|
||||||
title = media['name']
|
title = media['name']
|
||||||
|
|
||||||
video = media['video']
|
video = media['video']
|
||||||
|
|
||||||
relinker_info = self._extract_relinker_info(video['contentUrl'], video_id)
|
relinker_info = self._extract_relinker_info(video['content_url'], video_id)
|
||||||
self._sort_formats(relinker_info['formats'])
|
self._sort_formats(relinker_info['formats'])
|
||||||
|
|
||||||
thumbnails = []
|
thumbnails = []
|
||||||
@ -274,12 +276,19 @@ class RaiPlayPlaylistIE(InfoExtractor):
|
|||||||
('programma', 'nomeProgramma'), webpage, 'title')
|
('programma', 'nomeProgramma'), webpage, 'title')
|
||||||
description = unescapeHTML(self._html_search_meta(
|
description = unescapeHTML(self._html_search_meta(
|
||||||
('description', 'og:description'), webpage, 'description'))
|
('description', 'og:description'), webpage, 'description'))
|
||||||
|
|
||||||
|
json_url = url + ".json"
|
||||||
|
media = self._download_json(
|
||||||
|
'%s?json' % json_url, 'Downloading video JSON')
|
||||||
|
webpage = media['blocks'][0]['sets'][0]['path_id']
|
||||||
|
json_url = "https://www.raiplay.it" + webpage
|
||||||
|
webpage = self._download_webpage(json_url, playlist_id)
|
||||||
|
|
||||||
entries = []
|
entries = []
|
||||||
for mobj in re.finditer(
|
for mobj in re.finditer(
|
||||||
r'<a\b[^>]+\bhref=(["\'])(?P<path>/raiplay/video/.+?)\1',
|
r'"weblink"+\s:+\s"(?P<path>/video/.+?.html)"\s?,\s?"sub',
|
||||||
webpage):
|
webpage):
|
||||||
video_url = urljoin(url, mobj.group('path'))
|
video_url = urljoin("https://www.raiplay.it", mobj.group('path'))
|
||||||
entries.append(self.url_result(
|
entries.append(self.url_result(
|
||||||
video_url, ie=RaiPlayIE.ie_key(),
|
video_url, ie=RaiPlayIE.ie_key(),
|
||||||
video_id=RaiPlayIE._match_id(video_url)))
|
video_id=RaiPlayIE._match_id(video_url)))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user