sigma67 / spotify_to_ytmusic

Clone a Spotify playlist to YouTube Music
MIT License
790 stars 65 forks source link

KeyError: 'album' #60

Closed rbrauner closed 1 year ago

rbrauner commented 1 year ago

If there is no 'album' key in ytm object in get_best_fit_song_id method, there is error in "match.py", line 48:

        # ...
        # add album for songs only
        if ytm["resultType"] == "song" and ytm["album"] is not None:
            scores.append(
                difflib.SequenceMatcher(
                    a=ytm["album"]["name"].lower(), b=spoti["album"].lower()
                ).ratio()
            )
        # ...

Problem occured on song: https://open.spotify.com/track/6CwGUsO3RzRU5Y9IE4Tf1B

Command used: spotify_to_ytmusic liked