Help needed to test Spotify plugin with Oauth

Discuss, contribute and orient Volumio development!

Ads helps Volumio remain Free and Open Source. Please consider donating to help us continue to serve you.

Help needed to test Spotify plugin with Oauth

Postby skikirkwood » Sun May 05 2019 18:18

ma_sk1 wrote:@skikirkwood - You're welcome! 8-) Is something new with michelangelo and server for spotify acces token? :?:

Don't know, better to ask Michelangelo directly!
Volumio 2 on Raspberry Pi 3 B+, Schiit Modi 2 Multibit DAC, Volumio 2 on Raspberry Pi 3, IQAudio Pi-DAC+, Schiit Freya preamp, Bryston 3b power amp, B&W 803 speakers
User avatar
skikirkwood
Objectivist
Objectivist
 
Posts: 270
Joined: Thu Jan 08 2015 17:16
Location: Los Altos Hills, California

Ads helps Volumio remain Free and Open Source. Please consider donating to help us continue to serve you.


Help needed to test Spotify plugin with Oauth

Postby cmak » Thu May 23 2019 07:54

Many thanks @ma_sk1 and @skikirkwood for the very good work.

Plugin from https://github.com/majko96/volumio-plug ... ce/spotify works perfectly.


>> Is there any way to get better than 320Kbps audio quality?
Random avatar
cmak
Fresh off the boat
Fresh off the boat
 
Posts: 5
Joined: Thu May 09 2019 15:49


Help needed to test Spotify plugin with Oauth

Postby skikirkwood » Thu May 23 2019 14:40

cmak wrote:Many thanks @ma_sk1 and @skikirkwood for the very good work.

Plugin from https://github.com/majko96/volumio-plug ... ce/spotify works perfectly.


>> Is there any way to get better than 320Kbps audio quality?


320kbps is the highest quality Spotify offers for now.
Volumio 2 on Raspberry Pi 3 B+, Schiit Modi 2 Multibit DAC, Volumio 2 on Raspberry Pi 3, IQAudio Pi-DAC+, Schiit Freya preamp, Bryston 3b power amp, B&W 803 speakers
User avatar
skikirkwood
Objectivist
Objectivist
 
Posts: 270
Joined: Thu Jan 08 2015 17:16
Location: Los Altos Hills, California


Help needed to test Spotify plugin with Oauth

Postby doogyrrev » Tue May 28 2019 13:41

skikirkwood wrote:Here's a refreshed set of instructions on how to update your Volumio Spotify plugin to get it to both play your personal playlists as well as use new features not previously supported. If you are not comfortable with using command line Linux tools you may want to find a friend who is a geek, buy them a bottle of wine, and have them do this for you:

So to get this working you need to authenticate your Spotify account and get back a token that Volumio can then use in API calls to access your personal playlists. Here's what you need to do:

Get a Spotify Refresh Token

Go to http://54.86.144.136:8888/ and click on "Log in with Spotify".

After plugging in your Spotify credentials you should be redirected to a page that shows who you are logged in as, with two oAuth tokens. Copy the bottom "Refresh token".

Get a copy of the new Spotify index.js file
Now grab a new version of the Spotify plugin's index.js file from here:

https://github.com/skikirkwood/volumio- ... y/index.js

Plug in the refresh token you got from above
In line 451 replace the x's with your refresh token:
Code: Select all
var refreshToken = 'xxxxxxxxx';


Copy the edited file to your Volumio system
Now copy this file over to your Volumio system. First save the current version of the plugin's index.js file:

Code: Select all
ssh volumio@volumio.local
cd /data/plugins/music_service/spop/
cp index.js index.js.old
scp user@<your PC>:/path/to/new/index.js .


Reboot!
Reboot your Volumio system. Now you should be able to browse to your Spotify plugin, and with luck, "My Playlists" will work! Nice bonus is we can use artwork from Spotify for the grid view of the playlists.

Send any feedback here. Note that this is an early proof of concept. I spun up a new EC2 instance on AWS's free tier and installed Node.js to get the Oauth stuff working, can't guarantee it will be up all the time. Still need to tweak the check for when the access token expires and we then get a new one using the refresh token. If you get nothing after clicking on a link click it again. Also, need to add pagination so we're just getting back your 20 most recently playlists right now.

For production we'll figure out a smoother way to do this, at the minimum adding a refresh token to the the Spotify users settings screen.

Worked for me. Volumio 2.565 on Pi2.

Thank you very much.

Capture.PNG
Capture.PNG (1.44 MiB) Viewed 233 times
Pi2 - Volumio 2.565
Piano Hi-Fi DAC+
Onkyo TX-SR506 Receiver + Musical Fidelity MC2 speakers
User avatar
doogyrrev
Sunday DIYer
Sunday DIYer
 
Posts: 18
Joined: Thu Jun 09 2016 15:24


Help needed to test Spotify plugin with Oauth

Postby PjV » Thu Jun 20 2019 14:47

ma_sk1 wrote:...

The instructions from page 23 worked great, thanks.
Raspberry Pi 3B+ + Allo DigiOne => Dynaudio AIR 15 + BASE 12
Raspberry Pi Zero-W + Allo DigiOne + FiiO Taishan => JBL 308
Raspberry Pi 3A+ + USB DAC => JBL 305
Random avatar
PjV
Sunday DIYer
Sunday DIYer
 
Posts: 19
Joined: Tue Jan 09 2018 18:11

Previous

Return to Development talks

Who is online

Users browsing this forum: No registered users and 6 guests