witnessmenow / spotify-api-arduino

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

Connection error unless setInsecure(); is used #47

Closed jwoltersmann closed 2 years ago

jwoltersmann commented 2 years ago

Hi,

I get the following error:

Trying to refresh access tokens grant_type=refre.... [I cut this] stack size -1073741152 accounts.spotify.com Connection failed status Code-1
Could not parse errorFailed to get access tokens

But if i set client.setInsecure(); the code works. I read in another issue this has something to do with the fingerprint? I am not really into this topic but using grc.com/fingerprints for accounts.spotify.com I get the very same hash i find in SpotifyArduino.h so is there something else wrong?

I use an ESP 8266 if that is important

BTW thanks a lot for the Code, I am using it for a physical skip Button in my room, love it!

witnessmenow commented 2 years ago

Great to hear you have a use for the library!

As for the issue you are having, I guess the fingerprint has changed, which is the issue with using the fingerprint, it changes every few months.

To go back to using the fingerprint, they need to be updated here:

https://github.com/witnessmenow/spotify-api-arduino/blob/b26dffd2c995a1569f9eec0c3d02650c90b255cc/src/SpotifyArduino.h#L48

The best way to get them is probably using your own browser, but the easiest way is something like this:

https://www.grc.com/fingerprints.htm

So searching for spotify.com gives:

*.spotify.com — 4A:44:71:F7:6A:8D:D4:BD:54:E9:0E:3D:E8:6C:A6:E0:00:27:BA:D5

But from a quick glance that looks the same as what I have here, are you maybe using an old version of the library?

jwoltersmann commented 2 years ago

Okay I am not sure what fixed it but the issue is gone now without me changing anything really. That fingerpringt was also in my code so i don't think i had an old version....I guess it probably wasn't your code but more related to my Network/internet connection.