mirror of
https://github.com/spotipy-dev/spotipy.git
synced 2026-04-26 16:15:51 +03:00
[GH-ISSUE #936] Hidden limits for current_user_saved_* endpoints #559
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#559
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 @rv3392 on GitHub (Jan 28, 2023).
Original GitHub issue: https://github.com/spotipy-dev/spotipy/issues/936
Describe the bug
When doing a request to some (potentially all, but I haven't tested) of the current_user_saved_* endpoints such as current_user_saved_shows_add and current_user_saved_shows_delete there is a hidden limit (of 50) to the number of IDs that can be passed in. This is a restriction on Spotify's end, but isn't really documented anywhere in the library. I think simply documenting this should be enough to avoid any errors, it should just be clear that passing more than 50 items to these endpoints will cause an error.
Your code
Code that doesn't work (passing 51 items to the current_user_saved_shows_add function):
Code that does work (passing 50 items to the current_user_saved_shows_add function):
Output
For the code that doesn't work:
Number of shows before adding: 0
HTTP Error for PUT to https://api.spotify.com/v1/me/shows?ids=2PQxEHzQFao28CkFsAeKKF,5qs7Q9vuPqPPwPF4TowBzw,362DwZBa01YuXx5LeK8Psp,5Flyniqb8z6tg3ih7KQpWw,06bz0CgppKdIUlZ7HcckZI,05IaQthMEh8NSqpbfaO12y,64nFJEu758qByG5l6kqg6F,2zS4NZ0ifzivJGmtaMqJwv,0vYTIMav7el5VXq5n5pxhI,1Tgsr2BDHLSQ44YsOwoguj,2hmkzUtix0qTqvtpPcMzEL,6qvMMubhD8HnFaHrUrbj0Z,1cBhYjm2fildfRsNDEYLcm,7y2q3VMC6WLsMlFXT3TyO7,1cebrSa4kuOOaULNOza4RO,44DE64rRpX1cFIQUlqQtvi,2vdrao20EwrhpLeO59ZT7K,22OJWsluntwDB1siMFIA9V,3BHScKAhtaSxo6LZl9g8kk,0C4V1DxK6v3s1TEj4hgpia,2cKdcxETn7jDp7uJCwqmSE,2Shpxw7dPoxRJCdfFXTWLE,7Fwh0RaRTTFqKuqwX9m7BM,05gf7mODpGt1y8dTwbYbZo,59I1XnvAB9fQzSj9SIKCoI,5ykZ7DGfxkdhuCvn3jwP3X,6Ijz5uEUxN6FvJI49ZGJAJ,7GeAE3ILNdnk9ZS7TfKjfj,1XeleYXleZeyGRpmoG2Nzw,34DG4iX044aFGNPGb4hkqY,3YFFg0qI464m9Zg0CG8HlL,7rtPDwn7svKg9ov6ALqsSl,1XSjN7lgDlwMzHy43gMANd,2dXkTgfC5mECruaLFUERe1,5M2eCjpUwWQi43iqVaIHR7,2dY2l2v95zz9HTlYvDSAdA,0S1h5K7jm2YvOcM7y1ZMXY,0W4lU1c6SDdVm40Xzv7W2L,5lY4b5PGOvMuOYOjOVEcb9,3E5Bn9bOSZeNSwkHZtog5A,6u8aqT4yaqnXiAwSHQP0NN,1VXcH8QHkjRcTCEd88U3ti,585Fazg0GGNMIXnyCt5B56,36P6Xk2292DapFNerkRbDw,025ShRPn5glhebeDjXX542,3scirzcuaGm02MQ4FUZydq,0Bmh1vg4ZHjc4J9LjQ0J2F,6qdfc9eJihq4Wj4UglBPIn,2VRS1IJCTn2Nlkg33ZVfkM,4V3K3zyD0k789eaSWFXzhc,2ZTE4GUHZd1QxU4SsYIbsd with Params: {} returned 400 due to Bad request.
For the code that does work:
Number of shows before adding: 0
Number of shows after adding: 50
Expected behavior
Based on the documentation present, it's expected that the first code example adds 51 shows (contained in the "shows" list). Instead, nothing happens and a cryptic error is thrown. When the first 50 items of the "shows" list is taken using a slice and passed to the endpoint, then it works as expected.
Additional context
I haven't included the full traceback for the case that doesn't work but if that's needed I can do so. When I get some time, I will also try to test some of the other endpoints to get a proper list of which ones don't work.