diff --git a/youtube_dl/extractor/yandexmusic.py b/youtube_dl/extractor/yandexmusic.py index 08d35e04c..5c4f8ae13 100644 --- a/youtube_dl/extractor/yandexmusic.py +++ b/youtube_dl/extractor/yandexmusic.py @@ -219,7 +219,9 @@ class YandexMusicAlbumIE(YandexMusicPlaylistBaseIE): entries = self._build_playlist([track for volume in album['volumes'] for track in volume]) - title = '%s - %s' % (album['artists'][0]['name'], album['title']) + artists = album['artists'] + artist_name = artists[0]['name'] if artists else "UnknownArtist" + title = '%s - %s' % (artist_name, album['title']) year = album.get('year') if year: title += ' (%s)' % year