[PLUGIN] Pandora Plugin 2.0

Since COVID-19 kept me indoors for a while, I decided to rewrite this plugin and address some of the shortcomings of version 1.0.

1.0.0 was written using the volatile state and wasn’t integrated well with the Volumio interface. About the only thing you could do was to start it up and it would roll on and on until you turned off Volumio or the plugin.

2.0 is much better. Previous, Next and Pause actually work now, and the tracks load up in the Volumio queue like other plugins. From the queue, you can delete undesired tracks and click on one that you want to see. Each play cycle loads about four tracks to the end of the queue.

If you don’t like a particular artist, you can add them to a filter list in the plugin options, like ‘One Direction%Barbra Streisand’ (shudder). The %-delimited list is parsed into an array and the tracks are pruned before you ever see them. Pandora can do this with thumbs-down, but in my experience, each track gets eliminated but the band shows up until you give a lot of thumbs-down to an artist. Why not kick them in the teeth to begin with?

The track data downloaded from the Pandora servers expires after a little while. When I first got this version rolling, a click on the old data would start a frightening cascade of deleted tracks. Today, I made this a bit more sane and they pop off about every 10 seconds, one at a time.

As far as using a VPN with this service, sure you can. I’m not going to help you with that, though. Of course it’s possible to do. Setting up a VPN in Linux is a question of searching for the right tutorial. Or just point Volumio at a VPN gateway machine. Or a container. Seriously, it’s not that hard and maybe you’ll learn something that you can use again.

Bug reports are welcome! I’m not sure how many more features I can add, but the framework I’m using is very robust, so you never know.

Anyway, I think you’ll find that this is going to work well for you. There may be mistakes and there probably are. I’ll fix everything I can that I find and that is pointed out to me.

For now, go to https://github.com/truckershitch/volumio-plugins to the plugins/music_service/pandora directory. Directions are within. You will have to SSH into Volumio. I haven’t done a pull request yet so this plugin is not available with a click or two of the mouse from Volumio. The old one is but you want the new one.

Today is July 20, 2020 and it’s really hot here. What I mean to say is, if you grab a version today, it might be different tomorrow. I have been looking for small things to add just about every morning when I get up, and lately the fixes are nearly exclusive to the new features. But I’m running out of ideas so I’ll make that pull request very soon.

I said it in the directions, but here it is anyway: go to http://volumio.local/dev or http://your-hostname-here/dev and enable SSH for Volumio there. PuTTY works in Windows if you’re stuck on that OS. Macs can SSH at the command line but I can’t help you there; I don’t have a Mac.

So I guess this is the “official” Pandora thread. I’ll try to pay attention to it. Go ahead and post away!

You know, I wrote the last plugin and hardly anyone seemed to notice except for the people who helped me code it. I wrote it to give back to the open source community because I have taken so much from it over the years. I hope some of you like it.

Adios for now. All this typing makes me tired.

TL;DR Seriously you can’t read? Just go to the GitHub page. At least my post isn’t in one paragraph.



I pushed a few revisions to GitHub in the past few days. I’m on 2.0.4, if anyone is paying attention.

  • Previous/Next, Dual-Function Previous button option (works similar to a CD player, if you’ve ever used one of those :D)
  • Volumio has a built-in consume mode for played tracks but I couldn’t get it to work the way I wanted it to, so I wrote my own function. I will revisit this if there is a good reason to, otherwise it’s fine as it is.
  • Other bug fixes, mostly having to do with expiring tracks and the queue.

Check it out!

1 Like

I still haven’t filed a pull request yet. I found another small bug, so I’m putting it off for just a little longer.

Version 2.1.0 is up now. I had a switch for Pandora One users but they were getting the same quality stream as the free users (I don’t have a Pandora One account at this point so I haven’t tested that). I looked around the web and the guy who did the Pithos player had a post that mentioned the 192 Kbit/s stream for Pandora One users.

The Unofficial Pandora API has a JSON dump of a playlist object on their site, so I found the right object key (I think – I can’t test it at this point as I said) and put that into the code. The rest was already written so it was a quick fix.

So if you have a Pandora One account, check it out. Just flip the switch in the plugin options and restart the plugin. And let me know!

Also, I have a question for you. Does anyone have any interest in lower quality streaming? It seems like everyone around here is really into the best audio they can get, but maybe some of you are paying for bandwidth. There are about six other lower-quality streams available. I might just code that in there anyway, but if someone wants it I’ll do it more quickly.

Anyway, I’d be stoked if someone would give this a shot. I’m listening to Jimi Hendrix and Steely Dan on Pandora right now. I have left it running for a few hours without any problems with playback.

