diff --git a/spotdl/search/provider.py b/spotdl/search/provider.py index 2db796fab..9df8ad4f3 100644 --- a/spotdl/search/provider.py +++ b/spotdl/search/provider.py @@ -225,7 +225,9 @@ def search_and_order_ytm_results(songName: str, songArtists: List[str], albumMatch = 0.0 if result['type'] == 'song': - albumMatch = match_percentage(result['album'], songAlbumName) + album = result.get('album') + if album: + albumMatch = match_percentage(album, songAlbumName) # Find duration match # ! time match = 100 - (delta(duration)**2 / original duration * 100)