spotcast
spotcast copied to clipboard
Could not get spotify token
Hi, I had a working spotcast integration since month and I didn’t change anything. Suddenly I got an error message:
Failed to call service spotcast.start. Could not get spotify token.
And the log entry:
Logger: homeassistant.components.websocket_api.http.connection
Source: components/websocket_api/connection.py:301
Integration: Home Assistant WebSocket API ([documentation](https://www.home-assistant.io/integrations/websocket_api), [issues](https://github.com/home-assistant/core/issues?q=is%3Aissue+is%3Aopen+label%3A%22integration%3A+websocket_api%22))
First occurred: 8:20:28 PM (2 occurrences)
Last logged: 8:20:31 PM
[547603782336] Error handling message: Could not get spotify token. (home_assistant_error) ... from ... (Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36)
The Spotify Integration is working. I tested it in isolation. I also refreshed the sp_key and sp_dc token in the spotcast config. I still get this error and I don’t understand where it comes from.
Any ideas?
Got the same, did the same!
Same issue here. Spotify website refuses to open in incognito mode so I am unable to renew my token. I suspect this is an intended move from their part. Any idea of a workaround?
Spotify in Incognito works for me.
I was able to get a new sp_key and sp_dc. For some reason my device_id also changed. Once restarted, casting worked without issues.
Sorry about the late reply. My initial attempt to visit spotify website was on my phone (desktop mode), I was a bit too naive. I can confirm that the method to get the sp values still work (on a computer browser!). For some reason these values had changed and updating them in spotcast did the trick. Everything is back in order, apologies for the false alarm.
Hi @Rafaille! I think I am having a similar issue with the spotcast integration (see here). Which steps did you specifically follow to get around this error? I am open to any suggestions.
Hi @Rafaille! I think I am having a similar issue with the spotcast integration (see here). Which steps did you specifically follow to get around this error? I am open to any suggestions.
Nothing specific really, my mistake was to use my phone. But on a web browser everything is fine. I just followed the normal procedure. What issue are you seeing?
@Rafaille
Oh, okay. Glad it worked out for you. Sadly, I got the error although using my pc.
2024-05-03 21:36:16.825 ERROR (MainThread) [custom_components.spotcast.spotcast_controller] Unsuccessful token request, received code 302 and Location header /get_access_token?reason=transport&productType=web_player&_authfailed=1. sp_dc and sp_key could be expired. Please update in config.
Double-checked the sp_dc and ps_key...no typos, nothing (I copy & pasted it from the Spotify developer panel). Even set up a new app, although I'm not sure if I had to completely start over from scratch for it to work.
Are you sure you used private mode on your browser and quit the page without logging out?
@Rafaille Edit: I am trying it right now. I'll keep you updated. Edit: It worked! Have used both keys from the developer panel before, which seems not to work.
Thank you so much! This was the hint I needed!
Not the developer portal you need to login to spotify and get the cookie details from there