Announcements

Help Wizard

Step 1

NEXT STEP

spotipy's sp.playlist_tracks doesn't returns same song from different album

spotipy's sp.playlist_tracks doesn't returns same song from different album

Operating System

(Windows 11)

 

My Question or Issue

I'm retrieving information from a playlist using spotipy's sp.playlist_tracks().

The problem is it doesn't always return the original albums or artists, although they are shown on the spotify desktop app.

For example, if I take the playlist:

Top hits of 2012, by spotify, with URI 37i9dQZF1DX0yEZaMOXna3, the second song in this playlist is Call me maybe by Carly Rae Jepson in the album Kiss (uri: 20I6sIOMTCkB6w7ryavxtO).

However, when calling 

sp.playlist_tracks("37i9dQZF1DX0yEZaMOXna3"),
the second song is Call me maybe but it is taken from a different album called:
'name': 'Отново на училище',
'release_date': '2022-10-07', and 'uri': 'spotify:album:3Zg0yN1OnJDk2l92pwJ9yA'},
and the songs uri 'uri': 'spotify:track:4PTDjIzld7QGs6oLMMnDQ6'}.
I don't understand why this is happening, any help is appreciated as I would really like to be able to get the original data of the song.
 
 
Reply
1 Reply

I recommend you to add market=XX to sp.playlist_track(), where XX is your ISO 3166-1 alpha-2 country code.


XimzendSpotify Star
Help others find this answer and click "Accept as Solution".
If you appreciate my answer, maybe give me a Like.
Note: I'm not a Spotify employee.

Suggested posts

Let's introduce ourselves!

Hey there you,   Yeah, you! 😁   Welcome - we're glad you joined the Spotify Community!   While you here, let's have a fun game and get…

ModeratorStaff / Moderator/ 4 years ago  in Social & Random