Closed adamvietnam closed 1 year ago
Further another playlist Spotify owned playlist
https://open.spotify.com/playlist/37i9dQZF1EVHGWrwldPRtj
I get totally different results via spoti-web-api-php vs in the Spotify app or Sandbox
Hello! This was quite fascinating! I tried requesting the "Lovely Little Playlist" playlist using Client Credentials Flow and Authorization Code Flow with two different accounts. My main account and a test account without any listening history or other data.
Client Credentials Flow and the test account gave the exact same results but with my main account I got totally different results just like you're describing. So I'm thinking the results has to be tied to the authorization flow used. Someone at the Spotify forums might be able to give you more insight though.
Thanks for coming back - glad / sad I wasn't doing something stupid.
I''ll try on the Spotify forums as you suggest, but just to confirm, you could get different results at a curl level i.e. ruling out the PHP API ?
Sorry, yes. Using cURL I get the exact same results, one for my main account and a different one for Client Credentials Flow and my test account (but still the same songs as when using this library).
Okay great - glad I can rule out this API.
I'll update here with any info I get from the developer forum just in case someone else runs across the same thing.
I don't know if it helps, but I already had some problems with the snapshot of the playlists. When I did not passed the snapshot it would return me always the first snapshot of that playlist.
Thanks Pedro, that's interesting.
Can you explain a bit more what you mean by "snapshot" please.
On Thu, 10 Mar 2022 at 00:31, Pedro Caires @.***> wrote:
I don't know if it helps, but I already had some problems with the snapshot of the playlists. When I did not passed the snapshot it would return me always the first snapshot of that playlist.
— Reply to this email directly, view it on GitHub https://github.com/jwilsson/spotify-web-api-php/issues/246#issuecomment-1063520840, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAIS7TGEPS5V6XSWROTZXILU7E7F5ANCNFSM5O4QKUCQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.
You are receiving this because you authored the thread.Message ID: @.***>
I have a server-side app that auths using the Client Credential Flow i.e:
I then attempt to read a normal user playlist for example:
I get the expected results i.e. the tracks in the users playlist that I see in the Spotify app.
If I try to do the same with a playlist a smart playlist owned by Spotify for instance "Daily Mix"
Again it works as fine and as expected.
If I then try a Playlist owned by Spotify in this case "Lovely Little Playlist"
https://open.spotify.com/playlist/37i9dQZF1DWXRqgorJj26U?si=a4d80532c53844f8
I get a slightly different tracks being returned than I see in the Spotify app. There is a lot of commonality but there are also differences (though interestingly all tracks are the correct style of music.)
If I try this in the Spotify sandpit console (using the OAuth token generated by the console.)
https://developer.spotify.com/console/get-playlist-tracks/?playlist_id=37i9dQZF1DXbZndSu0dHeI&market=&fields=&limit=&offset=&additional_types=
I get the tracks I see in the Spotify app
And if I copy the curl command generated by the sandpit console and run it on my server:
It also gives the tracks I see in the Spotify app.
However if I trace down into the Request.php get the Auth token generated by the Client Credentials flow and put into the above curl request i.e.
I get a slightly different set of tracks returned. Again commonality but differences.
NB. Market is set to "GB" in both cases and I have checked is_playable is true or 1 in for all tracks
So my questions would be :
Is there something else I should be specifying to get the same tracks for both spoti-web-api-php vs sandpit console?
Do you think this is to do with the different auth flows or is that a red herring?
3; Do you think this is because "Lovely Little Playlist" is an actually a smart playlist, the tracks being generated dynamically and thus not tightly defined - essentially the behaviour I'm seeing is to be expected.
And finally, If this the right place to ask the question or should I post it on the Spotify dev forums instead.
Many thanks for any insight you can give.