[GH-ISSUE #684] "Permissions missing, reason: None" when trying the get the current playback. #405

Closed
opened 2026-02-27 23:22:26 +03:00 by kerem · 3 comments
Owner

Originally created by @ashleney on GitHub (May 27, 2021).
Original GitHub issue: https://github.com/spotipy-dev/spotipy/issues/684

I'm very sorry if I did something obviously wrong but I just can't figure this out.

I have this code that should get the current playback

import spotipy
from spotipy.oauth2 import SpotifyOAuth

auth = SpotifyOAuth(
    '...', 
    '...', 
    'http://127.0.0.1:9090', 
    scope="user-read-currently-playing"
)
spotify = spotipy.Spotify(oauth_manager=auth)

pb = spotify.current_playback()
print(pb)

however, when I run it I get this error

HTTP Error for GET to https://api.spotify.com/v1/me/player returned 401 due to Permissions missing
Traceback (most recent call last):
  File "C:\Users\D\AppData\Roaming\Python\Python39\site-packages\spotipy\client.py", line 245, in _internal_call
    response.raise_for_status()
  File "C:\Users\D\AppData\Roaming\Python\Python39\site-packages\requests\models.py", line 943, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 401 Client Error: Unauthorized for url: https://api.spotify.com/v1/me/player

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\D\code\thesadru\culturebot\_test.py", line 13, in <module>
    pb = spotify.current_playback()
  File "C:\Users\D\AppData\Roaming\Python\Python39\site-packages\spotipy\client.py", line 1697, in current_playback
    return self._get("me/player", market=market, additional_types=additional_types)
  File "C:\Users\D\AppData\Roaming\Python\Python39\site-packages\spotipy\client.py", line 291, in _get
    return self._internal_call("GET", url, payload, kwargs)
  File "C:\Users\D\AppData\Roaming\Python\Python39\site-packages\spotipy\client.py", line 261, in _internal_call
    raise SpotifyException(
spotipy.exceptions.SpotifyException: http status: 401, code:-1 - https://api.spotify.com/v1/me/player:
 Permissions missing, reason: None

My guess is that I'm just authenticating incorrectly, but I don't know where exactly I went wrong.

Originally created by @ashleney on GitHub (May 27, 2021). Original GitHub issue: https://github.com/spotipy-dev/spotipy/issues/684 I'm very sorry if I did something obviously wrong but I just can't figure this out. I have this code that should get the current playback ```py import spotipy from spotipy.oauth2 import SpotifyOAuth auth = SpotifyOAuth( '...', '...', 'http://127.0.0.1:9090', scope="user-read-currently-playing" ) spotify = spotipy.Spotify(oauth_manager=auth) pb = spotify.current_playback() print(pb) ``` however, when I run it I get this error ``` HTTP Error for GET to https://api.spotify.com/v1/me/player returned 401 due to Permissions missing Traceback (most recent call last): File "C:\Users\D\AppData\Roaming\Python\Python39\site-packages\spotipy\client.py", line 245, in _internal_call response.raise_for_status() File "C:\Users\D\AppData\Roaming\Python\Python39\site-packages\requests\models.py", line 943, in raise_for_status raise HTTPError(http_error_msg, response=self) requests.exceptions.HTTPError: 401 Client Error: Unauthorized for url: https://api.spotify.com/v1/me/player During handling of the above exception, another exception occurred: Traceback (most recent call last): File "C:\Users\D\code\thesadru\culturebot\_test.py", line 13, in <module> pb = spotify.current_playback() File "C:\Users\D\AppData\Roaming\Python\Python39\site-packages\spotipy\client.py", line 1697, in current_playback return self._get("me/player", market=market, additional_types=additional_types) File "C:\Users\D\AppData\Roaming\Python\Python39\site-packages\spotipy\client.py", line 291, in _get return self._internal_call("GET", url, payload, kwargs) File "C:\Users\D\AppData\Roaming\Python\Python39\site-packages\spotipy\client.py", line 261, in _internal_call raise SpotifyException( spotipy.exceptions.SpotifyException: http status: 401, code:-1 - https://api.spotify.com/v1/me/player: Permissions missing, reason: None ``` My guess is that I'm just authenticating incorrectly, but I don't know where exactly I went wrong.
kerem 2026-02-27 23:22:26 +03:00
  • closed this issue
  • added the
    question
    label
Author
Owner

@ashleney commented on GitHub (May 27, 2021):

So sorry, I actually just used the wrong scope.

<!-- gh-comment-id:849877797 --> @ashleney commented on GitHub (May 27, 2021): So sorry, I actually just used the wrong scope.
Author
Owner

@fluffy-cakes commented on GitHub (Sep 25, 2021):

So sorry, I actually just used the wrong scope.

what was the correct scope? @thesadru

<!-- gh-comment-id:927142736 --> @fluffy-cakes commented on GitHub (Sep 25, 2021): > So sorry, I actually just used the wrong scope. what was the correct scope? @thesadru
Author
Owner

@ashleney commented on GitHub (Sep 25, 2021):

No idea which one of these is currently doing the magic, but I have user-read-recently-played,user-read-currently-playing,user-read-playback-state

<!-- gh-comment-id:927157591 --> @ashleney commented on GitHub (Sep 25, 2021): No idea which one of these is currently doing the magic, but I have `user-read-recently-played,user-read-currently-playing,user-read-playback-state`
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#405
No description provided.