witnessmenow / spotify-api-arduino

Arduino library for integrating with the Spotify Web-API (Does not play music)
MIT License
177 stars 33 forks source link

Parse error when using the get refresh token #64

Open HeikkiHietala opened 6 months ago

HeikkiHietala commented 6 months ago

Hi,

I had this running smooth for a couple years already, but now I had a persistent connection error. I plugged the ESP32 to my computer and tried to run the get refresh token routine, but I get this:

13:43:16.423 -> MDNS responder started 13:43:16.423 -> HTTP server started 13:43:22.755 -> grant_type=authorization_code&code=AQBrOGhJAHCDyNpYZ[... lots more,,,] 13:43:22.755 -> accounts.spotify.com 13:43:25.841 -> Connection failed 13:43:25.841 -> status Code-1 13:43:27.838 -> Could not parse errorgrant_type=authorization_code&code=AQBrOGhJAHCDyNpYZ-[... lots more,,,] 13:43:48.826 -> accounts.spotify.com 13:43:48.921 -> Connection failed 13:43:48.921 -> status Code-1 13:43:50.898 -> Could not parse error

I created another app in the Spotify dashboard, and I got to see Spotify allowing me to verify that app, but then the ESP error occurred again.

Could you please help me out on this one?

Many thanks in advance!

ZaleAnderson commented 6 months ago

Redownload the library, it has been updated. It fixed it sorta for me

LinuxlasGNUleaf commented 6 months ago

I'm having the same issue (I think), I can neither complete the workflow for getting a refresh token, nor can I use an exisiting one. I get a "Connection failed- status Code-1" message as well with DEBUG on. It really seems to be the POST request here that's causing the error. Did Spotify make changes to their API recently? This worked a week ago. The new certs didn't fix the issue either.

ZaleAnderson commented 6 months ago

Check my recent issue ticket, there is a temporary fix there.On Feb 10, 2024 16:51, JaWs @.***> wrote: I'm having the same issue (I think), I can neither complete the workflow for getting a refresh token, nor can I use an exisiting one. I get a "Connection failed- status Code-1" message as well with DEBUG on. It really seems to be the POST request here that's causing the error. Did Spotify make changes to their API recently? This worked a week ago.

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you commented.Message ID: @.***>

LinuxlasGNUleaf commented 6 months ago

@ZaleAnderson thanks for your willingness to help, but I checked your issue out beforehand and it sadly did not fix it for me. I increased some other buffer sizes as well just in case, but nothing helped. And the error is different to yours as well, it seems for me there's an issue with connecting with the Spotify API at all, not with the access token. I of course tried different WiFis and hotspots, but nothing helped.

noelPellkvist commented 6 months ago

Same issue for me, have tried updating the library and changing this line:

define SPOTIFY_ACCESS_TOKEN_LENGTH 600

Im using a NodeMCU 12S

LinuxlasGNUleaf commented 5 months ago

Has anyone been able to get this to work? I still have the exact same issue. I'm using an D1 mini PRO (ESP8266)

HeikkiHietala commented 5 months ago

I asked Chatgpt to fix this and reported it on my blog:

https://www.sabulo.com/sb/esp32-development-board/revising-the-esp32-spotify-display-with-chatgpt/

LinuxlasGNUleaf commented 5 months ago

Interesting, I managed to figure out what my problem with the library was, see #68 Turns out the SSL fingerprints are outdated. You might try that as well, would be interesting to know if this fixes your issue as well, even though you seem to have found an alternative for your project :)

HeikkiHietala commented 5 months ago

Well done you! Just now i don't have the time to test the solution, but I probably will try it later.

fladmas commented 1 month ago

@LinuxlasGNUleaf Worked for me. Thanks.