Getting the latest with Flexget

Seeing as I’m slightly lazy, I wanted to find a way to automatically download all TV-Series and movies, without any human interaction.

After searching around a bit, I stumbled upon a python script called Flexget. The easy explanation for what kind of script this is the following:

You specify where to download from, what to download, and where to download it to.

The long explanation all tough, is so much more interesting!

Here is a config file I have compiled together:

global:
  statistics:
   file: /path/to/your/wwwroot

  email:
    from: flexget@myserver.com
    to: your@mailaddress.com
    smtp_host: mail.mailaddress.com
    smtp_port: 25
    smtp_login: true
    smtp_username: your@mailaddress.com
    smtp_password: yourpassword123

feeds:
  tv-shows:
    rss: http://www.website.com/rssfeed.php
    series:
      - True Blood:
          timeframe:
            hours: 6
            enough: 720p
      - Eureka:
          timeframe:
            hours: 12
            enough: 720p
      - Family Guy
      - Dirty Jobs

    download: /path/to/torrent/watchdir

  movies:
    rss: http://www.website.com/rssfeed.php
    limit_new: 3
    imdb:
      min_score: 6.2
      min_votes: 6000
      min_year: 1997
    download: /path/to/torrent/watchdir

  flexget:
    interval: 3 days
    html: http://download.flexget.com/0.9/
    regexp:
      accept:
        - flexget.*zip
    download: /root/fgreleases

  diggnation:
    interval: 3 days
    rss: http://revision3.com/diggnation/feed/MP4-hd30
    limit_new: 1
    regexp:
      accept:
        - diggnation*.mp4
    exec: wget -b -P /path/to/podcast/directory %(url)s

And here is an explanation on what each part does:

First part:

global:
  statistics:
   file: /path/to/your/wwwroot

Basically, this part sets all the global settings of the entire config file. in this section I’ve only set up that statistics for all downloads should be parsed to an index file on my box. Here you will see what kind of sites that generate the most results.

Second part:

  email:
    from: flexget@myserver.com
    to: your@mailaddress.com
    smtp_host: mail.mailaddress.com
    smtp_port: 25
    smtp_login: true
    smtp_username: your@mailaddress.com
    smtp_password: yourpassword123

This part is very cool. It’s for setting up so you get a mail as soon as a new show/movie/whatever is downloaded. Combine this with an iPhone and a push mail service, and you got yourself an instant notification as soon as your favorite show has started downloading. Also, If you combine this with the Deluge plugin in Flexget, you can set up Deluge to mail you as soon as the download has finished!

Third part:

feeds:
  tv-shows:
    rss: http://www.website.com/rssfeed.php
    series:
      - True Blood:
          timeframe:
            hours: 6
            enough: 720p
      - Eureka:
          timeframe:
            hours: 12
            enough: 720p
      - Family Guy
      - Dirty Jobs
    download: /path/to/torrent/watchdir

Now for the things that really matter. The downloads. Here I have specified the following values:

  • feeds: – This indicates that the following list will consist of rss feeds
  • tv-shows: – This just tells flexget that the feed we are about to parse will consist of tv-shows. It will then make it easier for flexget to understand how to parse the names, focus on season and episode numbers and so on.
  • rss: – Here we just specify the rss feed for a place to get the latest tv-shows.
  • series: – This part is the fun part. Here you just write the name of the show you want to get. There are no real rules needed to specify, no regexp to focus on, just write the name, that’s it. Just remember to write it as it’s shown in the feed, otherwise flexget will get confused.
  • timeframe: – Here we want to specifiy some extra settings. The timeframe value can make use of the settings “hours” and “enough”. This makes it so that IF the 720p version of a release has not been displayed within 6 hours, the SD (Standard definition) version should be downloaded.
  • download: Here is where the .torrent file will get downloaded. After this, the torrent client (in my case transmission) will take over and start downloading.

Fourth part:

  movies:
    rss: http://www.website.com/rssfeed.php
    limit_new: 3
    imdb:
      min_score: 6.2
      min_votes: 6000
      min_year: 1997
    download: /path/to/torrent/watchdir

