mirror of
https://github.com/ytdl-org/youtube-dl.git
synced 2024-12-01 06:27:44 +00:00
[yandexmusic:album] Improve album title extraction (closes #27418)
This commit is contained in:
parent
679b711395
commit
9c33eb027e
1 changed files with 12 additions and 1 deletions
|
@ -260,6 +260,14 @@ class YandexMusicAlbumIE(YandexMusicPlaylistBaseIE):
|
||||||
},
|
},
|
||||||
'playlist_count': 33,
|
'playlist_count': 33,
|
||||||
# 'skip': 'Travis CI servers blocked by YandexMusic',
|
# 'skip': 'Travis CI servers blocked by YandexMusic',
|
||||||
|
}, {
|
||||||
|
# empty artists
|
||||||
|
'url': 'https://music.yandex.ru/album/9091882',
|
||||||
|
'info_dict': {
|
||||||
|
'id': '9091882',
|
||||||
|
'title': 'ТЕД на русском',
|
||||||
|
},
|
||||||
|
'playlist_count': 187,
|
||||||
}]
|
}]
|
||||||
|
|
||||||
def _real_extract(self, url):
|
def _real_extract(self, url):
|
||||||
|
@ -273,7 +281,10 @@ class YandexMusicAlbumIE(YandexMusicPlaylistBaseIE):
|
||||||
|
|
||||||
entries = self._build_playlist([track for volume in album['volumes'] for track in volume])
|
entries = self._build_playlist([track for volume in album['volumes'] for track in volume])
|
||||||
|
|
||||||
title = '%s - %s' % (album['artists'][0]['name'], album['title'])
|
title = album['title']
|
||||||
|
artist = try_get(album, lambda x: x['artists'][0]['name'], compat_str)
|
||||||
|
if artist:
|
||||||
|
title = '%s - %s' % (artist, title)
|
||||||
year = album.get('year')
|
year = album.get('year')
|
||||||
if year:
|
if year:
|
||||||
title += ' (%s)' % year
|
title += ' (%s)' % year
|
||||||
|
|
Loading…
Reference in a new issue