[GH-ISSUE #323] Spotify.artist_albums acts as Spotify.artist when passing HTTP artist URL #185

Closed
opened 2026-02-27 23:21:16 +03:00 by kerem · 2 comments
Owner

Originally created by @ritiek on GitHub (Oct 2, 2018).
Original GitHub issue: https://github.com/spotipy-dev/spotipy/issues/323

When Spotify.artist_albums is given an HTTP artist URL like https://open.spotify.com/artist/7oPftvlwr6VrsViSDV7fJY?si=M3PrzRC4TBOZu8YyLYc-tA, it behaves same as Spotify.artist and instead of returning the albums, it just returns artist info. However, it works fine if artist URI is passed like spotify:artist:7oPftvlwr6VrsViSDV7fJY and then it returns albums as expected.

For example:

>>> import spotipy
>>> import spotipy.oauth2 as oauth2

>>> credentials = oauth2.SpotifyClientCredentials(
...         client_id=CLIENT_ID,
...         client_secret=CLIENT_SECRET)

>>> token = credentials.get_access_token()
>>> spotify = spotipy.Spotify(auth=token)

>>> greenday_http = 'https://open.spotify.com/artist/7oPftvlwr6VrsViSDV7fJY?si=M3PrzRC4TBOZu8YyLYc-tA'
>>> artist_as_http = spotify.artist(greenday_http)

>>> greenday_uri = 'spotify:artist:7oPftvlwr6VrsViSDV7fJY'
>>> artist_as_uri = spotify.artist(greenday_uri)

>>> artist_as_http == artist_as_uri
True

>>> artist_albums_as_http = spotify.artist_albums(greenday_http)
# `Spotify.artist_albums` acts same as `Spotify.artist`
>>> artist_albums_as_http == artist_as_http
True

>>> artist_albums_as_uri = spotify.artist_albums(greenday_uri)
# `Spotify.artist_albums` does not act same as `Spotify.artist` as expected
>>> artist_albums_as_uri == artist_as_http
False
Originally created by @ritiek on GitHub (Oct 2, 2018). Original GitHub issue: https://github.com/spotipy-dev/spotipy/issues/323 When `Spotify.artist_albums` is given an HTTP artist URL like `https://open.spotify.com/artist/7oPftvlwr6VrsViSDV7fJY?si=M3PrzRC4TBOZu8YyLYc-tA`, it behaves same as `Spotify.artist` and instead of returning the albums, it just returns artist info. However, it works fine if artist URI is passed like `spotify:artist:7oPftvlwr6VrsViSDV7fJY` and then it returns albums as expected. For example: ```python >>> import spotipy >>> import spotipy.oauth2 as oauth2 >>> credentials = oauth2.SpotifyClientCredentials( ... client_id=CLIENT_ID, ... client_secret=CLIENT_SECRET) >>> token = credentials.get_access_token() >>> spotify = spotipy.Spotify(auth=token) >>> greenday_http = 'https://open.spotify.com/artist/7oPftvlwr6VrsViSDV7fJY?si=M3PrzRC4TBOZu8YyLYc-tA' >>> artist_as_http = spotify.artist(greenday_http) >>> greenday_uri = 'spotify:artist:7oPftvlwr6VrsViSDV7fJY' >>> artist_as_uri = spotify.artist(greenday_uri) >>> artist_as_http == artist_as_uri True >>> artist_albums_as_http = spotify.artist_albums(greenday_http) # `Spotify.artist_albums` acts same as `Spotify.artist` >>> artist_albums_as_http == artist_as_http True >>> artist_albums_as_uri = spotify.artist_albums(greenday_uri) # `Spotify.artist_albums` does not act same as `Spotify.artist` as expected >>> artist_albums_as_uri == artist_as_http False ```
kerem 2026-02-27 23:21:16 +03:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@ritiek commented on GitHub (Oct 7, 2018):

I get this part of the URL ?si=<some_weird_key> (https://open.spotify.com/artist/7oPftvlwr6VrsViSDV7fJY?si=M3PrzRC4TBOZu8YyLYc-tA) at the end only when selecting copy link from the Spotify desktop app. Searching on the web for spotify artists/songs does not contain this part in the URL.

<!-- gh-comment-id:427645624 --> @ritiek commented on GitHub (Oct 7, 2018): I get this part of the URL `?si=<some_weird_key>` (`https://open.spotify.com/artist/7oPftvlwr6VrsViSDV7fJY?si=M3PrzRC4TBOZu8YyLYc-tA`) at the end only when selecting copy link from the Spotify desktop app. Searching on the web for spotify artists/songs does not contain this part in the URL.
Author
Owner

@ritiek commented on GitHub (Jan 13, 2020):

Fixed by #420.

<!-- gh-comment-id:573709963 --> @ritiek commented on GitHub (Jan 13, 2020): Fixed by #420.
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#185
No description provided.