Skip to content

Commit

Permalink
Fix KeyError on ytmusic match album
Browse files Browse the repository at this point in the history
  • Loading branch information
griffobeid authored and sigma67 committed Jun 16, 2023
1 parent db6ef68 commit a07611b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion spotify_to_ytmusic/match.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit a07611b

Please sign in to comment.