SEARCH

How-To Geek

How to Automate Your Always-On Raspberry Pi Download Box

Installing and Configuring CouchPotato on Raspbian

2013-04-07_163201

If you’re exhausted from all that configuring in the previous section, take heart. SickBeard is by far the most complicated tool to configure in our roundup today. Let’s get started with CouchPotato–the movie equivalent to SickBeard’s automated TV downloading.

Installing CouchPotato: We’ve already installed all the dependencies, so let’s get right down to grabbing the source code from Git. At the terminal, enter the following command:

cd /home/pi
git clone http://github.com/RuudBurger/CouchPotatoServer.git
python CouchPotatoServer/CouchPotato.py

After you run the Python script, the cursor will just idle. If instead you get a crash dump, you’ll need to make a quick edit to allow you to turn on the web daemon and startup wizard. Only make this edit if the script crashes. At the terminal, enter the following command:

nano /home/pi/CouchPotatoServer/couchpotato/runner.py

In the script, page down until you see this section and add the line we’ve bolded:

config = {
'use_reloader': reloader,
'port': tryInt(Env.setting('port', default = 5000)),
'host': Env.setting('host', default = ''),
'ssl_cert': Env.setting('ssl_cert', default = None),
'ssl_key': Env.setting('ssl_key', default = None),
'host': Env.setting('host', default = "0.0.0.0"),
}

Save your changes and rerun the script. Once the script has run successfully, you can point your browser at the following address to get started:

http://[Your PI's IP Address]:5050/wizard/

Just like with SickBeard, we’re going to walk you through the basic setup. The relevant commands are listed by section.

Configuring CouchPotato: You can skip the Welcome section. We have no existing CouchPotato database to import (if you’re moving and old CouchPotato install to your new Raspberry Pi download box, follow the instructions and point the wizard at your old data.db)

In the General section, you can set a username and password, as well as change the port number if you wish. Uncheck “Launch Browser”.

2013-04-07_161500

In the Downloaders section, you need to either 1) set CouchPotato up to communicate with SABnzbd or 2) specify a watched folder for your torrent files to make it work with Deluge. We’re setting it up to work with SABnzbd: go ahead and leave the host alone and insert your SABnzbd API key (the same one you used for SickBeard).

You can also specify a SABnzbd category. In order to really automate the whole process, we highly recommend this step–by enabling a specific CouchPotato category, it helps the automatic renamer/file mover to work smoother.

In the Providers section, select the providers you wish CouchPotato to use. Just like with SickBeard, you’ll need to put in the login details/API keys for premium providers.

In the Renamers section, you can set up automatic file renaming/moving. This is a fantastic feature. Set the To folder to specify where you want the movies to go, check cleanup, and specify a From folder (this should be the same folder you assigned to the Movies tag in SABnzbd).

In the Automation section, you can install a GreaseMonkey script or bookmarklet that makes adding wanted movies to your CouchPotato installation from your browser easy peasy.

When you’re all done, review your settings and click the giant green button at the bottom. Although the startup wizard covers just about every relevant setting, there is one area you may want to take a peek at. The startup wizard doesn’t prompt you to set up notifications. To do so, click on the gear in the upper right hand corner and then click on Notifications in the navigation sidebar. There, just like in SickBeard, you’ll be able to turn on push notifications to a variety of systems including XBMC units, desktops with Growl notifications enabled, and even set up email notices.

Configuring CouchPotato to Start at Boot: At this point, we know you’re excited to get started plugging in your must-see movies to CouchPotato, but we have one little step left to complete before we move on. We need to set up the startup files to ensure CouchPotato launches at boot.

Open up the terminal and enter the following commands:

cd ~/
sudo cp CouchPotatoServer/init/ubuntu /etc/init.d/couchpotato
sudo chmod 755 /etc/init.d/couchpotato
sudo update-rc.d couchpotato defaults

At this point you’re all done with the configuration, and you can get down to business with your new CouchPotato installation.

Installing and Configuring Headphones on Raspbian

2013-04-07_201615

