mirror of
https://github.com/jwilsson/spotify-web-api-php.git
synced 2026-04-26 23:45:49 +03:00
[GH-ISSUE #246] getPlaylistTracks gives the different tracks for playlist generated by user: Spotify when using the API vs using the Spotify sandpit console #177
Labels
No labels
bug
docs
enhancement
enhancement
enhancement
feedback wanted
good first issue
help wanted
help wanted
help wanted
invalid
pull-request
question
question
upstream
upstream
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/spotify-web-api-php#177
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @adamvietnam on GitHub (Feb 20, 2022).
Original GitHub issue: https://github.com/jwilsson/spotify-web-api-php/issues/246
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.
@adamvietnam commented on GitHub (Feb 20, 2022):
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
@jwilsson commented on GitHub (Feb 20, 2022):
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.
@adamvietnam commented on GitHub (Feb 20, 2022):
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 ?
@jwilsson commented on GitHub (Feb 20, 2022):
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).
@adamvietnam commented on GitHub (Feb 20, 2022):
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.
@dgtyPedro commented on GitHub (Mar 10, 2022):
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.
@adamvietnam commented on GitHub (Mar 10, 2022):
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: