mirror of
https://codeberg.org/polarisfm/youtube-dl
synced 2024-11-26 02:14:32 +01:00
[yandexmusic] fetch artist's albums
This commit is contained in:
parent
d7da1e37c7
commit
fe5bcc504f
@ -1456,6 +1456,7 @@ from .yandexmusic import (
|
|||||||
YandexMusicTrackIE,
|
YandexMusicTrackIE,
|
||||||
YandexMusicAlbumIE,
|
YandexMusicAlbumIE,
|
||||||
YandexMusicPlaylistIE,
|
YandexMusicPlaylistIE,
|
||||||
|
YandexMusicArtistIE,
|
||||||
)
|
)
|
||||||
from .yandexvideo import YandexVideoIE
|
from .yandexvideo import YandexVideoIE
|
||||||
from .yapfiles import YapFilesIE
|
from .yapfiles import YapFilesIE
|
||||||
|
@ -311,3 +311,24 @@ class YandexMusicPlaylistIE(YandexMusicPlaylistBaseIE):
|
|||||||
self._build_playlist(tracks),
|
self._build_playlist(tracks),
|
||||||
compat_str(playlist_id),
|
compat_str(playlist_id),
|
||||||
playlist.get('title'), playlist.get('description'))
|
playlist.get('title'), playlist.get('description'))
|
||||||
|
|
||||||
|
|
||||||
|
class YandexMusicArtistIE(YandexMusicPlaylistBaseIE):
|
||||||
|
IE_NAME = 'yandexmusic:artist'
|
||||||
|
IE_DESC = 'Яндекс.Музыка - Артист'
|
||||||
|
_VALID_URL = r'https?://music\.yandex\.(?:ru|kz|ua|by)/artist/(?P<id>\d+)/?(\?|$)'
|
||||||
|
|
||||||
|
def _real_extract(self, url):
|
||||||
|
artist_id = self._match_id(url)
|
||||||
|
|
||||||
|
artist = self._download_json(
|
||||||
|
'http://music.yandex.ru/handlers/artist.jsx?artist=%s' % artist_id,
|
||||||
|
artist_id, 'Downloading artist JSON')
|
||||||
|
|
||||||
|
entries = [
|
||||||
|
self.url_result(
|
||||||
|
'http://music.yandex.ru/album/%s' % (album['id'])
|
||||||
|
) for album in artist['albums']
|
||||||
|
]
|
||||||
|
|
||||||
|
return self.playlist_result(entries)
|
||||||
|
Loading…
Reference in New Issue
Block a user