[PR #420] [MERGED] Trim '?<key>' when extracting ID from HTTP URLs #888

Closed
opened 2026-02-28 00:02:24 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/spotipy-dev/spotipy/pull/420
Author: @ritiek
Created: 1/13/2020
Status: Merged
Merged: 1/13/2020
Merged by: @ritiek

Base: masterHead: fix-split-http-url


📝 Commits (2)

  • 3e2e8ed Trim '?' when extracting ID from HTTP URLs
  • e6829a1 Add a changelog entry for #420

📊 Changes

2 files changed (+5 additions, -1 deletions)

View changed files

📝 CHANGELOG.md (+4 -0)
📝 spotipy/client.py (+1 -1)

📄 Description

If this excess part isn't trimmed from the ID, it can cause unexpected
results when calling some API methods.

For example; this code now correctly returns all albums for an artist:

artist = 'https://open.spotify.com/artist/7oPftvlwr6VrsViSDV7fJY?si=M3PrzRC4TBOZu8YyLYc-tA'
artist_albums = sp.artist_albums(artist)

Previously, this code mimicked same behaviour as calling
spotify.artist, but now will return albums as expected
with this commit.

Fixes #365 and #323.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/spotipy-dev/spotipy/pull/420 **Author:** [@ritiek](https://github.com/ritiek) **Created:** 1/13/2020 **Status:** ✅ Merged **Merged:** 1/13/2020 **Merged by:** [@ritiek](https://github.com/ritiek) **Base:** `master` ← **Head:** `fix-split-http-url` --- ### 📝 Commits (2) - [`3e2e8ed`](https://github.com/spotipy-dev/spotipy/commit/3e2e8ed0fb76f6606839ced94659e8a1a82e2bf4) Trim '?<key>' when extracting ID from HTTP URLs - [`e6829a1`](https://github.com/spotipy-dev/spotipy/commit/e6829a1139b61a6cef9012254b37331abe7cb94b) Add a changelog entry for #420 ### 📊 Changes **2 files changed** (+5 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `CHANGELOG.md` (+4 -0) 📝 `spotipy/client.py` (+1 -1) </details> ### 📄 Description If this excess part isn't trimmed from the ID, it can cause unexpected results when calling some API methods. For example; this code now correctly returns all albums for an artist: ``` artist = 'https://open.spotify.com/artist/7oPftvlwr6VrsViSDV7fJY?si=M3PrzRC4TBOZu8YyLYc-tA' artist_albums = sp.artist_albums(artist) ``` Previously, this code mimicked same behaviour as calling `spotify.artist`, but now will return albums as expected with this commit. Fixes #365 and #323. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-28 00:02:24 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/spotipy#888
No description provided.