Help needed to test Spotify plugin with Oauth

Hi there,

Been enjoying your work for a while now, and I was wondering what is keeping this from the plugin store.
Apart from that it would be nice to have a play all button when your in an album or a playlist.
Just like when browsing local files.

many thanks

Dennis

Hi Dennis, unfortunately I am really busy right now and don’t have the time to do any more work to finish up the plugin. That said, another Volumio member has extended the code to let people plug in their refresh token in the Spotify plugin’s credentials screen, and I believe he is going to submit the finished plugin to the Volumio team.

Hi skikirkwood,

No worries, was just wondering.

cheers,
Dennis

Hi Marco, you may want to ping @xlisec and see if between the two of you the plugin can be packaged up and submitted to the Volumio team. The Spotify Web API has support for pagination, I think the challenge is how to work it into the Volumio UI.

Hello everybody,

I’ve some trouble with the file replace, I’ve downloaded index.js and copy the refresh token from spotify develop but i can’t find where i must copy in this token to file …

no refresh token in the index.js
which exact place in the file ???
Can you help me please?

Regards from germany
Torsten

In line 451 replace the x’s with your refresh token:
var refreshToken = ‘xxxxxxxxx’;

:arrow_right: Einfach die x innerhalb der Anführungszeichen mit deinem Refresh Token ersetzen.

Hello an good evening. It might be a stupid question, but how do i grab the file and store it on my pc?

Thx a lot and have a nice weekend

Hi there, I would recommend finding a friend who has some basic Linux command experience and you’ll be saving yourself a lot of time and frustration. Buy them a good bottle of wine and you’ll be up and running with the new plugin in 5 minutes!

Hi,
I sorry for late reply, but I had some trouble. You know christmas, work, family… . I tried improve this plugin. My work is here help-needed-test-spotify-plugin-with-oauth-t10071-110.html#p52474. It’s only draft, but it works. You can use it and report results here. I will try create a zip installer from my modified plugin on christmas holyday. PR to github, after that (if the zip installer will work).

Hi,
worked my path through the described procedure and it worked so far. Thumbs up!
I am only wondering if the section “My playlists” is limited to 50 playlists?
(actually I have much more playlists in my spotify account, but only the first 50 are shown)

Thanks for any help or info about that.
Greetings . Volker.

Hi,

Im on latest version volumio: 2.513, and sadly it didn't work for me :frowning: Ive tried two times.

Hi There, unfortunately the Spotify Web API maxes out at 50 results. There is support for pagination, and I believe some other contributors here are looking at extending the plugin to support paginated results.

I tested both procedures . They worked fine.

:slight_smile: Thx alot and have a nice x-mas time

Unfortunately I was busy during december/christmas holidays.

The Spotify Web API has pagination support. Here is an example of a request containing playlist 3 and 4 of my total 268 playlists. I’m using small numbers for explanation, at the end we would of course use the maximum of 50 results (and then the next 50 and so on).

