pckhib / node-red-contrib-spotify

Node-RED node for Spotify Web API
MIT License
13 stars 16 forks source link

Installation of node-red-contrib-spotify in nodered fails #1

Closed jeroenhe closed 5 years ago

jeroenhe commented 5 years ago

First off, thank you for creating this NodeRED package. I'm looking forward to it working properly, as I look forward to be using it for home automation purposes.

When I install the node-red-contrib-spotify Version: 0.1.0 npm package using NodeRED' 'Manage pallete' page, I see this error appear in the logs:

12 Jan 07:21:43 - [info] Installing module: node-red-contrib-spotify, version: 0.1.0
12 Jan 07:21:48 - [info] Installed module: node-red-contrib-spotify
12 Jan 07:21:48 - [info] Added node types:
12 Jan 07:21:48 - [info]  - node-red-contrib-spotify:spotify : SyntaxError: missing ) after argument list
12 Jan 07:21:48 - [info]  - node-red-contrib-spotify:spotify-auth

I see the Spotify function then appear, but after filling in valid client credentials (that allow manual token retrieval) and a scope app-remote-control, I'm faced with a INVALID_CLIENT: Invalid redirect URI message.

Any ideas if this is faulty configuration on my side, or the error might indicate a bug?

jeroenhe commented 5 years ago

I just realised the redirect goes to my own nodered instance, which is not publicly available on the internet, causing the Invalid redirect URI message. Do you now any way to work around that?

pckhib commented 5 years ago

Hi, I couldn't reproduce the first error with the SyntaxError.

Regarding your second question: It doesn't matter, if your node-red- instance is public or not. I guess you're running node-red on localhost? I've added in the description a line on how to add a redirect uri in the Spotify Dashboard. This is necessary as Spotify only allows registered redirect uris.

All you have to do is add the following uri for the application in the dashboard: http://localhost:1880/spotify-credentials/auth/callback

Let me know in case you the problem isn't resolved or you have other questions.

jeroenhe commented 5 years ago

Thank you for amending the docs! I was now able to reach a page saying spotify.authorized, though I still had to click authorise. That doesn't matter if the token stays valid for a long time...

I'm now stuck at an error in Node-RED however telling me:

Flows stopped due to missing node types.
spotify

but that's needs more investigation and might deserve its own issue.

pckhib commented 5 years ago

Ok, this might still be a problem with the missing syntax error. See issue #2. I'm currently working on a fix for this.

jeroenhe commented 5 years ago

Ok, this might still be a problem with the missing syntax error. See issue #2. I'm currently working on a fix for this.

Great to hear! Let me know when you have a new version you want me to test.

vaclavhorejsi commented 5 years ago

Do you have any update on this, please?