Announcements

Help Wizard

Step 1

NEXT STEP

Regarding voice controlled music player

Regarding voice controlled music player

I have tried to use voice control using pycharm and connect it to spotipy api but the problem was this error is shwon 

HTTP Error for PUT to https://api.spotify.com/v1/me/player/play with Params: {} returned 403 due to Player command failed: Premium required
Traceback (most recent call last):
File "C:\Users\nithi\PycharmProjects\pythonProject1\venv\Lib\site-packages\spotipy\client.py", line 271, in _internal_call
response.raise_for_status()
File "C:\Users\nithi\PycharmProjects\pythonProject1\venv\Lib\site-packages\requests\models.py", line 1021, in raise_for_status
raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 403 Client Error: Forbidden for url: https://api.spotify.com/v1/me/player/play

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\Users\nithi\PycharmProjects\pythonProject1\main.py", line 67, in <module>
sp.start_playback(context_uri=playlist_uri)
File "C:\Users\nithi\PycharmProjects\pythonProject1\venv\Lib\site-packages\spotipy\client.py", line 1821, in start_playback
return self._put(
^^^^^^^^^^
File "C:\Users\nithi\PycharmProjects\pythonProject1\venv\Lib\site-packages\spotipy\client.py", line 338, in _put
return self._internal_call("PUT", url, payload, kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\nithi\PycharmProjects\pythonProject1\venv\Lib\site-packages\spotipy\client.py", line 293, in _internal_call
raise SpotifyException(
spotipy.exceptions.SpotifyException: http status: 403, code:-1 - https://api.spotify.com/v1/me/player/play:
Player command failed: Premium required, reason: PREMIUM_REQUIRED

 

but the main thing is that i already have premium subscriptio  still this is shown

Reply
1 Reply

I guess you are trying to use Client Credentials, but you need to use the code With user authentication.

Suggested posts