From 72d3d275f7f51bf3fc88ad51a4014ed3f1e8f606 Mon Sep 17 00:00:00 2001 From: Jakub <42355410+xnetcat@users.noreply.github.com> Date: Thu, 18 Mar 2021 21:13:10 +0100 Subject: [PATCH] Update provider.py (#1218) Authored by @xnetcat --- spotdl/search/provider.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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)