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:
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
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.
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 = firstname.lastname@example.org
password = password
Or, if you prefer,
password_command = gpg --decrypt ~/password
Then it will log in automagically every time you run Pianobar.