mirror of
https://github.com/jwilsson/spotify-web-api-php.git
synced 2026-04-27 07:55:49 +03:00
[GH-ISSUE #105] Scope Processing Issue: Private Playlists #61
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#61
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 @Jack-Anstey on GitHub (Nov 9, 2017).
Original GitHub issue: https://github.com/jwilsson/spotify-web-api-php/issues/105
I am not sure if this is due to my programming of if there is actually a problem with the API itself. My purpose is getting every playlist that a user possesses, including private ones. I am then getting all of the tracks within those playlists. Scope is declared in authorize.php, which points to callback.
Is the scope. The error occurs in the main processes script. The output is: Not found.
Something went really wrong getting your playlist tracks, come back later, then it continues with the rests of the tracks inside a playlist as normal. Here is the code where the playlist processing occurs:
I have isolated it to the scope as it only occurs when you add 'playlist-read-private' and at no other time. For more context, the user that I am looking at (me) possesses no private playlists but I don't see any reason this code should not work, leading me to believe that this is an API issue. Please correct me if I am wrong!
Thanks!
@andersborgabiro commented on GitHub (Nov 9, 2017):
Some ideas, considering it's "Not found":
Have you tried adding playlist-read-public to scope?
Some songs might not be available for your market. You don't set market.
https://developer.spotify.com/web-api/track-relinking-guide/
There might be more than 100 tracks in one of the playlists. It reads out max 100 tracks per request.
For more: https://developer.spotify.com/web-api/get-playlists-tracks/
@Jack-Anstey commented on GitHub (Nov 9, 2017):
@andersborgabiro 'playlist-read-public' is an "illegal scope" so I don't believe that that's my problem. Also why would it return not found for a playlist with more than 100 tracks? Wouldn't it just stop once it reached 100?
@andersborgabiro commented on GitHub (Nov 9, 2017):
You're right of course. There's only a playlist-modify-public. I only use modify at the moment.
And it would or should stop without complaints.
But you could check out the market setting.
@jwilsson commented on GitHub (Nov 10, 2017):
Hi!
Thanks for helping out, @andersborgabiro!
@JackaJacka123 How are you populating
$playlistIds? From a call to$api->getUserPlaylists()? If you print$playlistIdswhen you've requested theplaylist-read-privatescope, do you see anything strange?@TIBBEH13 commented on GitHub (Nov 14, 2017):
I ran into the same 'Not found' error today and this solved it for me:
You request the Playlist Tracks over here:
$playlistTracks = $api->getUserPlaylistTracks($userId, $playlistIds[$row]);Not the part where it says
$userId. I was using the user ID from the connected spotify user, but this needs to be the user ID from the owner of the playlist.This is my code, which is working on my site:
@Jack-Anstey commented on GitHub (Nov 14, 2017):
@TIBBEH13 That is exactly it! I am personally following different playlists which is why it is not working for me! Thank you so much for figuring that out. I'll close this issue.
@andersborgabiro commented on GitHub (Nov 14, 2017):
Shouldn't it be owner->id ? Maybe works with both.
@jwilsson commented on GitHub (Nov 15, 2017):
@JackaJacka123 Glad we got it figured out!
@TIBBEH13 Thanks for stepping in and helping out!
Closing since we solved it.