jishi / node-sonos-http-api

An HTTP API bridge for Sonos easing automation. Hostable on any node.js capable device, like a raspberry pi or similar.
http://jishi.github.io/node-sonos-http-api/
MIT License
1.83k stars 462 forks source link

Are the spotify settings in settings.json actually required? #759

Closed hankhank10 closed 4 years ago

hankhank10 commented 4 years ago

Thanks for this awesome API. I've used it to build an NFC integration which plays a particular album from Spotify when an NFC tag is touched onto a Raspberry Pi: https://github.com/hankhank10/vinylemulator

I have found that the node-sonos-http-api works fine to call Spotify URIs even without the Spotify clientID and clientSecret strings stored in settings.json

Does this still actually do anything?

jishi commented 4 years ago

I understand the confusion. The spotify credentials was never required for playback when you know the actual spotify URIs. Then it uses the "default" Spotify account (the one first added) for playback. When this was built Sonos only supported a single Spotify account, so support for multiple ones was never really needed.

The credentials however, are required if you use the spotify search function. This is because I can't access the Spotify search service that Sonos provides, since it doesn't have the authentication info for calling it. Instead, it relied on Spotifys Webservice for searching their catalogue, which initially was unathenticated, but later switched over to require an application token (probably because it was abused).

Hopefully that cleared up some things.

hankhank10 commented 4 years ago

Thank you for the response

I hadn't even realised there was a search function built in - that's very cool.