From 9fb4a935411aac4b54ff08788fbc266cab9f7298 Mon Sep 17 00:00:00 2001 From: TinyFix <58607977+TinyFix@users.noreply.github.com> Date: Fri, 6 Dec 2019 22:29:38 +0300 Subject: [PATCH] fix for albums/podcasts with empty artist list --- youtube_dl/extractor/yandexmusic.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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