mirror of
https://github.com/spotipy-dev/spotipy.git
synced 2026-04-27 08:35:49 +03:00
[GH-ISSUE #1063] Could not remove tracks, please check parameters with playlist_remove_specific_occurrences_of_items #626
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#626
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 @saarimrahman on GitHub (Dec 16, 2023).
Original GitHub issue: https://github.com/spotipy-dev/spotipy/issues/1063
Hi, even though items is formatted correctly, I'm receiving an error of " Could not remove tracks, please check parameters., reason: None" with
playlist_remove_specific_occurrences_of_items478D5udPmRAfuMvzUaDxNn. What am I doing wrong? Items looks formatted as it is in the docs.@Jack-Dane commented on GitHub (Jan 2, 2024):
It doesn't look like the
positionsparameter is supported anymore. The documentation doesn't mention it: https://developer.spotify.com/documentation/web-api/reference/remove-tracks-playlist (only has theuri).There are also a few other tickets that mention the same response error string:
https://community.spotify.com/t5/Spotify-for-Developers/How-delete-one-or-more-elements-from-playlist/td-p/5185630
https://github.com/spotify/web-api/issues/989
As far as I can tell, it is only needed if there is the same song in the playlist twice and you want to remove a specific occurrence.
@saarimrahman commented on GitHub (Jan 4, 2024):
Appreciate the response! Left a comment on that thread, hopefully someone responds.
Sadly my use case is exactly trying to remove the same song in a playlist twice: https://app.saarim.me/find-duplicates
@Jack-Dane commented on GitHub (Jan 4, 2024):
@saarimrahman, I see, in the meantime you should be able to work around this issue (if you haven't already used this as a solution).
You can remove just the URIs that have duplicates and then add them back to their first position with:
This will need to be done for each duplicate individually to ensure the order of songs isn't affected.
But if you don't care about the order, you can remove all the duplicates in one request (as you have been doing) and then add one of each back with one request. You can pass an array of tracks. See this example examples/add_tracks_to_playlist.py.
@stephanebruckert commented on GitHub (May 22, 2025):
Closing as Spotify removed this endpoint, making it a deprecated method in spotipy. I updated the spotipy doc to reflect that in https://github.com/spotipy-dev/spotipy/pull/1202
Alternatively you can use
playlist_remove_all_occurrences_of_items(playlist_id, items, snapshot_id=None)but be aware that it can come with issues due to changes on the Spotify side again: https://github.com/spotipy-dev/spotipy/issues/1098 shows all tracks with the same ID will be removed from the playlist, making it difficult to remove duplicates.