This second part is for downloading the latest HD movie releases, which in turn gets checked through IMDB to check the rating (I’ll explain this later).

  • movies: – This just tells flexget that we are now dealing with movies, not tv-shows.
  • rss: – Same as above, the rss feed for a site where you are to download from.
  • limit_new: 1 – I had to add this in order to not kill of my box completely. Basically it only checks one link each time the cron job is run (which is once every hour).
  • imdb: – Here we tell flexget that the following will be values used to check towards imdb.
  • min_score: 6.2 – We don’t want crap movies in our archives, so here we tell flexget to only download movies with a rating ABOVE 6.2 on IMDB.
  • min_votes: 6000 – We also don’t want the script to download movies where there are only 100 votes (which is mostly the actors and cast of the movie) and have received a high initial rating.
  • download: – Same as above, download path is to the watch-dir for your torrent client.

The third part:

  flexget:
    interval: 3 days
    html: http://download.flexget.com/0.9/
    regexp:
      accept:
        - flexget.*zip
    download: /root/fgreleases

We of course want to keep up with the latest updates of the script. There might be changes to IMDB that require the script to be updated, or new features which we can take use of. That’s where this part comes in.

  • flexget: – Loads the flexget module, which is made specifically for downloading latest updates of flexget.
  • interval: 3 days – Check every 3 days for new updates.
  • html: – Seeing as there is no rss feed for releases, we have to rely on html parsing. That’s where this module comes in.
  • patterns: – Here we have to use regexp in order to dive through the html code, and finding the file we need.
  • download: – Aaand where to download the release. Here we just dump it in a folder on our home path.

The last part:

  diggnation:
    interval: 3 days
    rss: http://revision3.com/diggnation/feed/MP4-hd30
    limit_new: 1
    regexp:
      accept:
        - diggnation*.mp4
    exec: wget -b -P /path/to/podcast/directory %(url)s

I watch a lot of Diggnation, so naturally it would be cool to have the latest episodes waiting for me on my box when they are available. This part simply uses more or less the same functions as the flexget section, except it also specifies that it should only download the newest link found. I have also set it to use wget to download it, and not flexgets own get function, as 1. It takes up a lot of load, and 2. The download can last for quite some time, which in turn can make the script start running in several instances.

So that’s it! I really love this script and how versatile it is. If you wish to read more about using flexget and how to modify it to your needs:

Configuration samples: http://flexget.com/wiki/CookBook

Usage for various plugins: http://flexget.com/wiki/Modules

Last edited: 10/11/2009 at 14:15


Share with others:
  • Facebook
  • Twitter
  • Add to favorites
  • StumbleUpon
  • Google Bookmarks
  • LinkedIn

One Comment

  1. Posted 11/09/2009 at 21:33 | Permalink

    Awesome article, however I had some small problems with the config, here’s one that worked for me.

    global:
      statistics:
        file: /srv/http/flexget/index.html
    
    email:
      from: xxx@xxx.com
      to: jokr.nilsen@xxx.com
      smtp_host: mail.xxx.com
      smtp_port: 25
      smtp_login: true
      smtp_username: xxx@xxx.com
      smtp_password: xxx
    
    feeds:
      tv-shows:
        rss: http://pipes.yahoo.com/pipes/pipe.run?_id=7aa6281616ea0a8cb27aaa0914f09a76&_render=rss
        series:
          - True Blood
          - Eureka
        download: ~/downloads/torrents/watch
    
    movies:
      rss: http://rss.thepiratebay.org/207
      limit_new: 1
      seen_movies: loose
    imdb:
      min_score: 6.2
      min_votes: 6000
      download: ~/downloads/torrents/watch
    
    flexget:
      interval: 3 days
      html: http://download.flexget.com/0.9/
      patterns:
        - flexget.*zip
      download: ~/fgreleases
    

    Also worth to note that it’s possible to send an e-mail upon completion from transmission aswell.

    Here are my pkgbuild’s for Arch Linux:
    FlexGet: http://aur.archlinux.org/packages.php?ID=30041
    Python Googlechart: http://aur.archlinux.org/packages.php?ID=30035

    Last one if you want statistics :)

One Trackback

  1. By Instant entertainment | Jumpingmushroom on 22/03/2010 at 17:12

    [...] sorting and management of my shows, and I think I have found a setup that works [...] Related posts:Getting the latest with Flexget '; digg_skin = [...]

Post a Comment

Your email is never shared.