You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Hey all! I am trying to build an app, that can add songs to playlists the user owns.
The bizarre is, I tested the code for me and another person and it works as it should.
For another specific user, lets call him bob, it does not work.
I can delete songs from bobs playlist, but I can't add any songs. I run the exactly same code.
Happens with:
Your code
current_playback=sp.current_playback()
data=load_skipped_tracks()
trash_playlist_id=data["trash_playlist_ID"] #json file where I stored a playlist_idcurrently_played_song_id=current_song["item"]["id"]
print("trying to add song")
add_song_to_trashplaylist(trash_playlist_id, currently_played_song_id)
print("successful")
#def add_song_to_trashplaylist(trash_playlist_id, track_id):list_of_tracks= [track_id] # also tried this: list_of_tracks = {'uris': [track_id]}try:
sp.playlist_add_items(trash_playlist_id, list_of_tracks)
exceptExceptionase:
print(e)
print("normal adding did not work, trying replacing instead")
sp.playlist_replace_items(trash_playlist_id, list_of_tracks) # did work!
Expected behavior
I expect that the song is added to the playlist. I found out I can replace the song to the playlist. I am confused with the "Insufficient client scope" exception, because I got both modify scopes and it works with other users.
Output
trying to add song #print
HTTP Error for POST to https://api.spotify.com/v1/playlists/6i4s8LeNdHgtozUviUDkfz/tracks with Params: {'position': None} returned 403 due to Insufficient client scope
http status: 403, code:-1 - https://api.spotify.com/v1/playlists/6i4s8LeNdHgtozUviUDkfz/tracks:
Insufficient client scope, reason: None
normal adding did not work, trying replacing instead # print
successful # print
Environment:
OS: [Windows 10]
Python version [Python 3.10.4]
spotipy version [2.23.0]
using VSCode
I am relatively new to the space, so I hope I provided everything correctly in the right manner.
Thanks for your time!
The text was updated successfully, but these errors were encountered:
noelnic
changed the title
adding song to playlist won't work with one specific user
adding song to playlist won't work with one specific user (update: 2 users)
Mar 14, 2024
Describe the bug
Hey all! I am trying to build an app, that can add songs to playlists the user owns.
The bizarre is, I tested the code for me and another person and it works as it should.
For another specific user, lets call him bob, it does not work.
I can delete songs from bobs playlist, but I can't add any songs. I run the exactly same code.
Happens with:
Your code
Expected behavior
I expect that the song is added to the playlist. I found out I can replace the song to the playlist. I am confused with the "Insufficient client scope" exception, because I got both modify scopes and it works with other users.
Output
Environment:
I am relatively new to the space, so I hope I provided everything correctly in the right manner.
Thanks for your time!
The text was updated successfully, but these errors were encountered: