1
0
mirror of https://codeberg.org/polarisfm/youtube-dl synced 2024-11-30 04:08:01 +01:00

Use a uid instead of a URL

This commit is contained in:
Francesco Frassinelli 2020-03-17 23:56:14 +01:00
parent e918882d29
commit a58aafd664

View File

@ -528,8 +528,8 @@ class RaiPlayRadioBaseIE(InfoExtractor):
parser.close()
return parser.items
def get_playlist_iter(self, url):
webpage = self._download_webpage(url, url)
def get_playlist_iter(self, url, uid):
webpage = self._download_webpage(url, uid)
for attrs in self.parse_list(webpage):
title = attrs['data-title'].strip()
webpage = urljoin(url, attrs['data-mediapolis'])
@ -564,9 +564,10 @@ class RaiPlayRadioIE(RaiPlayRadioBaseIE):
'language': 'it'}}
def _real_extract(self, url):
audio_id = self._match_id(url)
list_url = url.replace('.html', '-list.html')
for entry in self.get_playlist_iter(list_url):
if entry['id'] == self._match_id(url):
for entry in self.get_playlist_iter(list_url, audio_id):
if entry['id'] == audio_id:
return entry
@ -597,7 +598,7 @@ class RaiPlayRadioPlaylistIE(RaiPlayRadioBaseIE):
r'data-player-href="(.+?)"', playlist_webpage, 'href')
list_url = urljoin(url, player_href)
entries = self.get_playlist(list_url)
entries = self.get_playlist(list_url, playlist_id)
for index, entry in enumerate(entries, start=1):
entry.update({
'track': entry['title'],