Python + Transmission daemon = Download easily your favorite TV Show

This post is about my last project : my TV Show Manager.

I decided to start it because I wanted something really simple to download my favorite TV Shows. In this post, I’ll explain step by step how to reproduce it at home.

Basically, with this tutorial you’ll set up your Raspberry box by :

Well.. let’s start ?

I’m a Raspberry Pi enthusiast, so this project runs at home on a basic installation of Raspbmc.

First, you need to install transmission-remote :

sudo apt-get install transmission-daemon

The basic installation will launch a basic HTTP server. Let’s imagine the IP of your Raspberry server is : 192.168.0.12.

The HTTP Server is accessible on the port 9091, like : http://192.168.0.12:9091/transmission/web/

To access this URL, there will be a .htaccess asking some credentials to access the page.

To display/update them, just access the settings.json configuration file :

sudo vim /etc/transmission-daemon/settings.json

And check for the variables rpc-username and rpc-password. Moreover, if you want to send commands over the network, check the rpc-whitelist variable and add your private network range if you want to access it over the LAN, like:

"rpc-whitelist": "127.0.0.1, 192.168.1.*"

Then, restart your transmission-daemon:

killall -HUP transmission-da

After setting up Transmission-remote, what do we have to do ?

Well, you need to get TVShowManager, one of my project : TVShowManager.

Start by cloning the projet by using git :

git clone git@github.com:PaulSec/TVShowsManager.git

Then, just go in the folder and see the files which are present :

cd TVShowsManager && ls
  • eztv_api : (Unofficial) Python API for the website EZTV.it.
  • TVShowsManager.py : the launcher for this project
  • config.ini : the most important because it contains all the configuration !

Setting up TVShowsManager

To use it, you have to create a configuration file called config.ini, let’s take an example :

[config]
username = myUsernameTr
password = myPassword!!!
ip = 192.168.0.12
timer = 5

[Vikings]
season = 1
episode = 7

The first section is the config one. You define different fields such as :

  • Username: Credentials to connect to your transmission.
  • Password: Bis.
  • IP: IP where your Transmission-remote is running
  • timer: How many minutes you want to wait between 2 re-try.

Then, the other sections are for your different tv show. Based on this example, you’re watching Vikings and stopped at the episode 7, season 1.

You can get those files on your Raspberry and the ip address will then be : 127.0.0.1 if transmission-daemon is running on it as well.

Launch the app !

To launch the app, after creating your own config.ini file, just type this command :

python TVShowsManager.py

And that’s it ! If you want more details, I redacted a nice README for the project just here