Tv show downloader setup for a linux server or XBMC.... Part 3

I finally have a complete perfect working automatic and hands off TV show scraper from RSS feeds for my XBMC media center. Here is a quick list of what I am using....

Ubuntu Server 11.04
utorrent server version (latest)
utorrent server updated GUI (latest)
sorttv.pl (first version released on sourceforge, newest has problems)


I built a server that does more than just the above, In fact you can add ALL of the above to your XBMC Linux box if you want a self contained solution. I just want to be able to turn off the XBMC when not in use and the Server is also running other things so it's not wasting energy. The entire process above is NOT very intensive, even a old Pentium 4 can run this without putting more than a 5% load on the processor.

First you need to download and install utrorrent and update it's GUI from the links above. if you are running a 64bit server you need to install the 32 bit libs. in order for utserver to run.

sudo apt-get install ia32-libs

for more information take a look here

Once you get that guy running you can now add your RSS feeds and add filters to make it start downloading you TV shows to your hard drive. This will pile them all into one location for you. Not good for any organization...

sorttv.pl to the rescue!

SortTV, the version I use, is the first release. v0.2.. why? because it's small and fast and not bloated. It does do one thing I don't like, it will put files in "Showname/Season XX" and I dont care about seasons... You might, but I delete the TV shows after I watch them, I have no interest in storing episode 37 of Top Gear forever and watching it later.. That's what Netflix is for. IF you like saving the tv shows forever and want to keep them in season folders, This is all ready for you. Now I do not use the latest version of sorttv.pl because it has became huge and unruly. AND it uses libraries that Ubuntu cant install, nor do I want all the added features. IT tried to do things that honestly XBMC does for me. So I'm using the earliest smallest version. I will fork it and release it with my code changes to eliminate the season folders and add a few other features I am looking to add that are not in the newest version at all.

Sorttv.pl will need to be run with command line arguments in a crontab. I run mine every 15 minutes, but ever 30 to 60 minutes is more than enough. you don't want it to have to copy 30 shows at once, as that will take some time if you are moving from a recording drive to a storage drive. I DO recommend using the same drive if possible to save time and processor, but some of us cant afford 2TB drives. so I "record" to the 80gig scratch drive and then transfer to the 750gig storage drive that has the TV folder and the Movies folder.

if you fire up a couple of shells and launch the utserver in one you can start downloading files now. in the other shell you can launch the sorttv.pl to move the downloads to the folder of choice and it makes show folders for new shows! Nifty!

once you have everything working and tested perfectly in manual mode you can start automating everything.. WE need to make a crontab entry and a init.d entry to make all this start on boot and run automagically for us....

First let's tackle utorrent.... make a new file called utdaemon.... and put the following in it....

# chkconfig: 3 99 1
# description: my daemon

case "$1" in
'start')
/path/to/utserver -configsdirectory /path/to/utserver -daemon &
;;

'stop')
pkill utserver
;;

'restart')
pkill -HUP utserver
;;

esac

now copy that file to /etc/init.d and set it executable (chmod 777 /etc/init.d/utdaemon)

now you can issue the commands....

service utdaemon start|stop|restart

Cool, it's like a real Linux service! MAke sure this works manually!

now let's make it start automagically...

update-rc.d utdaemon defaults

Now it will run on it's own on boot!

Sortv.pl now needs to run every 15 minutes to 1/2 hour to move the finished tv shows to your share where your HTPC can find them. All automatic and stand alone.

Works great. I've been running this now for 2 months and it's reliable.

Comments

Popular Posts