Guide: Headless Bittorrent-client with RSS support and webinterface

August 30th, 2007

Bittorrent is one of many ways to download (and share) various stuff in. If you for some reason are lucky enough to have your own little server running, it’s not a bad idea to make the server do the job - and have your workstation use its resources on other tasks. When I wanted to put this on my server, I also wanted to make it have RSS support and to be controlled through a webinterface. At first, I made a poor solution which made bittornado monitor the torrents I put in a specified directory - and downloaded the torrents. It was running in a screen, and I dumped the output to a textfile which was available on my webserver.

I said poor solution, and I’m gonna stand by the fact that it was poor. It was easy though, and it worked. But because of a recent servercrash, I need to set things up again. This make me want more. I want … RSS… and I want it to be CONTROLLED through the webinterface. This can be done with Azureus! Here’s a quick how-to:

What you need: A server running Linux - my howto covers Debian, but it will probably work in Ubuntu as well - and probably other distros using apt-get.

Install the package “azureus” and “screen” (you need to be root):

# apt-get install azureus screen

Now, if the package installation went well - you want to download the rssfeed, and the azhtmlwebui plugins.

  1. rssfeed
  2. azhtmlwebui

These plugins are fairly simple to install. Start azureus once (as the user you intend to run azureus as - YOU DON’T WANT TO RUN AZUREUS AS ROOT!) by running

# azureus --ui=console

Type “quit” shortly after it starts, just to let it build up the files it needs in your homedirectory. It’s a simple structure, and you want to put the plugins there. Unpack the zip files with the plugins you downloaded, and put them in /home/youruser/.azureus/plugins/rssfeed/ and /home/youruser/.azureus/plugins/azhtmlwebui.

Now we’re ready to start azureus for the first time with the plugins. Again, run the following as the user - again: don’t be root. I can’t stress this enough.

# azureus --ui=console

Note, at this point you already have a working webinterface. You can access it on its default port 6886. Just use http://ipaddress:6886 in your browser, and you’re in. But you would probably want to add a couple of security features, such as authentication and change the default port. This can be done with the following commands (in the console interface):

set Plugin.azhtmlwebui.User username
set "Plugin.azhtmlwebui.Password Enable" 1
set Plugin.azhtmlwebui.Password yourpassword password
set Plugin.azhtmlwebui.Port 13001

These four commands turned on the authentication mechanism, with the user “username”, and the password “yourpassword”. It also changed the port to 13001. This means that http://serverip:13001 would ask you for a username and password before the interface opens. So now, the service is secured with basic authentication. If you want to be able to upload something through the webinterface, you would also have to run the following:

set General_sDefaultSave_Directory /save/directory
set "Use default data dir" 1

This enabled uploading through the webinterface, and added /save/directory as the default location of new downloads. Now we should have a completely working webinterface. The next thing we need to do is to set up the rssfeed plugin. If you don’t want this, you should just quit azureus (type quit), and do:

# screen -d -m azureus --ui=console

Azureus is now up and running in a screen - if you want to “attach” to the application, you should run

# screen -x

You can detach by typing CTRL+a followed by a press of ‘d’. This is very neat for other purposes too, for example running an IRC-client in a screen - you can just ssh to the box from anywhere and have access to the same IRC-session :)

Now, back to setting up rssfeed. There’s a catch. This plugin requires to be configured with a GUI. Yes. I’m not kidding. This means that you need to install the client on a workstation with a GUI - I must confess I haven’t tested this on a Windows workstation, but I’ll guess it works just as well. Install the plugin with the internal plugin installer in the application, or use the same procedure as mentioned earlier in this guide. At this point I’m gonna presume that you have the GUI up, with the plugin installed. Let’s continue:

In the Plugins-menu, click “RSSFeed Scanner”. Click the “Options”-tab. Here you can add the various RSS Feed URLs. This should be torrent download URLs. This means that the <guid>-tag should contain the .torrent-file to download. Most torrent sites provide these rss-feeds. Add a RSS-feed by pressing the green + next to the box containing the RSS Feed URLs. Give it a name, type in an URL, a directory is optional. Check for “Enabled”, and click “Save”. At this point, the RSS Feed is added. Now you want to add some filters - “What do I want to get from this feed?”.

Now, click the green + next to the “Filters”-box. Give it a name - a directory is optional here as well. In the filter-field, you can type the name of what you want to download, but instead of spaces I would recommend you to use dots (.). Check “Filter is a Regular Expression”. This means that the dots counts as wildcards - which would mean that the filter “pure.pwnage” would validate both “Pure Pwnage 1×11.torrent” and “pure.pwnage.1×10.lol.torrent”. This is useful if you want to make sure that you get what you’re looking for. I want to set “Set State to” to “Queued”, but that’s your decision. Tell it which feeds it’s gonna use, and change the Type to the appropriate one. RSSFeed has a neat function when it comes to TV Shows. You can tell it to start from season X, and end in season Y. It will make sure that it does not download any duplicates. It’s pretty neat! Check for Enabled, and click “Save”. At this point you should give the filter a test - type in a text in the “Test match” and click “Test” to see if it’s a valid title of something you want to match. If it’s green, and it’s in the feed - it’s going to be downloaded the next time the feed is checked.

OK! If you’ve done everything correct so far, you have a file in your home directory under .azureus/plugins/rssfeed/ named rssfeed.options. Copy this file over to the same directory on the server. Start azureus the way previously mentioned in this guide and everything should work. You now have RSS-support in your headless bittorrent client :) The catch is the configuration of the RSSFeed plugin - I hope this will improve in later versions of rssfeed or Azureus.


Leave a Reply

You must be logged in to post a comment.