The one thing that bugs me is that the Volumio song timer goes slowly if I leave the Volumio browser tab to surf the Internet, do emails, post on this forum, etc. But it fixes itself at the end of the song.

Does anyone have a suggestion? Should I push the state every ten seconds or so or won’t that work? That seems silly to me.

Anyway, go to my GitHub fork and try it! Right now you have to install it manually, but it’s not hard to get working and you can uninstall it from the Plugin menu if you hate it.

volumio@dhvani:~$ git clone https://github.com/truckershitch/volumio-plugins.git
Cloning into 'volumio-plugins'...
remote: Enumerating objects: 94, done.
remote: Counting objects: 100% (94/94), done.
remote: Compressing objects: 100% (54/54), done.
remote: Total 13498 (delta 68), reused 61 (delta 37), pack-reused 13404
Receiving objects: 100% (13498/13498), 172.87 MiB | 1.51 MiB/s, done.
Resolving deltas: 100% (5546/5546), done.
Checking connectivity... done.
Checking out files: 100% (5047/5047), done.
volumio@dhvani:~$ cd volumio-plugins/plugins/music_service/pandora
volumio@dhvani:~/volumio-plugins/plugins/music_service/pandora$ npm install
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN Invalid version: ""
npm WARN pandora No description
npm WARN pandora No repository field.
npm WARN pandora No README data
npm WARN pandora No license field.

up to date in 0.742s
volumio@dhvani:~/volumio-plugins/plugins/music_service/pandora$ echo $?

I did updates, got some, and rebooted before I tried that.

Progress as user volumio on rPi running volumio

git clone https://github.com/truckershitch/volumio-plugins.git
cd volumio-plugins
git checkout pianode
cd plugins/music_service/pandora
npm install
#wait just shy 15minutes (reported 830seconds)
volumio plugin install
#error about pandora already installed
# cntrl-C after waiting awhile...2-3 minutes
# browser uninstall pandora 1.0.0
volumio plugin install
# still no working
# cleaning out plugins, rebooted
# status: no pandora plugin installed - hooray
# login
cd <blah>/pandora
volumio plugin install
# wait 
# browser window begun spinning rPi so busy
# load at 19!!!
# my 2nd tty has >1min idle time its so slow to respond w command
# load 19.93
# 13.5 minutes busy
# load 20.04 17:24 idle 
# response time of 2nd tty is forever...but she's not dead yet!!!
# 20 minutes, load is falling just under 17.5
# load 21.06!!! but she's holding together
# almost 24 minutes, tty response 2 minutes
# browser window is still spinning
# this seems to be what's up
# <Unpacking libavfilter-dev>
# at this point I'm afraid to run top, pressing return twice and running w is taxing...
# 55minutes, still libavfilter-dev unpack, load just under 17
# 77minutes, load is down under 1, still says unpacking libavfilter
# volumio plugin install has not returned
# bowser reports v1.0.0 installed
# logged in: reports success login
# plugin (v1.0.0) not working, no stations listed

I gotta go to bed, more testing soon

the ssh section of the readme is in the wrong place, and that header about 2 versions is strangely placed.
checkout of pianode was not optional - need the cd into volumio-plugins to run it
had to uninstall the 1.0.0 plugin (maybe also reboot?) before install

npm install won’t get rid of the old plugin. This has to be done manually or by using the Volumio Plugin menu (choose the plugin and click Uninstall). npm only deals with the various node.js dependencies of the plugin.

I’d say, for now, if you have a spare SD card, try a fresh installation of Volumio and then upgrade.

Alternatively, you can delete the old version of the plugin first. That’s pretty simple also.

Try this (you can always just install 1.0.0 again from Volumio so it’s not a big deal):

rm -rf /data/plugins/music_service/pandora
rm -rf /data/configuration/music_service/pandora

Then, with the clone (I’ll fix that version number now), do the same thing you did before:

cd /path/to/volumio_plugins/plugins/music_service/pandora
volumio plugin install

