iTorrent
For the past six months or so, I’ve been using Azureus’ command-line interface for my torrenting needs. Using it can be likened to running a cheese grinder over your thighs for hours on end; it’s a horrible, horrible afterthought that some developed put in. It didn’t handle backspace properly, the help menu was dismal, setting file priorities would make you cry, and configuring Azureus itself through that UI was next to impossible. Even the wiki says just fire up X and the GUI to do the initial configuration because the CLI interface is so bad. All that said, Azureus supported DHT, and that was useful enough to justify using it.
rTorrent finally added DHT support. It’s not in the stable release yet, but today I build the libtorrent/rtorrent trunk and the XMLRPC-C trunk. The amount of power and flexibility this combination brings to the table is breathtaking.
First and foremost, rTorrent is the frontend for libtorrent. It’s an *incredibly* fast ncurses client with a ton of features packed in. The UI is much, much, much easier to use. It has screens and progress bars and all manner of useful pieces of data and controls I can navigate to.
But, the real kicker is the XMLRPC interface. Everything you can do in the rTorrent UI, you can do over XMLRPC. When I got this working, I nearly had an integrationgasm by thinking about all of the possibilities. I can write a web app to pull in RSS feeds of torrents (say, from Tokyo Toshokan) and put a ‘Download’ link right there. It can add the episode to a queue of things to watch and file it in the right folder when the download completes. Then I can mark it as watched afterwards and report out on how much of my life has been wasted.
Of course, I can’t just make any old web UI. My UI will be a multi-user rTorrent manager with ACLs and all that sort of fun. It will have a rule engine that rTorrent uses when a file completes to sort files out. And, it’ll detect if you’re using it from my iPhone and give you a special, iPhone-y interface with big happy buttons that say ‘Download’.
One tap to download, baby!
I’ve got the authentication and ACL stuff done (I just gutted Kitto) and a nice Torrent class for getting data over XMLRPC.
I did run in to some problems with XMLRPC-C and PEAR::XML_RPC2, though. Since rTorrent insists on expressive everything in bytes over the API, unsigned int32s are too small to hold the size of most files. The XMLRPC spec doesn’t account for anything larger than an int32, but the Apache guys have an ‘extension’. They added
It’s a very kludgy solution. On a 32-bit OS, PHP’s int datatype is only an int32. Float, however, is as large as you want it to be. It’s probably Bad For Performance, but I just casted

