Describe the bug
I am getting the 403 error whenever I try to start playback on a Spotify device.
I am attempting playback on my Google Home Mini speaker (using another library called pychromecast but that is working) with this code client.start_playback(device_id=spotify_device_id, context_uri=tag_uri)
on line 197.
The 403 error is usually when the user does not have Premium (I think). I have Premium though and have double-checked. The authorization works fine.
My code
Expected behavior
Actual behavior
Output
Environment:
Additional context
My code worked on Windows 10, then after being transferred to my pi it has no longer worked. I thought it was not authorizing correctly (it wasn't) so I fixed that, but I am still getting this same error.
I think this error might have something to do with the scope I am using, which is:
_scope = 'streaming user-read-playback-state user-modify-playback-state'
Please help!
I had this problem a while ago now, but if I remember correctly, I had been setting the Spotify URIs to lowercase, but Spotify URIs are case-sensitive. So when I made requests to start playback of those URIs, Spotify didn't understand some of them but understood others (URIs that had no uppercase letters). That explains why it worked on my laptop, but not on the raspberry pi. I had used different URIs on each (not very scientific).
It took me 3 months of on and off debugging to solve that one. Sometimes it is the smallest change that fixes the biggest problem.