The final automation tool in our trifecta of automation goodness today is Headphones: as SickBeard is to TV and CouchPotato is to Movies, Headphones is to–you guessed it–music.

Installing Headphones: To get started, open up the terminal and enter the following command:

git clone https://github.com/rembo10/headphones.git

python headphones/Headphones.py

Configuring Headphones: Like SickBeard, there’s no installation wizard, but the settings menu is straight forward enough.  Click on the gear in the upper right hand corner of the Headphones interface to access the settings menu. We’ll go through each relevant sections one by one.

In the Web Interface section, you can add a login/password, change the port number, and turn on the Headphones API (necessary for some third party helper apps).

In the Download settings section, you need to point Headphones at your SABnzbd installation using the same information you used for SickBeard and CouchPotato (the host with port number, username and password if enabled, as well as the API key). Don’t forget to take advantage of the category function and then specify a sub-folder in your SABnzbd download folder for music. You can also, like the other automation apps, configure Headphones to use torrents if you wish.

In the Quality and Post Processing section, you can set the quality based on your preferred bit rate (or set it for lossless quality). You can also set the post processing features like automatic embedding of album art, sorting to folders, and automatic file renaming.

Finally, under Advanced Settings, there are a plethora of settings you can tinker with (although we would advise you to read carefully before wantonly toggling things on and off). You can change the renaming format, enable automatic re-encoding of audio formats, and enable notifications.

The most important setting under the Advanced Settings menu for a new Headphones user is the “Musicbrainz Mirror” option way down in the lower right corner. Leave it as it is, but if you find you’re consistently getting “fetch failed” errors when searching for artists and albums, you’ll need to come back to this section and select an alternate mirror.

When you’re all done tinkering, make sure to press Save Changes at the bottom and then Restart in the upper right hand corner for the changes to take effect.

The only other major configuration step you might consider is, if you already have a lot of music on the external drive you’re using with your Pi, setting Headphones to manage your collection. You can do so by clicking on Manage in the main navigation bar and pointing Headphones at the appropriate directory.

Configuring Headphones to Start at Boot: At this point, you’re ready to start searching and using Headphones, but like with our previous automation tools, we’re going to enable automatic startup on boot. To do so, enter the following commands at the terminal:

cd ~/headphones
sudo nano init.ubuntu

Inside the init.ubuntu files, we’re going to make two quick changes. Yes, at the top of the file it warns sternly against editing the file (but we live on the edge, and more importantly, we’re not using a dedicated user account just for headphones, so we have to make this change).

Scroll down line 29 and 30:

## HP_USER=         #$RUN_AS, [...]
## HP_HOME=         #$APP_PATH, [...]

Edit out the comment ## marks on those two lines and insert the following user name and home directory:

HP_USER=pi         #$RUN_AS, [...]
HP_HOME=/home/pi/headphones       #$APP_PATH, [...]

Press CTRL+X to exit, save your work, and then enter the following commands at the prompt:

sudo cp init.ubuntu /etc/init.d/headphones
sudo chmod 755 /etc/init.d/headphones
sudo update-rc.d headphones defaults

Headphones is now set to run on boot and the final piece of your download automation triple-attack has been put into play.


At this point, your Raspberry Pi box is a start-to-finish downloading beast that barely needs any care or feeding. We’ve walked you through installing a Usenet and BitTorrent client and with this final installment you now have three handy automation tools to make your Raspberry Pi download box has hands off as a tiny, low-power, headless micro server can be.

That said, there’s always more fun to be had with the tiny put powerful Pi–sound off with your Raspberry Pi build ideas and we’ll do what we can to bring them to life.

    Continue Reading »
  • Prev
  • 1
  • 2

Jason Fitzpatrick is warranty-voiding DIYer and all around geek. When he's not documenting mods and hacks he's doing his best to make sure a generation of college students graduate knowing they should put their pants on one leg at a time and go on to greatness, just like Bruce Dickinson. You can follow him on if you'd like.

  • Published 04/9/13

Get Free Articles in Your Inbox!

Join 134,000 newsletter readers

Email:

Go check your email!