Program to automatically download new TV show episodes and update XBMC library

  Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
mrkipling Offline
Senior Member
Posts: 214
Joined: Apr 2011
Reputation: 3
Post: #1
Hey everyone,

I've created a small open-source tool to automatically download new episodes of TV programs and update my XBMC library - so what this basically means is that new episodes of shows that I'm watching automatically appear in my XBMC library (plus I get an email notification). I created it for my own personal use and it's still in very early stages of development, but it actually works so I thought that it might be of use to others.

You can find it on GitHub (at the moment I'm pushing changes quite frequently, so it could well be a lot better in a week's time!): https://github.com/mrkipling/Auto-NZB-downloader

...and here's a screenshot of the web interface: http://i.imgur.com/QMuqm.png

It's a bit clunky, but like I said, it's something that started life as a personal project for my own use. It's a Django/Python web app and you deploy it on your download server or HTPC using nginx or whichever web server you prefer. This then exposes a few URLs - one is the web-based interface, another ("/check") checks for new episodes and download NZBs as appropriate, and another ("/organise") scans the extracted folder, moves files into your library, and remotely triggers XBMC to update your library. You set up a cron job to query /check and /organise however frequently you want (perhaps check every hour, then next hour organise, and so on).

It works as follows:

* It takes an RSS feed from MyEpisodes.com, which contains information for upcoming shows that you watch. MyEpisodes provides a web interface to keep track of air dates for upcoming shows, and the ability to mark shows as acquired or watched.

* It picks up new shows and episodes and stores them in a local database. You can choose for each episode whether you want to download in HD or standard def.

* When you check for new episodes via the /check URL, it performs a search on NZBMatrix.com (this requires an API key, which requires becoming a premium member for a one-time payment of £7). If it finds the episode in English and HD/non-HD as appropriate, then downloads the NZB file and places it in you're newsreader's "watched" folder.

* I use SABNZBD+, so at this point it picks up the NZB, downloads, repairs and extracts it.

* When the /organise URL is queried it scans the newsreader's extracted folder for files that Auto NZB Downloader added. If it finds any then it parses the directory name to get show and season info. It finds the episode (the biggest file in the directory), moves it into the correct subfolder in your media library (Show Name/Season N/filename.whatever), and deletes the leftover crap that was also extracted.

* It then send a query to XBMC over the network which prompts it to update the library. The new episode is added and should appear in your library.

* It also sends you an email upon acquiring an episode, should you enable this setting. There is a log file so that you can keep an eye on things. There is also a web interface which shows upcoming shows, acquired shows, shows which it is having problems searching for, and more features as I (or others, since it is open source) add them.

I'm planning on adding some new features... priorities are a snappier name, friendlier configuration and the ability to use different services (so that you're not tied to MyEpisodes or NZBMatrix.com, for example - the £7 premium membership thing is slightly annoying but I wanted to create something quickly that worked, and access to an API was too tempting).

It's provided "as is" but I'm happy to help if you decide to play around with it yourself and need assistance. As I keep saying, it's open source, so feel free to commit some changes and improve on the admittedly rather basic start that I've made!
(This post was last modified: 2011-04-07 19:53 by mrkipling.)
find quote
rtwight Offline
Member
Posts: 64
Joined: Sep 2007
Reputation: 0
Post: #2
You may want to read the Sickbeard thread as that does pretty much what you are trying to do.

Not trying to stop you from working on this, but might save you the time to do something else Wink

I know i couldn't program anything to save my life so I applaud your work.....

[Image: widget]
[Image: widget]
find quote
gugahoi Offline
Fan
Posts: 724
Joined: Aug 2009
Reputation: 5
Post: #3
Yeh, sickbeard is the one. Even tho your work looks fantastic, there's been a lot of man hours put into sickbeard. And it works very well.

http://sickbeard.com/

Maybe you should help improve it? Since you can program fairly well I'm assuming?
find quote
mrkipling Offline
Senior Member
Posts: 214
Joined: Apr 2011
Reputation: 3
Post: #4
gugahoi Wrote:Yeh, sickbeard is the one. Even tho your work looks fantastic, there's been a lot of man hours put into sickbeard. And it works very well.

http://sickbeard.com/

Maybe you should help improve it? Since you can program fairly well I'm assuming?

That's incredible. Can't believe that I didn't stumble across that when I was looking into whether this kind of thing existed. Looks like I'll be using Sickbeard from now on!
find quote
mediumdry Offline
Senior Member
Posts: 149
Joined: Jan 2010
Reputation: 0
Post: #5
maybe I'm barking up the wrong tree now.. but I'm very interested in part of sickbeard/auto-nzb-downloader.

I've got the nzb getting/downloading part automated in a lightweight manner on my server, now all I want is a script that I can run through cron that will take the files from where the downloader leaves them, puts them in the correct folders in my media structure and then kicks XMBC to check the updates.

So it seems that a subset of what this program does (and a very small subset of what sickbeard does) is all I want. However, I need to have it remote, so programs that launch a local webbrowser are simply a no-go for me.

How hard is it to take just what I want and start it in a easy to run command line?
find quote
bauer5152 Offline
Junior Member
Posts: 1
Joined: May 2011
Reputation: 0
Post: #6
gugahoi Wrote:Yeh, sickbeard is the one. Even tho your work looks fantastic, there's been a lot of man hours put into sickbeard. And it works very well.

http://sickbeard.com/

Maybe you should help improve it? Since you can program fairly well I'm assuming?


Such a very amazing link!
__________________
Watch Something Borrowed Movie Online Free
find quote