mirror of
https://github.com/spotipy-dev/spotipy.git
synced 2026-04-27 08:35:49 +03:00
[GH-ISSUE #1155] Playlist longer than 100 items fails to iterate with sample code #680
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#680
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 @cbz on GitHub (Aug 13, 2024).
Original GitHub issue: https://github.com/spotipy-dev/spotipy/issues/1155
The example code under "Show the contents of every playlist owned by a user:" fails when playlists are longer than 100 items.
Expected behaviour would be to print out all contents of each playlist.
In reality an exception is thrown when a playlist longer than a single page of results is encountered:
The following is seen:
{'next': None}
Traceback (most recent call last):
File "/tmp/sptest.py", line 40, in
show_tracks(tracks)
File "/tmp/sptest.py", line 9, in show_tracks
for i, item in enumerate(tracks['items']):
Environment:
@dieser-niko commented on GitHub (Aug 22, 2024):
I'm guessing you mean this example: user_playlists_contents.py.
I ran it and it worked fine. Could you copy the entire error message? And if you have modified your script, please share it.
@cbz commented on GitHub (Aug 22, 2024):
I'm using the second example here with the auth flow listed.
https://spotipy.readthedocs.io/en/2.11.1/#examples
The text in my original issue is the extent of the error message, and output at the point where a, a playlist longer than 100 items is encountered, and just after the first 100 (0-99) results have been printed out.
@cbz commented on GitHub (Aug 22, 2024):
Looks like the interface changed slightly such that the older code no longer worked, closing issue.
@dieser-niko commented on GitHub (Aug 22, 2024):
Yeah, the documentation is somewhat outdated, sorry for that.