[GH-ISSUE #464] Spotipy Delete Track, "No token provided" even though should be provided #1 #269

Closed
opened 2026-02-27 23:21:43 +03:00 by kerem · 2 comments
Owner

Originally created by @MatthiasHerp on GitHub (Apr 4, 2020).
Original GitHub issue: https://github.com/spotipy-dev/spotipy/issues/464

I'm currently writing a code to delete specific tracks out of a Spotify Playlist I created, and thus that I own. But somehow I am having Issues with the token, although I am using the 'playlist-modify-public' token which should allow me to delete tracks in my own playlists.
And I checked that the playlist is publicly seen since it is available under public playlists of my account.
Would greatly appreciate your help :)

I get this error message by the link in the error code:
{
"error": {
"status": 401,
"message": "No token provided"
}
}

My Code:
Spotipy_delete_tracks.txt

Spotipy Authorization Scopes overview:
https://developer.spotify.com/documentation/general/guides/scopes/#playlist-modify-public

Originally created by @MatthiasHerp on GitHub (Apr 4, 2020). Original GitHub issue: https://github.com/spotipy-dev/spotipy/issues/464 I'm currently writing a code to delete specific tracks out of a Spotify Playlist I created, and thus that I own. But somehow I am having Issues with the token, although I am using the 'playlist-modify-public' token which should allow me to delete tracks in my own playlists. And I checked that the playlist is publicly seen since it is available under public playlists of my account. Would greatly appreciate your help :) I get this error message by the link in the error code: { "error": { "status": 401, "message": "No token provided" } } My Code: [Spotipy_delete_tracks.txt](https://github.com/plamere/spotipy/files/4431202/Spotipy_delete_tracks.txt) Spotipy Authorization Scopes overview: https://developer.spotify.com/documentation/general/guides/scopes/#playlist-modify-public
kerem closed this issue 2026-02-27 23:21:43 +03:00
Author
Owner

@stephanebruckert commented on GitHub (Apr 4, 2020):

SpotifyException: http status: 403, code:-1 - https://api.spotify.com/v1/users/11136043288/playlists/7LRXlpc7nL7yVF6oVTv8tH/tracks:
 You cannot remove tracks from a playlist you don't own.

In the code file I can see a 403 not a 401, which error do you actually have?

Edit: Okay sorry, the link from the error is not usable without a token, so yes you'll always get a 401 - no token provided


Then can you print the result of sp.me() and confirm your user ID is 11136043288?

<!-- gh-comment-id:609013186 --> @stephanebruckert commented on GitHub (Apr 4, 2020): ``` SpotifyException: http status: 403, code:-1 - https://api.spotify.com/v1/users/11136043288/playlists/7LRXlpc7nL7yVF6oVTv8tH/tracks: You cannot remove tracks from a playlist you don't own. ``` In the code file I can see a 403 not a 401, which error do you actually have? Edit: Okay sorry, the link from the error is not usable without a token, so yes you'll always get a 401 - no token provided ------------- Then can you print the result of `sp.me()` and confirm your user ID is `11136043288`?
Author
Owner

@MatthiasHerp commented on GitHub (Apr 5, 2020):

@stephanebruckert thanks for the advice. I tried the sp.me() and realized that it was an issue with my account. I used to have the account with my brother and we split it up somehow.
So I made a new account and a new application and now it works :)
Thanks for the quick help 👍

<!-- gh-comment-id:609411128 --> @MatthiasHerp commented on GitHub (Apr 5, 2020): @stephanebruckert thanks for the advice. I tried the sp.me() and realized that it was an issue with my account. I used to have the account with my brother and we split it up somehow. So I made a new account and a new application and now it works :) Thanks for the quick help 👍
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/spotipy#269
No description provided.