Here’s the list of instructions I used to setup flexget on my Raspberry Pi. One day I believe i will automate this.

0. Setup Raspbmc
Download the appropriate install.py  for your system and execute it. Remember system here is the computer     you’re using to prepare the sd card, not the Pi itself.

1. Change password for SSH
2. Login to ssh
3. To make sure everything is up to date
sudo apt-get update

4. Create home directories
mkdir /home/pi/flexget
mkdir /home/pi/incomplete
mkdir /home/pi/torrent
mkdir /home/pi/TVShows
mkdir /home/pi/Movies
mkdir /home/pi/Music

5. Install transmission daemon –
sudo apt-get install transmission-daemon
after install, the daemon is started automagically. We don’t want that, because we want to tweak the config.
Stop the daemon:
sudo /etc/init.d/transmission-daemon stop
Now we want to change the config of the daemon:
sudo nano /etc/transmission-daemon/settings.json

6. copy/paste and run this command: sudo nano /etc/transmission-daemon/settings.json

7. Change
“alt-speed-down”: 400,
“download-dir”: “/home/pi/TVShows”,
“download-queue-size”: 2,
“incomplete-dir”: “/home/pi/incomplete”,
“incomplete-dir-enabled”: true,
“ratio-limit”: 0.2,
“ratio-limit-enabled”: true,
“rpc-password”: “YOURDESIREDPW”,
“rpc-username”: “YOURDESIREDUSERNAME”,
“rpc-whitelist”: “127.0.0.1,192.168.*.*”,
“script-torrent-done-filename”: “/etc/transmission-daemon/xbmc-upd.sh”,
“seed-queue-enabled”: false,
“seed-queue-size”: 1,
“speed-limit-down”: 2000,
“speed-limit-down-enabled”: true,
“speed-limit-up”: 90,
“speed-limit-up-enabled”: true,
“watch-dir”: “/home/pi/torrent”

press CTRL+X to exit the settings file, then Y to save.

8. You can change the daemon to run as pi,
sudo nano /etc/init.d/transmission-daemon
change “USER=debian-transmission” to “USER=pi”
Now, because we changed the user, we also have to change ownership of the folders used by Transmission
sudo chown pi:pi /etc/transmission-daemon/settings.json
sudo chown pi:pi /etc/init.d/transmission-daemon
sudo chown -R pi:pi /var/lib/transmission-daemon/info

9. sudo /etc/init.d/transmission-daemon start

10. Install flexget
sudo apt-get -y install python-pip
sudo pip install flexget
sudo pip install transmissionrpc
sudo easy_install subliminal

11. Create an account: Trakt.tv.
Create a list “Following”. If you are like me and you follow most tv shows in normal quality and some in high 720p quality, create two lists (“Following” and “Following in HD”). I consider normal quality to be hdtv but not 720p rips.
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.

12. copy the text of this file and save as config.yml (you will need it later) – http://pastebin.com/V3f5XvPJ
Open in text editor and modify the things in CAPITALS to your personal accounts

13. Change to /home/pi/flexget
cd /home/pi/flexget/
nano config.yml
Paste contents of config.yml from above into this file

14. Trigger XBMC to update library on finished downloads
sudo nano /etc/transmission-daemon/xbmc-upd.sh
Now copy this and save it with CTRL+X Y:
/usr/bin/wget –header=’Content-Type:application/json’ –post-data='{“jsonrpc”: “2.0”, “method”: “VideoLibrary.Scan”, “id”: “pi”, “params”: {“directory”:”‘”$TR_TORRENT_DIR”‘/”}}’ “http://localhost:80/jsonrpc”

give the file execution permission: sudo chmod +x /etc/transmission-daemon/xbmc-upd.sh

15. Make sure flex get and it’s configuration is working fine
flexget -c /home/pi/flexget/config.yml check

16. Schedule flexget in crontab
crontab -e
0 3,6,9,12,15,17 * * * nice -n 4 /usr/local/bin/flexget -c /home/pi/flexget/config.yml execute

17. Add user pi to samba
sudo smbpasswd -a pi

18. Add your sources! Go to Videos and choose Add Source. Go to ROOT, then media>usb>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.

 

kimanii XBMC

2 Replies

  1. Hi Daniel,

    thanks for posting the instructions for xbmc and flexget. I’m trying to get them to work on XBIAN and get the message below. Did you come across the same? Maybe you have an idea how to solve this.
    In your config file I only changed the logins and ‘TV Shows’ to ‘Series’ in one path. As instructed on trakt, I used the user name as API.

    xbian@xbian ~/.flexget $ flexget check
    2015-03-09 11:17 VERBOSE check Pre-checked 118 configuration lines
    2015-03-09 11:17 CRITICAL manager [/tasks/get_movies/movie_queue] Got `True`, expected: dict or string
    2015-03-09 11:17 CRITICAL manager [/tasks/fill_movie_queue] The key `queue_movies` is not valid here. Only known plugin names are valid keys.
    2015-03-09 11:17 CRITICAL manager [/tasks/fill_movie_queue/trakt_list] `type` is a required property
    2015-03-09 11:17 CRITICAL manager [/tasks/fill_movie_queue/trakt_list] `list` is a required property
    2015-03-09 11:17 CRITICAL manager [/tasks/fill_movie_queue/trakt_list] `collection` and `watched` lists do not support `episodes` type
    2015-03-09 11:17 CRITICAL manager [/tasks/fill_movie_queue/trakt_list] The keys `movies`, `api_key` are not valid here.
    2015-03-09 11:17 CRITICAL manager [/tasks/get_tvshows/configure_series/from/trakt_list] `type` is a required property
    2015-03-09 11:17 CRITICAL manager [/tasks/get_tvshows/configure_series/from/trakt_list] `list` is a required property
    2015-03-09 11:17 CRITICAL manager [/tasks/get_tvshows/configure_series/from/trakt_list] `collection` and `watched` lists do not support `episodes` type
    2015-03-09 11:17 CRITICAL manager [/tasks/get_tvshows/configure_series/from/trakt_list] The keys `api_key`, `custom` are not valid here.
    2015-03-09 11:17 CRITICAL manager [/tasks/get_tvshowshd/configure_series/from/trakt_list] `type` is a required property
    2015-03-09 11:17 CRITICAL manager [/tasks/get_tvshowshd/configure_series/from/trakt_list] `list` is a required property
    2015-03-09 11:17 CRITICAL manager [/tasks/get_tvshowshd/configure_series/from/trakt_list] `collection` and `watched` lists do not support `episodes` type
    2015-03-09 11:17 CRITICAL manager [/tasks/get_tvshowshd/configure_series/from/trakt_list] The keys `api_key`, `custom` are not valid here.
    2015-03-09 11:17 CRITICAL manager Failed to load config file: Did not pass schema validation.
    Could not start manager: Did not pass schema validation.

    Thanks for your help!

    /Tobi

    1. Hey Tobi,

      Sorry for my tardy response, I just realize I didn’t setup email notification of comments on my blog (just rectified that). I had a similar issue when I upgraded flexget. Flexget changed the format of the config file over versions so it’s hard for me to really identify your exact issue but if you look on this site it will give you a synopsis of the upgrade actions by version. Later this week I will upload a new version of the config file for flexget 1.2.247

Leave a Reply

Your email address will not be published. Required fields are marked *