Pianobar: Command line Pandora client HOWTO

In the past few weeks, I’ve found myself installing and configuring Pianobar a lot. It’s an open source command line client for the popular Internet music streaming service, Pandora. In rebuilding a couple of machines recently, I have found myself installing and configuring it a few times, and I keep stumbling over it, because it’s broken in the Ubuntu and Debian repositories, so in order to get this really great application to work, it takes a few more steps than a quick apt-get install command.

This little writeup is at least in part for my own benefit, since I’m sick of the stumbling and trying to remember, wait, what did I do to get this to work again? So if it helps any of my readers out, even better!

Apt-get won’t work, but this isn’t that much more difficult

When I first tried Pianobar, I installed it from the repositories, and immediately found it unusable. I basically got a TLS error when it tried to authenticate when logging in with my Pandora One account, and as of the time of the writing of this, that is still the case.

Further research indicated that this was an issue with the version in the repos, and the only way to get around this was to build it from source.

No problem. I might be doing the lazy thing by running things like Mint and other Debian based distros these days, but hey… I spent 8 or 9 years running Slackware as my main distro, so I’m no stranger to compiling things from source!

Still, this is a bit twitchy to configure, which is why I’m writing this.

Step one: Install Git

Ready for a little command line action? Good. The first step here is to install Git, if you don’t already have it.

For those of you running something Debian based, that’s just a simple command:

sudo apt-get install git

If you need to compile Git from source, or install it with a different package manager, you probably already know how to do that, so I’ll just move on to the next step.

Step two: Grab the latest Pianobar code from Git

Just so you know, this will create a “pianobar” subdirectory in whatever directory from which you run this.

git clone https://github.com/PromyLOPh/pianobar.git

Step three: Dependencies

Now you need to install the stuff that Pianobar needs in order to compile and run:

sudo apt-get install libao-dev libmad0-dev libfaad-dev libgnutls-dev libjson0-dev libgcrypt11-dev

Step four: Compile and install

This is the moment of truth. If any of the above steps threw any errors, this part won’t work:

cd pianobar

make && sudo make install

Step five: Config file stuff

Finally, you need a config file. In your home directory, under .config, if there isn’t one already, create a pianobar directory, and put an empty text file called “config” in there containing this text.

The key element here is the bottom chunk, which is the part I kept on stumbling over in getting Pianobar to work:

high-quality audio (192k mp3, for Pandora One subscribers only!)
audio_quality = high
rpc_host = internal-tuner.pandora.com
partner_user = pandora one
partner_password = TVCKIBGS9AO9TSYLNNFUML0743LH82D
device = D01
encrypt_password = 2%3WCL*JU$MP]4
decrypt_password = U#IO$RZPAB%VX2
tls_fingerprint = B0A1EB460B1B6F33A1B6CB500C6523CB2E6EC946

Run it!

Pianobar is run simply by typing pianobar into a terminal. I actually like to run it from one of my virtual consoles (ctrl+alt+f1, for example) so that it isn’t even taking up a window on my desktop.

I posted this in last week's laptop rebuild post, but I figure it belongs here too. Pianobar in all its command line glory!

I posted this in last week’s laptop rebuild post, but I figure it belongs here too. Pianobar in all its command line glory!

I’m not going to do a full rundown of how to use pianobar; if you got this far, you can figure that much out from here. Hint: hitting the “?” key will pretty much give you all you need.

Oh yeah, and if you don’t like typing your Pandora account credentials every time, add this at the bottom of your config file:

user = your@user.name
password = password

Or, if you prefer,

password_command = gpg --decrypt ~/password

Then it will log in automagically every time you run Pianobar.

Enjoy!

About these ads

6 thoughts on “Pianobar: Command line Pandora client HOWTO

  1. I wonder if compiling from source with the version in the repository would have worked

    apt-get source –compile [package]

    You still get the same version from source and compile it, the only advantage I can see is it being part of your package manager to update down the road

  2. As a long time Pandora / Pithos user I recently had the need to run pianobar on a Raspberry Pi.

    For the ~/.config/pianobar/config file I only needed the user and password, none of the other partner or tls stuff.

    Thanks for the write-up.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s