Remove query parameters from URI (#758)

* made _get_id take account of ? in URI

* corrected typo

* changes to _get_id explained
This commit is contained in:
Felix Cusson 2021-12-17 17:20:47 -05:00 committed by GitHub
parent 2aeda6a2c2
commit 0464f4f483
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 1 deletions

View File

@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added ### Added
* Added `RedisCacheHandler`, a cache handler that stores the token info in Redis. * 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 ## [2.19.0] - 2021-08-12

View File

@ -1913,7 +1913,7 @@ class Spotify(object):
if type != fields[-2]: if type != fields[-2]:
logger.warning('Expected id of type %s but found type %s %s', logger.warning('Expected id of type %s but found type %s %s',
type, fields[-2], id) type, fields[-2], id)
return fields[-1] return fields[-1].split("?")[0]
fields = id.split("/") fields = id.split("/")
if len(fields) >= 3: if len(fields) >= 3:
itype = fields[-2] itype = fields[-2]