mirror of
https://codeberg.org/polarisfm/youtube-dl
synced 2024-12-02 05:07:55 +01:00
Use a uid instead of a URL
This commit is contained in:
parent
e918882d29
commit
a58aafd664
@ -528,8 +528,8 @@ class RaiPlayRadioBaseIE(InfoExtractor):
|
|||||||
parser.close()
|
parser.close()
|
||||||
return parser.items
|
return parser.items
|
||||||
|
|
||||||
def get_playlist_iter(self, url):
|
def get_playlist_iter(self, url, uid):
|
||||||
webpage = self._download_webpage(url, url)
|
webpage = self._download_webpage(url, uid)
|
||||||
for attrs in self.parse_list(webpage):
|
for attrs in self.parse_list(webpage):
|
||||||
title = attrs['data-title'].strip()
|
title = attrs['data-title'].strip()
|
||||||
webpage = urljoin(url, attrs['data-mediapolis'])
|
webpage = urljoin(url, attrs['data-mediapolis'])
|
||||||
@ -564,9 +564,10 @@ class RaiPlayRadioIE(RaiPlayRadioBaseIE):
|
|||||||
'language': 'it'}}
|
'language': 'it'}}
|
||||||
|
|
||||||
def _real_extract(self, url):
|
def _real_extract(self, url):
|
||||||
|
audio_id = self._match_id(url)
|
||||||
list_url = url.replace('.html', '-list.html')
|
list_url = url.replace('.html', '-list.html')
|
||||||
for entry in self.get_playlist_iter(list_url):
|
for entry in self.get_playlist_iter(list_url, audio_id):
|
||||||
if entry['id'] == self._match_id(url):
|
if entry['id'] == audio_id:
|
||||||
return entry
|
return entry
|
||||||
|
|
||||||
|
|
||||||
@ -597,7 +598,7 @@ class RaiPlayRadioPlaylistIE(RaiPlayRadioBaseIE):
|
|||||||
r'data-player-href="(.+?)"', playlist_webpage, 'href')
|
r'data-player-href="(.+?)"', playlist_webpage, 'href')
|
||||||
list_url = urljoin(url, player_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):
|
for index, entry in enumerate(entries, start=1):
|
||||||
entry.update({
|
entry.update({
|
||||||
'track': entry['title'],
|
'track': entry['title'],
|
||||||
|
Loading…
Reference in New Issue
Block a user