mirror of
https://github.com/spotipy-dev/spotipy.git
synced 2026-04-26 16:15:51 +03:00
[GH-ISSUE #798] Argument parameters of playlist_items() are non functional #493
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#493
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 @djsamyak on GitHub (Apr 29, 2022).
Original GitHub issue: https://github.com/spotipy-dev/spotipy/issues/798
Describe the bug
I am trying to fetch the names of all the tracks in a playlist using a playlist URI by using playlist_items(). This function has the following parameters:
playlist_id,fields=None,limit=100,offset=0,market=None,additional_types=('track', 'episode')However, due to the original limit of 100 items, the API fails to fetch any more results when the number of tracks in a playlist is greater than 100; it only fetches the details of the first 100 tracks. Passing a custom value to the
limitoroffsetparameter also doesn't work.Your code
Expected behaviour
It should print the playlist name, and then print the number of tracks in that playlist in the next line.
For the above-mentioned playlist URI, it should print the following:
Output
It prints the following:
Environment:
Additional context
Making changes in source code's
client.pyto modify the default limit has not solved the issue.@Peter-Schorn commented on GitHub (Apr 30, 2022):
The issue is that your
playlist_urivariable contains a malformed id (not even a uri). The id is5z5kiTiHO85L6ERjm32jQ7. The uri would bespotify:playlist:5z5kiTiHO85L6ERjm32jQ7. You should pass either of these two into the function.?si=2582f978e1484627is not part of any identifier.When you pass the malformed id into the function, spotipy ends up calling a different endpoint, which does not contain
offsetorlimitparameters.see https://github.com/plamere/spotipy/issues/763#issuecomment-1003441199.
@djsamyak commented on GitHub (May 21, 2022):
Ah, that makes sense. I was not able to find the Spotify URI due to the new update, but if someone else is stuck, you can hold down the modifier key (alt/command) while in the share menu.