From 0464f4f483f7f60eed71278f13f5182dc249c4aa Mon Sep 17 00:00:00 2001 From: Felix Cusson <60357894+Darkfull-Dante@users.noreply.github.com> Date: Fri, 17 Dec 2021 17:20:47 -0500 Subject: [PATCH] Remove query parameters from URI (#758) * made _get_id take account of ? in URI * corrected typo * changes to _get_id explained --- CHANGELOG.md | 1 + spotipy/client.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8e6684e4..b9c96396 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added * Added `RedisCacheHandler`, a cache handler that stores the token info in Redis. +* Changed URI handling in `client.Spotify._get_id()` to remove qureies if provided by error. ## [2.19.0] - 2021-08-12 diff --git a/spotipy/client.py b/spotipy/client.py index d018a578..4ad4b2d9 100644 --- a/spotipy/client.py +++ b/spotipy/client.py @@ -1913,7 +1913,7 @@ def _get_id(self, type, id): if type != fields[-2]: logger.warning('Expected id of type %s but found type %s %s', type, fields[-2], id) - return fields[-1] + return fields[-1].split("?")[0] fields = id.split("/") if len(fields) >= 3: itype = fields[-2]