Got a Question? Contact me at enquiries@virtualfrontiers.co.uk

Auto Downloading TV & Movies

First thing’s first. I do not condone piracy in any form. having said that, until the media bosses get their heads out of their rectums and provide proper streaming and downloading options the this is the best way to get our favourite stuff. I generally buy DVD’s and Blu Rays of my favourite films and rip them to my network store, but that is a very time consuming exercise so it’s easier for me to find a download of the media than spend several hours ripping DVD’s, stripping out menus and adverts and then re-encoding the file. Until streaming services like Netflix get better content and stop using DRM heavy transports that can’t be run on Linux, this is the best method. Special Thanks to user Zilexa on the Raspberry PI foums who wrote the original guide for Xbian. I adapted it for the dfiferent settings in RaspBMC so most of this is his work.  See the orignal thread here

What You Need

1. Raspberry Pi with RaspBMC installed 2. USB Hard Drive 3. A Powered USB hub which can supoprt the hard drive 4. A copy of Notepad++ for Windows for editing config files. 5. A terminal program such as PuTTy 6. An FTP client like FileZilla

Quick Summary Of How This Will Work

Have you ever heard of imdb.com? This is like the Wikipedia of movies and TV shows. There is a similar site called Trakt.tv. Biggest difference: you can create an account at Trakt.tv, install the addon in XBMC, and it will automatically keep track of what you watched in XBMC and, very important for this guide: what you would like to watch. Basically, you will not notice anything after adding a running TV Show to Trakt. Once an episode or movie becomes available in the quality you prefer --> it will appear in XBMC. On trakt.tv, you can simply add tv shows to a list. Special software (Flexget) on the RPi keeps an eye on this list of yours. Secondly, this software will use intelligent scripting (nothing you need to do, don’t worry) to get the latest episodes or movies from online newsfeeds (torrents) that are meant for this setup.

Preparations

(Optional but recommended) create an account at showrss.info and add the shows you like to your list. (Required) Create an account at Trakt.tv.  When done, move your mouse to your account name in the upper right corner and choose "Lists" in the context menu that appears. This is also called "Custom List" Create a list "TV Shows".  Add All tv shows you like watch in XBMC to this list by going to TV Shows and scroll through the shows or search the shows. You can do this by selecting "Add to Custom List" for every TV show. for Movies: simply select "add to Watchlist". A movie will automatically be removed from this Watchlist once you have watched it in XBMC. Download this sample config.yml script Open config.yml with Notepad (Windows) and modify the entries in CAPITALS to your personal accounts: o Your desired Transmission username/password o Your http://showrss.info USER ID. To get the the text of the full link, go to http://shows.info, login with your username and password, then click on the feeds link. On the Feeds page, click the Generate button next to "your feed address" and the URL you want to have in the config.yml file is the "full feed with magnets" link o  Your Trakt.tv account info and API key (you can find this in Trakt.tv > Settings > API) o  Change the names of the Trakt custom lists to the names of the list(s) you created on trakt.tv. This config supports 2 lists for tv shows, you can easily add more or remove one.

Install Required packages on your Pi

login to your Pi using PuTTy or similar terminal software and enter the following commands one by one: sudo apt-get install transmission sudo apt-get install transmission-daemon sudo apt-get install python-pip sudo pip install flexget sudo pip install transmissionrpc Then run this command: flexget -v it should return a version, if not, something went wrong and you will need to try installing again

Create The Folder Structure on USB Drive

You need to configure the file structure on your external USB drive. Your hard drive should be mounted under the /media folder. have a quick check that it is there (mine was called /media/External) Create the folders on the drive like this and also create static links to the usb drive folders (copy paste the commands one by one and hit enter): mkdir /media/External/Downloads mkdir /media/External/Downloads/incomplete mkdir /media/External/Downloads/torrents Create symbolic links to the folders on the external USB drive: ln -s /media/External/Downloads /home/pi/downloads ln -s /media/External/Downloads/incomplete /home/pi/incomplete ln -s /media/External/External/torrents /home/pi/torrents and finally create some more folders: mkdir /media/External/Downloads/flexget mkdir '/media/External/TV Shows' mkdir /media/External/Movies mkdir /media/External/Pictures mkdir /media/External/Music Make sure you and the downloadtool transmission have permission to use these folders: chmod -R 777 /media/External/Downloads chmod -R 777 '/media/External/TV Shows' chmod -R 777 /media/External/Movies chmod -R 777 /media/External/Music Note that if your hard drive is formatted as NTFS, the chmod commands will not do anything. See the last section of this guide to get round this issue.

