freundTech / SpotPRIS2

Control Spotify Connect devices using MPRIS2
MIT License
33 stars 3 forks source link

HTTP Error for GET to https://api.spotify.com/v1/me/player returned 403 due to error #13

Open TiGR opened 3 years ago

TiGR commented 3 years ago

When running from console I get

HTTP Error for GET to https://api.spotify.com/v1/me/player returned 403 due to error
http status: 403, code:-1 - https://api.spotify.com/v1/me/player:
 error, reason: None

How do I fix it?

joshskidmore commented 2 years ago

@TiGR I had this same issue. I think this might be related to having valid oauth token (from ~/.cache/spotpris2) with incorrect/stale scopes. For me, I recently switched computers where I installed SpotPRIS2 fresh (using pip), but copied the existing cached token file from the old machine rather than re-logging in and reauthorizing. This is what I did to resolve the issue:

  1. Ensure you have the latest SpotPRIS2 package (0.4.1) If you have pip, it's sudo pip3 install --upgrade spotpris2.
  2. Stop the SpotPRIS2 daemon.
  3. Remove the ~/.cache/spotpris2 file. This contains your oauth token.
  4. Start the SpotPRIS2 daemon. Because the oauth token file was removed, SpotPRIS2 will launch a browser and have you login to Spotify and approve the app/permissions.
TiGR commented 2 years ago

@joshskidmore I just use the latest Spotify version, they have fixed their MPRIS2 implementation.

joshskidmore commented 2 years ago

@TiGR Oh, wow - yeah, that implementation does work well, and it lets you control a remote Spotify player too. Wish I didn't have to run the entire Spotify GUI locally though.