From 7f587fe6671a3bb45e4bea40c31eadaedb38fb1d Mon Sep 17 00:00:00 2001 From: Ritiek Malhotra Date: Fri, 10 Jan 2020 11:42:44 +0530 Subject: [PATCH 1/2] Fix KeyError when a track isn't found on Spotify Ids only exist for Spotify URIs. Regression caused by #568. Fixes #649. --- spotdl/internals.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/spotdl/internals.py b/spotdl/internals.py index a7f4f04..f0c6f38 100644 --- a/spotdl/internals.py +++ b/spotdl/internals.py @@ -93,7 +93,10 @@ def format_string( format_tags[9] = tags["track_number"] format_tags[10] = tags["total_tracks"] format_tags[11] = tags["external_ids"]["isrc"] - format_tags[12] = tags["id"] + try: + format_tags[12] = tags["id"] + except KeyError: + pass format_tags_sanitized = { k: sanitize_title(str(v), ok="'-_()[]{}") if slugification else str(v) From 5d185844d78dbe8ea4d457ec4ee3685fddcef7c6 Mon Sep 17 00:00:00 2001 From: Ritiek Malhotra Date: Fri, 10 Jan 2020 14:54:36 +0530 Subject: [PATCH 2/2] Add a changelog entry for #653 --- CHANGES.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGES.md b/CHANGES.md index 0a3d1e8..c64da99 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -5,6 +5,9 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). ## [Unreleased] +### Fixed +- Fixed a regression where a track would fail to download if it isn't + found on Spotify ([@ritiek](https://github.com/ritiek)) (#653) ## [1.2.3] - 2019-12-20 ### Added