Configure Transmission

1. Run this command sudo service transmission-daemon stop 2. Run this command sudo nano /etc/transmission-daemon/settings.json 3. Change the following lines as needed: "alt-speed-down": 400, "download-dir": "/home/pi/downloads", "download-queue-enabled": true, "download-queue-size": 2, "ratio-limit": 0.2, "ratio-limit-enabled": true, "rpc-whitelist-enabled": false, "seed-queue-enabled": false, "seed-queue-size": 2, "speed-limit-down": 2000, "speed-limit-down-enabled": true, "speed-limit-up": 90, "speed-limit-up-enabled": true, 4. Look for a linethat says “rpc-password”: and set it to the same password you put in the config.yml file.  e.g “rpc-password”: “mypassword” 5. press CTRL+O and then choose to save the file 6. Press CTRL+X to exit back to the command line 7. run the command sudo service transmission-daemon start

Create a Config file

Use FileZilla to Add Flexget Settings

Start FileZilla on your PC and login to your RPi by entering IP address, username (pi) and password(raspberry). Go to media/external. This is your USB hard drive. Here you'll see all important folders you created in the previous steps like Downloads, TV Shows, Movies. Episodes that are downloading will be in media/External/Downloads/incomplete. When done they should appear in the appropriate subfolder of TV Shows. Now perform these steps: 1. Open the folder /media/External/Downloads/flexget 2. Copy the config.yml file you locally saved during the PREPARATIONS (above) to this folder

Test Flexget and Schedule It To Run

Go to your PuTTY or other terminal window and runt he following command: flexget -c /media/External/Downloads/flexget/config.yml --test execute If your config.yml file is correct it will show you it’s progress and take a few minutes to finish. if your config.yml file contains errors you will get to see an explanation of what went wrong. Use --check instead of --test if you just want to test for formatting or typos. now we need to schedule flexget to run automatically. I chose to schedule it every 3 hours starting at 3am since I live in the UK and between 2-6AM most US TV shows from the previous evening become available. Run this command crontab -e Now scroll all the way down to the bottom and add the following line. 0 3,6,9,12,15 * * * /usr/local/bin/flexget -c /mnt/exthdd/Downloads/flexget/config.yml execute Press CTRL+O to save the file, then CTRL+X to exit Finally we need to enable cron jobs in RaspBMC as they are disabled by default. 1. Go to Settings 2. Go to Server Configuration 3. Enable Cronjob Scheduler you should now be good to go!

XBMC Essentials

Make sure you install the Trakt.tv addon for XBMC! This way, you keep a backup of what you already watched. If anything ever destroys your RPi, you still have the watched status backed up when you install XBMC again (on the RPi or different device). Also, after a movie has been downloaded and you have watched it in XBMC, it will be removed from the Trakt Watchlist. Sources Add your sources! Go to Videos and choose Add Source. Go to ROOT, then media>External>TV Shows and select this folder. Then select This folder contains TV Shows and save it. Do the same for Movies but select it contains Movies.

Common Problems

NTFS Drive permissions You may find when you check your Transmission web interface, that you are getting access denied errors on the torrents. This is because NTFS formatted drives don’t handle permissions the same way as EXT3 or 4 partitions do. On the NTFS partition you will find that only the Pi user has access to the drive. Since Transmission runs under the user 'debian-transmission' it won't be allowed to write to the drive. What we need to do is change the transmission script to run as user Pi instead. From the PuTTy or terminal console, type sudo nano /etc/init.d/transmission-daemon Look for the line that says 'USER=debian-transmission' and change it to 'USER=pi' Press CTRL+X  to save and exit. type the following comands:     sudo chown -R $USER /var/lib/transmission-daemon/info/     sudo chown -R $USER /etc/transmission-daemon/     sudo service transmission-daemon start Nothing is Downloading! The ISPs are currently playing whack-a-mole with the torrent sites and are continually trying to block known torrent sites. Most of the time, when they block a site, a new proxy appears so you will need to change your config.yml file to point to the new proxy.