mirror of
https://github.com/spotipy-dev/spotipy.git
synced 2026-04-27 00:25:54 +03:00
[GH-ISSUE #95] Removing local files from playlists #43
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#43
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 @Hoffs on GitHub (May 24, 2016).
Original GitHub issue: https://github.com/spotipy-dev/spotipy/issues/95
So I have been trying to find a way to remove a local file from a playlist but I can't get it to work any way. I can't really find a function which would do what I need. Both remove_tracks functions require one or another type of argument which has to have track URI. But at least by looking at the Web API on Spotify page it says that it can only be done by using snapshot-id and position (https://developer.spotify.com/web-api/local-files-spotify-playlists/),
'It is not currently possible to add local files to playlists using the Web API, but they can be reordered or removed. The latter should be done by specifying the index and snapshot_id, and NOT the URI of the track.'
So can such functionality be implemented in a new release?
@stavlocker commented on GitHub (Jun 5, 2018):
+1
@stephanebruckert commented on GitHub (Feb 13, 2020):
You should be able to do this using
user_playlist_remove_specific_occurrences_of_tracksby passing asnapshot_idand atracksarray that contains the track position to remove https://spotipy.readthedocs.io/en/2.8.0/#spotipy.client.Spotify.user_playlist_remove_specific_occurrences_of_tracks@RatkoJ commented on GitHub (May 12, 2020):
I ran into the same issue with removing local files. There are 2 issues:
positionandsnapshot_id, but WITHOUT specifyinguri. As currently written, Spotipy will not accepttrackswithout uris.{"snapshot_id": 12asdsd... , "positions":[1,2,3,4]}I ended up writing my own function for this and it seems to work:
@20kaushik02 commented on GitHub (Aug 1, 2024):
Still works as of date, in both spotipy and the API itself. Also, this body formatting works for cloud/non-local files too, not just local files.
Shame that the API documentation is in such a poor condition