From a07611b52d94d382268795b6ee102e9a8391144d Mon Sep 17 00:00:00 2001 From: Griffin Obeid Date: Fri, 16 Jun 2023 11:38:33 -0400 Subject: [PATCH] Fix KeyError on ytmusic match album --- spotify_to_ytmusic/match.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spotify_to_ytmusic/match.py b/spotify_to_ytmusic/match.py index 28f8dfb..393b761 100644 --- a/spotify_to_ytmusic/match.py +++ b/spotify_to_ytmusic/match.py @@ -45,7 +45,7 @@ def get_best_fit_song_id(ytm_results, spoti) -> str: scores.append(duration_match_score * 5) # add album for songs only - if ytm["resultType"] == "song" and ytm["album"] is not None: + if ytm["resultType"] == "song" and ytm.get("album", None) is not None: scores.append( difflib.SequenceMatcher( a=ytm["album"]["name"].lower(), b=spoti["album"].lower()