I should advise that the pianode branch is highly experimental and works the least. That was my first try at getting Pandora to work in Volumio. I amended the Readme.md to reflect this. It pulls the pianode source and compiles it (this is probably why it took so long and the load was so high (20.04! goodness!) and adds a few packages to Volumio via apt-get install.

You may run into some problems – it may not work with the newer Volumio versions. I haven’t worked on the code in a few years. It makes a manual change to the mpd.conf file to add support for libao which pianode needs to output sound. The other packages that are mentioned in install.sh in the pianode branch of the plugin can just be uninstalled with apt-get uninstall, or just leave them there.

It looks like the only other thing you’ll have to fix is /etc/mpd.conf. I think Volumio generates that when you do the installation wizard, so that might easily be fixed also.

What you might be able to do if you need to save your other plugin configurations is to back up /data/plugins/ and /data/configuration (deleting the pandora directories within). I’m not sure if that would work but you could try it. Or just do a Volumio reset from the Settings menu. Back up the configuration directory for sure.

I highly apologize. I wasn’t clear in the Readme.md file about the pianode branch or how to uninstall the old plugin.

I forgot to mention this. You need to either checkout the master branch again or just delete the git clone directory and clone it again from scratch to access the master branch. Otherwise, you’ll just install v1.0.0 or pianode again.

To just switch to master: git checkout master

Basically, you just dump those files from Git into /data/plugins/music_service/pandora, do a npm install in that directory, go back to the browser (http://volumio.local or whatever), go to the Plugins menu, go to Installed Plugins, and flip the switch to turn it on. Sometimes, for some reason, you might have to flip it again, but it should work.

Then, just go to the settings button on that same Plugin Installation page and enter your Pandora credentials. You have to then flip it off, and then flip it back on, and that’s it. Don’t forget to add some lousy bands to the Band Filter! Or not.

Make sure you run the First Installation Wizard or whatever it’s called in Settings to get rid of that crap that the pianode plugin put in /etc/mpd.conf. That should do it.

Anyway, I do hope that puts you in the right place!

EDIT: Updated instructions are on the GitHub page linked in the first post.

I did a fresh install of volumio onto a new microSD card.
git clone
cd volumio-plugins
get checkout master
cd plugins/music_service/pandora
volumio plugin install
# cntl-C
# plugin reports installed v2.1.2

must have had a bad password, turned it off, back on, got a login error, corrected, off back on and now I have Pandora!!! I’d hug you if we weren’t in quarantine!

Excellent, @downtownHippie! That’s good to hear.

For those of you watching, that Ctrl-C is needed after entering:

volumio plugin install

or if the older plugin is still installed:

volumio plugin upgrade

See the Readme.md file at the GitHub page linked above. It’s current as of this morning.

For some reason, the Volumio installation script stops there, but the work has been done. My install.sh script is generic, so I’m not sure what’s going on there.

So, if you go into the Volumio Queue, which you can access from the lower-right corner of the screen (three horizontal lines and a small triangle – if you hover over it with your mouse, it says “Queue”). you can remove tracks or skip ahead or backwards. If you have Random/Shuffle mode enabled (the two wavy arrows near the media buttons), Prev/Next will just go to a random track.

If you enable that Dual Previous Button switch, a click on Previous will replay the song, and two quicker clicks will go to the previous queue track in Normal playback mode, or a random track in Random/Shuffle playback mode. Random may be pointless in Pandora since it’s pretty random anyway, but I threw that in there. Ditto for the Dual Previous Button switch, but it seemed like a good idea at the time.

When a new song plays, if the queue size is less than 20 songs, the plugin grabs up to 4 more tracks, applying the band filter and not adding any tracks that are already in the queue. 20 was an arbitrary number but it seems large enough. I suppose that could be an option as well.

The tracks expire if they have not been played for 45 minutes. The authorization doesn’t last too much longer than this anyway.

These values work okay for average length tracks (say 3 to 6 minutes). If you’re listening to longer tracks, you’ll see more tracks expire. There is a track lifetime check that is supposed to fire off every 5 minutes. It actually fires off about every 3.5 minutes on this Raspberry Pi 4 B. Go figure, but it really doesn’t matter.

New feature requests are okay with me. For instance:

  • I want to try and implement a Create Station function, possibly with the Search function, but really, you can just go to https://www.pandora.com and do it there, then leave and go back to Volumio.

  • Thumbs Up/Thumbs Down:
    At this point, I’d need some more UI elements to make that happen. I don’t think Volumio has changed the plugin capabilities since I made v1.0.0. But if some kind of interface can be configured, that could be implemented.

Anyway, if you see something weird, I’ll try and fix it.

So as of now the plugin can’t affect a station…de-queueing a song does NOT remove it from the station (thumbs down in pandora parlance), it just de-queues it, right?


Basically, the plugin grabs about 4 tracks worth of information. You can listen to it or not, but removing a track from the queue sends no information whatsoever back to Pandora.

Which I guess could be good or bad, depending on your viewpoint. And maybe that should be a thumbs-down? I could implement that and put a toggle switch in the options.

Also, adding a band to the band filter: Pandora sends 4 tracks (usually). The plugin says, I’ll take three and tosses the ones where the artist is Hanson. It still got the information but the plugin doesn’t add the track to the queue. You’re not saying to Pandora, “@#$% you I won’t listen to them anymore!” Pandora doesn’t stop trying to send Justin Bieber tracks.

What I mean to say is, if you remove the artist from the filter, your sister can listen to Ke$ha. Just don’t invite me over.

I think both, just dequeue, and thumbs down, are good options. (where’s that both gif?)

I went down a small rabbit hole trying to listen for socket.io events emitted by Volumio. Volumio works fine but I had the wrong preconceptions.

I tried to do this by listening for ‘removeFromQueue’ events emitted from Volumio, and then I realized that those weren’t generated. That probably wouldn’t have worked anyway because each track removed would be banned, and my consume function removes a track after it plays. So every played track would be banned unless I added my own event to special cases. That may be possible by overriding a function or two but I don’t think I could do that easily.

So I added it to the Next media button, and it’s optional. Flip a switch in the settings and it’s live. The track gets the ‘thumbs-down’, it gets removed from the queue, and playback continues. Or leave it off and nothing is sent to the Pandora servers.

I got rid of two tracks and verified them on the Pandora website (go to Collections, choose your station, scroll down a little bit and you can see what thumbs you’ve given, positive and negative). So it works.

There is a really well-written Pandora client called pianod2 at http://deviousfish.com/Pianod2/index.html It has a great interface and you can edit your thumbed tracks and remove them if you need to. You have to compile it, but as I understand it, the author removed some dependencies and it’s probably easier to get working now. It has a ton of functionality and it’s completely free.

Give it a shot.

until your plugin came along I was ssh-ing into my volumio box and running pianod2, nice. I liked the integration into the UI, I thank you for this.

Attention all Headbangers, Punk Rockers, Shoe Gazers, Tube Pullers, Double-Clickers, etc.:

The new Pandora Plugin is available to install from the Plugins menu.

Release Notes (Readme.md)

Maybe you want version 1.0.0. Okay, the instructions are in the Release Notes.

Rock on. Or go take a nap. Your choice.

Updated through the UI today, seems to be working well, as soon as Hammer Time comes up I’ll test the Next/Thumbs-down.

This morning, a few tracks played and I selected another track further down in the queue. After a little while, I noticed that playback had stopped. It looked like a track had expired.

I’m not sure exactly what happened. I clicked a previous track in the queue, and it seemed to be expired as well, but the playback started back up.

Incidentally, the expiration loop was running. I tried several times to reproduce the error. Maybe it had to do with the Pandora servers.

Anyway, I put a .fail() clause in clearAddPlayTrack() to call goPrevNextTrack(), which will in turn advance the queue position, which calls clearAddPlayTrack(), and you get the idea…

I just pushed the commit to my repo. I’ll have to put in a new pull request before the change is reflected in the Volumio GUI Plugins menu.

Something odd is going on and it started a few hours ago. I thought it was specific to me but another user is also affected. The plugin is failing to start. It logs in and tries to grab the station list from the server, and the server throws an error.

I’m not sure what it is because that part of the code has been very stable. To rule out the new version, I reverted to v1.0.0 which worked fine before, but the same thing happened.

I’ve tried running through a VPN to change my IP address, and I’ve tried with someone else’s Pandora account and nothing has worked so far.

It may be a temporary issue. I’ll have to take a look at this tomorrow morning as it seems pointless to look at this any more today.

I will try with different device credentials (default is to log in as an Android device) but I don’t think that is the problem.

Cross your fingers.

FWIW, I think the pandora client assumes mobile clients are low bandwidth and might resist the continued…specifically continued use at high bandwidth?

This could be true. There aren’t many choices to pick from as far as credentials go:

  • Android
  • iPhone
  • Palm
  • Windows Mobile
  • Pandora One
  • Vista Widget (maybe this one?)

Here’s the link: https://6xq.net/pandora-apidoc/json/partners/

I did try switching credentials last night on this site:


There is a small code sample there that shows the functionality of the plugin. The request module was throwing the same error I got in my client with alternate credentials (error [0]).

Maybe there was some kind of timeout. I went so far as to start switching the request dependency in anesidora to cross-fetch. I stopped in the middle of that after a GitHub user said his plugin was running. I tried on my end and my plugin worked.

It’s troubling though. I didn’t have access with the plugin on my end for over six hours. The Pandora website was working fine.

I’m listening right now and things seem okay. The whole thing doesn’t make me comfortable. It might have been the credentials, but I used the same credentials in v1.0.0 and as far as I know it hasn’t had any major problems in two years. I think it was some kind of network problem.

Anyway, I’ll keep looking into it here.