From 2f9df0f949a49734e5f7021dee7f9731b4894b87 Mon Sep 17 00:00:00 2001 From: Marvin Schenkel Date: Sat, 22 Jun 2024 13:36:03 +0200 Subject: [PATCH] Fix playback for video based songs without artist info. (#1402) --- music_assistant/server/providers/ytmusic/helpers.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/music_assistant/server/providers/ytmusic/helpers.py b/music_assistant/server/providers/ytmusic/helpers.py index 9fd1a217..7ff9486a 100644 --- a/music_assistant/server/providers/ytmusic/helpers.py +++ b/music_assistant/server/providers/ytmusic/helpers.py @@ -35,8 +35,11 @@ async def get_artist( # ChannelId can sometimes be different and original ID is not part of the response artist["channelId"] = prov_artist_id except KeyError: - user = ytm.get_user(channelId=prov_artist_id) - artist = {"channelId": prov_artist_id, "name": user["name"]} + try: + user = ytm.get_user(channelId=prov_artist_id) + artist = {"channelId": prov_artist_id, "name": user["name"]} + except KeyError: + artist = {"channelId": prov_artist_id, "name": "Unknown"} return artist return await asyncio.to_thread(_get_artist) -- 2.34.1