mirror of
https://github.com/l1ving/youtube-dl
synced 2025-03-07 05:17: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
@ -170,14 +170,16 @@ class RaiPlayIE(RaiBaseIE):
|
||||
mobj = re.match(self._VALID_URL, url)
|
||||
url, video_id = mobj.group('url', 'id')
|
||||
|
||||
json_url = url[:-4] + "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']
|
||||
|
||||
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'])
|
||||
|
||||
thumbnails = []
|
||||
@ -275,11 +277,18 @@ class RaiPlayPlaylistIE(InfoExtractor):
|
||||
description = unescapeHTML(self._html_search_meta(
|
||||
('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 = []
|
||||
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):
|
||||
video_url = urljoin(url, mobj.group('path'))
|
||||
video_url = urljoin("https://www.raiplay.it", mobj.group('path'))
|
||||
entries.append(self.url_result(
|
||||
video_url, ie=RaiPlayIE.ie_key(),
|
||||
video_id=RaiPlayIE._match_id(video_url)))
|
||||
|
Loading…
x
Reference in New Issue
Block a user