AzStatusCLI - Azureus Status Command Line Invoker

You are visitor number since Sep. 2007

General

      This plugin can be used to invoke an arbitrary command line whenever a torrent starts or finishes downloading. I created this plugin since I wanted to do "post-processing" on video files I downloaded using Azureus. The post-processing I do is converting AVI to non-packed bitstream if they use packed bitstream.

Downloading

Installing and Setting Up

      You'll have to manually "install" the plugin. This is quite simple:

      • Create a folder with your chosen name under AZUREUS_HOME/plugins. Any name will do, but I recommend you use azstatuscli (to keep things in order).
      • Copy azstatuscli.jar (the plugin JAR file) into the newly created folder.
      • Restart Azureus.

Configuration

      You can configure the command that will be invoked whenever a download starts or finishes, and a few more options. Here's what you need to do:

      • In the menu, choose ToolsOptions.... An options tab will open.
      • On the left hand side tree expand the Plugins item and choose the Status Command Invoker item. You will see the following options screen:
        Azureus Status Command Invoker options screen
      Here's what you can configure:
      • The Enable checkbox is quite obvious - enable if you want this plugin to work.
      • The Download Start Command and Download Complete Command is where you specify the commands you want to run. Leave empty for not doing anything in either of these fields (probably the start command).
        Notes about specifying commands:
        • If you specify %t in the command, it will be replaced with the torrent name.
        • Any %s in the command will be replaced with the path to the saved file of this torrent. This could either be a file or a folder (usually in case of a torrent that includes multiple files).
        • If you want to pass a single parameter with spaces in it, surround it with quotes (e.g. "a b"). If you want to have a quote within a quoted parameter, preceed it with a back-slash. Don't worry about surrounding %s or %t with quotes. Even if they contain spaces, they will be passed as single parameters.
      • The two Capture options tells the plugin to redirect the command output / error into the plugin log (see below). As you can see in the screenshot, it's good while you're testing to see that everything is working as expected.

Viewing the Plugin Log

      The plugin log file can be viewed by choosing the following from the menu: PluginsLog ViewsStatus Command Invoker. You will see something similar to this:


      In this case, following the previous screenshot, we used the command file %s, so the log contains the results of running this command. Not very useful, but that's just an example. Okay, so now we know the teaser for season 2 of Heroes is encoded at a 704 x 396 resolution.

Building from the Source

      The source distribution is very small (11 KB) and depends on two JARs that you'll have to provide yourself. If you're using Azureus, you already have these jars where Azureus is installed. The files are Azureus2.jar and swt.jar. Please copy these jars to the AzStatusCLI/lib folder.

      Now, to build the plugin from source, you may either use Eclipse (The source distribution is simply an Eclipse 3.2 project) or use the provided build.xml with ANT.

Contact Me

      If you have any questions or suggestions please send me an e-mail to this address. Please note that I get a lot of SPAM, so please include the words 'azureus' or 'azstatuscli' in the subject line. Please contact me especially in the following cases:

      • If you know how to submit a plugin to the Azureus Plugins List. The Plugin FAQ says to "give the sources", but to whom?!?
      • If you found a good use for this plugin.
      • If you have suggestion for improvements. I can't promise anything, but I'd like to hear what you have to say.
      If you find this plugin useful, you may also consider a donation through PayPal using the following button:
      Other things you can find on this site:
      • Manic Miner - a remake of the classic platform/arcade game on the Sinclair ZX Spectrum.
      • UnpackMP4 AVI - a tool that unpacks packed bitstream AVIs. This is useful for playback on Standalone DVD/DivX players that don't support packed bitstream.
      • HebMTKJ - a tool to preprocess Hebrew subtitles before using them in standalone DVD players that can play DivX/XviD files with attached subtitles in SRT format (Hebrew content)
      • The Barak Ori Times a semi-blog I wrote back in 1999-2000.

Technical Notes

      Saving best for last (okay, it's because you're probably not interested...), here are some technical notes about the plugin:

      • The plugin is heavily based on the Azureus Status Mailer plugin. Getting an e-mail when a download finishes is nice, but I'm using the Azureus WebUI, so I can keep track of my downloads from anywhere. I wanted to be able to do some work on the files that completed downloading.
      • The source contains a single JUnit test for the command line parsing (e.g. handling quotes).
      • It turns out it's not trivial to run an external command from Java and capture that command's stdout and stderr. I can't find the tutorial I used to handle this, but you can see the source for how it's done.
      • Of course, the plugin is released under GPL license.

 

 

 

General
Downloading
Installing and Setting Up
Configuration
Viewing the Plugin Log
Building from the Source
Contact Me
Technical Notes