Spotipy: how do I find linked tracks in Spotify using the Python API

45 views Asked by At

My playlist and recently played have different track IDs sometimes. Example my playlist has:

reload_id = '0wnRRFzKLDdI5jjvDP3lZV'
recent_id = '5vOGEMTcx7ns5CtQ5y41lo'

(Pdb) reload_name
'One Moment in Time - Remastered'
(Pdb) reload_artist
'Whitney Houston'

(Pdb) recent_name
'One Moment in Time'
(Pdb) recent_artist
'Whitney Houston'

I included the raw JSON for each track at the bottom.

I assume that my playlist track (reload) is not playable due to market or some other reason, even thought that attribute is True for both.

If I search my the artist (same for both tracks) and recent name I get these tracks which is missing the reload track id.

(Pdb) search_q
'artist:Whitney Houston track:One Moment in Time'
results = sp.search(q=search_q, limit=50, type='track')
(Pdb) c
5IDUGTWbntYwO9SNmhuSWf One Moment in Time  Whitney Houston
3cxjdKOZAlZO1steLpP8dN One Moment in Time  Whitney Houston
5vOGEMTcx7ns5CtQ5y41lo One Moment in Time  Whitney Houston
16RzAKm2SLaNhMdqHaImSm One Moment In Time  Karaoke - Whitney Houston
5DuvpjG95Qg574Ba8MoB4D One Moment in Time - Acoustic Cover  Whitney Houston

If I just search for

Pdb) search_q
'Whitney Houston One Moment in Time - Remastered'

I get 50 or more results that are all over the place. I'm trying to find a way to correlate the two tracks.

I removed my raw JSON here as it kept getting flagged as spam.

I have tried setting my market and pulled each track id and searched based on artist and title but cannot find any results that tie the two together.

0

There are 0 answers