1
0
mirror of https://codeberg.org/polarisfm/youtube-dl synced 2024-11-22 16:44:32 +01:00

fix for albums/podcasts with empty artist list

This commit is contained in:
TinyFix 2019-12-06 22:29:38 +03:00 committed by GitHub
parent 1d31b7ca04
commit 9fb4a93541
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -219,7 +219,9 @@ 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']) artists = album['artists']
artist_name = artists[0]['name'] if artists else "UnknownArtist"
title = '%s - %s' % (artist_name, album['title'])
year = album.get('year') year = album.get('year')
if year: if year:
title += ' (%s)' % year title += ' (%s)' % year