mirror of
https://github.com/spotipy-dev/spotipy.git
synced 2026-04-27 00:25:54 +03:00
[GH-ISSUE #764] playlist_is_following not handling user_ids correctly #464
Labels
No labels
api-bug
bug
dependencies
documentation
duplicate
enhancement
external-ide
headless-mode
implicit-grant-flow
invalid
missing-endpoint
pr-welcome
private-api
pull-request
question
spotipy3
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/spotipy#464
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 @CodeWriter194 on GitHub (Jan 3, 2022).
Original GitHub issue: https://github.com/spotipy-dev/spotipy/issues/764
Describe the bug
Attempting to determine if a given user follows a specific playlist returns an error stating that too many IDs were given, regardless of how many IDs are provided. 'playlist_is_following' appears to comma separate any value submitted for "USER_IDS", resulting in each character of a user ID being treated as a user ID on its own.
Your code
client_id = 'REDACTED'
client_secret = 'REDACTED'
client_credentials_manager = SpotifyClientCredentials(client_id=client_id, client_secret=client_secret)
sp = spotipy.Spotify(client_credentials_manager=client_credentials_manager)
barUserID = 'REDACTED'
fooUserID = 'REDACTED'
fooPlaylists = sp.user_playlists(fooUserID)
for i, item in enumerate(fooPlaylists['items']):
fooPlaylistIDs[i] = item['id']
print(sp.user_playlist_is_following(fooUserID,fooPlaylistIDs[i],barUserID))
Expected behavior
I expect to have 'True' or 'False' be returned when using method 'playlist_is_following'.
Output
Paste and format errors (with complete stacktrace) or logs. Make sure to remove sensitive information.
Environment:
Additional context
It seems that 'user_playlist_is_following' is a deprecated method, but changing to 'playlist_is_following' does not change the results.
Changing the below code in 'client.py' does seem to fix the issue, though.
@stephanebruckert commented on GitHub (Jan 3, 2022):
user_idsneeds to be passed as a list@CodeWriter194 commented on GitHub (Jan 3, 2022):
That's a bit embarrassing - thanks!