[-]
Shout: -
Options
Loading...
Smilies
Popup Shoutbox

  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5


Plex, Deluge, and FileBot on Ubuntu
#1
I had a server computer for the last year that has just been sitting around. Last use was when I hosted the Sithous website off it about 10 months ago. I decided to finally make a use of it as a media server for my home and also for streaming from while out and about.

About the various software used in this setup

I run Plex which is based of XBMC. Plex will take all your Movies, TV Shows, Music, and Pictures and organize them for you for easy navigation and viewing. It's basically you hosting your own Netflix service. If you put the Plex server live on the Internet you can login to http://www.plex.tv and stream your library from anywhere in the world. If you plan to stream over the internet it is recommended you have at minimum a dual core processor because the server does trans coding before sending it over to you. This means if you chose to stream a lower quality version of the media the server will do all the heavy lifting. In my experience you will want 2 cores per simultaneous stream.

I do a lot of torrenting for the fact that paying for Cable or Satellite television is not worth $40 or more a month to get spammed with ads. Until television fixes this System I will not ever pay for a television subscription. This is just me though, you can do whatever you want.

I use Deluge on Ubuntu paired with Plex to handle all my Movies and Television downloads. Deluge is a very nice torrent application and has a Web Interface that does everything the GUI can. I use Web Interfaces because lets face it, running a GUI in an Operating System takes a lot of resources that could be better used elsewhere. Deluge is great because it has a plugin system that uses Python. If you aren't familiar with Python it is basically a really simplified programming language that tries to be more readable then others.

And last but not least I use FileBot which executes when the torrent finished downloading. The things I have FileBot do are:
  • Re-Name torrented files to be more readable and thus have better chance of plex understanding it (since torrent creators like to really mess those names up)
  • Extract the torrent files if they are compressed
  • Download any subtitles, images, and other content for the media
  • Moving the torrent to be organized by placing it in either Movies or TV Shows folder under the Media directory you define.
  • Telling Plex to update the library once completed

Setting it all up

  1. You will need to install FileBot in Ubuntu. There are various ways of doing this. I recommend following a tutorial like this one:
    http://linuxg.net/how-to-install-filebot-4-0-on-ubuntu-linux-mint-debian-elementary-os-kwheezy-and-their-derivative-systems/
  2. Install Deluge (may already be installed). You can have this be a headless server (no gui, just web interface), both, or just the web interface. I chose to use just the web interface which followed this Headless install tutorial: http://www.havetheknowhow.com/Install-the-software/Install-Deluge-Headless.html
  3. Install Plex Media Server. You can use the .deb off their website or use their repo (I recommend the repo so you can update using apt-get). I recommend this tutorial: https://forums.plex.tv/index.php/topic/26727-how-to-plex-media-server-on-ubuntu/
  4. Login to the plex server, configure your media directories for your content and etc. You will need a base media folder that will have the sub-folders Movies and TV Shows. Make sure you do this exact with uppercase and everything so there are no issues with filebot finding the folders. Then add a library for Movies and TV Shows and point each to their right folder. Any media added to these folders should be added to Plex.
  5. Create a directory somewhere for storing the Python scripts that will be executed by Deluge. You will want to make sure that Deluge has access to execute the Python scripts. I added the python scripts to the Deluge client's home folder under ~/python/filebot.
  6. cd into this created folder (ex: cd ~/python/filebot) and run the following commands:
    Code:
    wget https://gist.githubusercontent.com/skylord123/c3d5bacdd088561e6ec0/raw/190bcc7239d660259787ac6578e5956d05bd826f/completed.py
    Code:
    chmod +x completed.py
  7. Modify the script. This can be done with the following command
    Code:
    nano ./completed.py
    Make sure you put the login creds for the Deluge client. If you never created any then look it up in google on how to add some. It's fairly simple. Also pay attention to the commented code (prefixed with #) for details on what the options do. I tried to make it simple as possible.
  8. While still modifying the file look for the line that says
    Code:
    errorCode = subprocess.call("filebot -script /root/python/filebot/filebot_scripts/amc.groovy -non-strict --def ut_kind=multi --def 'ut_dir=%s/%s' " % (sys.argv[3], sys.argv[2]) + ' '.join(filebotOptions), shell=True)
    You will need to edit the "/root/python/filebot/filebot_scripts/amc.groovy" path. You can use fn:fma instead to have it auto download the script. I went and downloaded amc.groovy and all the library files so that in-case internet connection failed or the library file gets removed I still have it. Completely up to you though. I can upload the files needed if you guys need it.
  9. Active the Deluge Execute plugin as well as the Labels plugin under prefences -> plugins (can be done on web interface or the GUI).
  10. Click the Execute tab in the left of the preferences that has now been added. Click the Add button and add the completed.py command to execute when a torrent finished.
  11. Close prefernces and go to the left menu in deluge. There should be a Labels tab. Right clicking this will allow you to create a label. Create the labels Movies and TVShows (no spaces). If deluge puts it in all lowercase I would edit the labels config under ~/.config/deluge/labels.conf and make them uppercase. That or change my script to allow lowercase.
  12. Now everything should be up and running. When you add a torrent right click it and apply the label Movies or TV Shows. Only torrents with these labels will have the script execute.

Some more information:

The script that runs when the torrent is completed is my modified version of http://forum.deluge-torrent.org/viewtopic.php?f=9&p=172841
I made it so that torrents can be deleted from Deluge when they complete if you specify so. I also made a fix for deluge authentication not working and added the ability to have filebot log to a file for debugging purposes. You can view my modified version on gist and even offer changes to it if you have a github account:
http://forum.deluge-torrent.org/viewtopic.php?f=9&p=172841

To get things to work on windows you will probably have to do heavy modifications. But it should in theory work because it uses python scripts.

This was a very quickly written up process. I use deluge and plex to download and stream from anywhere in the world. I mainly download torrents from home server while at work so I can stream and work at the same time. I hope this is helpful for you guys. I want to come back and do a far better job on this post but for now this should get you guys started.[/code]


Another note:
I have a raspberrypi that I bought for $35. You can download and flash rasplex and connect the raspberrypi to your tv to have a super low power streaming machine. I have tested this and it works great. If you go this route use Plex Remote app on android for a nice full feature remote for your rasplex. Works great Smile
[Image: lane_change.gif]
Reply

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  




Users browsing this thread:
1 Guest(s)

ABOUT US
Sithous is a community of several computer enthusiasts. We mainly focus on gaming but relate with people that just want to talk about technology. We plan big things in the future.