{ "href":"https://api.spotify.com/v1/users/almeidactu/playlists?offset=2&limit=2", "items":[ ... // array containing playlist 3 and 4 ], "limit":2, "next":"https://api.spotify.com/v1/users/almeidactu/playlists?offset=4&limit=2", "offset":2, "previous":"https://api.spotify.com/v1/users/almeidactu/playlists?offset=0&limit=2", "total":268 }

So as you can see, the api result includes the correct search urls for both previous (playlist 1 and 2) and next (playlist 5 & 6) results. So how can we add this to the Volumio UI? Is it possible to add a “next” arrow button to the navigation right beside the “back” arrow button? If so, then maybe we could map the previous/next search urls to these buttons and populate the list on the fly? Is it possible to perform a search request upon pressing these navigation buttons or are they static? :question:

Thank you for this. It worked and I have my playlists back.

[quote=“fork”]
Hi,

Im on latest version volumio: 2.513, and sadly it didn't work for me :frowning: Ive tried two times

I used skikirkwood’s procedures successfully, however, as soon as I updated to version 2.513 my playlists and other features were deleted.

Now the procedures do not work and I have tried a few times under version 2.513 and the previous version.

Hi everybody,
Thanks a lot for the fantastic work you are doing!
I followed the instructions on page 17, now I can see may playsists, saved albums etc, I can put the on the queue BUT I cannot play any song from Spotify. Playing files from my disk i’ts ok when I try to play a song from spotify nothing happens.
Here the log file :

2019-03-02T15:00:05.387Z - info: CoreCommandRouter::volumioPlay
2019-03-02T15:00:05.388Z - info: CoreStateMachine::play index 9
2019-03-02T15:00:05.389Z - info: CoreStateMachine::setConsumeUpdateService undefined
2019-03-02T15:00:05.389Z - info: CoreStateMachine::stop
2019-03-02T15:00:05.389Z - info: CoreStateMachine::setConsumeUpdateService undefined
2019-03-02T15:00:05.390Z - info: CoreStateMachine::updateTrackBlock
2019-03-02T15:00:05.390Z - info: CorePlayQueue::getTrackBlock
2019-03-02T15:00:05.390Z - info: CoreStateMachine::stPlaybackTimer
2019-03-02T15:00:05.391Z - info: CoreStateMachine::pushState
2019-03-02T15:00:05.391Z - info: CoreStateMachine::getState
2019-03-02T15:00:05.391Z - info: CorePlayQueue::getTrack 18
2019-03-02T15:00:05.391Z - info: CoreCommandRouter::volumioPushState
2019-03-02T15:00:05.392Z - info: CoreCommandRouter::executeOnPlugin: volumiodiscovery , saveDeviceInfo
2019-03-02T15:00:05.413Z - info: CoreStateMachine::serviceStop
2019-03-02T15:00:05.414Z - info: CorePlayQueue::getTrack 18
2019-03-02T15:00:05.414Z - info: CoreCommandRouter::serviceStop
2019-03-02T15:00:05.415Z - info: ControllerMpd::stop
2019-03-02T15:00:05.415Z - info: ControllerMpd::sendMpdCommand stop
2019-03-02T15:00:05.419Z - info: sending command...
2019-03-02T15:00:05.425Z - info: 
---------------------------- MPD announces state update: player
2019-03-02T15:00:05.426Z - info: parsing response...
2019-03-02T15:00:05.426Z - info: ControllerMpd::getState
2019-03-02T15:00:05.427Z - info: ControllerMpd::sendMpdCommand status
2019-03-02T15:00:05.427Z - info: CoreStateMachine::play index undefined
2019-03-02T15:00:05.428Z - info: CoreStateMachine::setConsumeUpdateService undefined
2019-03-02T15:00:05.428Z - info: sending command...
2019-03-02T15:00:05.429Z - info: CorePlayQueue::getTrack 9
2019-03-02T15:00:05.430Z - info: CoreStateMachine::startPlaybackTimer
2019-03-02T15:00:05.430Z - info: CorePlayQueue::getTrack 9
2019-03-02T15:00:05.431Z - info: [1551538805430] ControllerSpop::clearAddPlayTrack
2019-03-02T15:00:05.431Z - info: {"service":"spop","type":"song","title":"Cloud of Light","name":"Cloud of Light","artist":"Masayoshi Fujita","album":"Book of Life","albumart":"https://i.scdn.co/image/a7ccd56f0723dcdf8b9f8ce96a2a5e8d905db696","uri":"spotify:track:4VHPXux9669W5GxFG0Usoy","samplerate":"320Kbps","bitdepth":"16 bit","trackType":"spotify","duration":309}
2019-03-02T15:00:05.432Z - info: [1551538805431] ControllerSpop::sendSpopCommand
2019-03-02T15:00:05.432Z - info: ADDING DEFER FOR COMMAND uplay
2019-03-02T15:00:05.437Z - info: SPOP command error:
2019-03-02T15:00:05.438Z - info:  message=This socket has been ended by the other party, stack=Error: This socket has been ended by the other party
    at Socket.writeAfterFIN [as write] (net.js:364:12)
    at applyWithContext (/data/plugins/music_service/spop/node_modules/fast.js/function/applyWithContext.js:15:22)
    at /data/plugins/music_service/spop/node_modules/fast.js/function/bind.js:63:14
    at onBoundPromise (/data/plugins/music_service/spop/node_modules/kew/kew.js:834:10)
    at ncall (/data/plugins/music_service/spop/node_modules/kew/kew.js:816:44)
    at Object.nfcall (/data/plugins/music_service/spop/node_modules/kew/kew.js:803:16)
    at Promise._successFn (/data/plugins/music_service/spop/index.js:1461:16)
    at nextTickCallback (/data/plugins/music_service/spop/node_modules/kew/kew.js:47:28)
    at _combinedTickCallback (internal/process/next_tick.js:131:7)
    at process._tickCallback (internal/process/next_tick.js:180:9), code=EPIPE
2019-03-02T15:00:05.450Z - info: parsing response...
2019-03-02T15:00:05.450Z - info: ControllerMpd::parseState
2019-03-02T15:00:05.451Z - info: ControllerMpd::sendMpdCommand playlistinfo
2019-03-02T15:00:05.451Z - info: sending command...
2019-03-02T15:00:05.453Z - info: parsing response...
2019-03-02T15:00:05.453Z - info: ControllerMpd::parseTrackInfo
2019-03-02T15:00:05.454Z - info: ControllerMpd::pushState
2019-03-02T15:00:05.454Z - info: CoreCommandRouter::servicePushState
2019-03-02T15:00:05.454Z - info: CoreStateMachine::syncState
2019-03-02T15:00:05.455Z - info: CoreStateMachine::pushState
2019-03-02T15:00:05.455Z - info: CoreStateMachine::getState
2019-03-02T15:00:05.455Z - info: CorePlayQueue::getTrack 9
2019-03-02T15:00:05.455Z - info: CoreCommandRouter::volumioPushState
2019-03-02T15:00:05.456Z - info: CoreCommandRouter::executeOnPlugin: volumiodiscovery , saveDeviceInfo
2019-03-02T15:00:05.477Z - info: CorePlayQueue::getTrack 9
2019-03-02T15:00:05.478Z - info: Received update from a service different from the one supposed to be playing music. Skipping notification.Current spop Received mpd
2019-03-02T15:00:05.481Z - info: ------------------------------ 56ms

Volumio version 2.555

Thank you for your help

Hi,
This works great for listing the playlists, however, when I press any of the playlists, I can’t access them nor play any songs from them :confused:

A patch will be available in the next few days. Spotify made a non-backward compatible change in their API recently.

Working on it now…