Jump to content

uTorrent WebUI command line utility and library for Python 3


twistedfall

Recommended Posts

I have written cross-platform command line client utility to access µTorrent WebUI. It is now increasingly useful as Linux µTorrent server is out, though it supports both server and desktop WebUIs. So I thought to share it with the community.

Homepage: http://github.com/twistedfall/utorrentctl

Utility itself: http://github.com/twistedfall/utorrentctl/raw/master/utorrentctl.py

README: http://github.com/twistedfall/utorrentctl/blob/master/README

You will want to also get http://github.com/twistedfall/utorrentctl/raw/master/config.py to have your connection parameters pre-set to your own values.

It is written in Python 3.1, so you will need an interpreter for it. Any modern Linux distro already has it (or it is installable from repo), Windows and Mac OS X users cat get it at: http://www.python.org/download/. I would like to get some non-Linux testing.

The API coverage it not yet complete, meaning you won't be able to do everything WebUI can, but I will try to improve it. But there are things you can do with utorrentctl that WebUI can't. For example removing torrent with data and torrent file and choosing download location for a single torrent.

Please feel free to ask any questions should they arise.

Link to comment
Share on other sites

  • Replies 71
  • Created
  • Last Reply

Very nice! I just came here to share some shell scripts I'd written to handle simple tasks like adding a magnet link and pausing all the torrents without having to fire up webui (not that the Linux webui handles add URL yet!), but this is much more complete and polished. Very handy to associate the Linux command with the magnet protocol in Firefox and automatically load any magnet link you click :)

I haven't gone through all your API yet, but does it have commands to report basic stats like the current download rate?

Link to comment
Share on other sites

  • 2 weeks later...

Another bump. Optimized network usage (info about several torrents is now fetched in a single request, had to hack json a little to achieve this) added --all option to perform operation on all torrents at once, added ability to display torrent job info (upload/download limits, trackers, etc.), verbose is now enabled by default (use -V to reverse), library API and cli options are changed in several places, be aware, see --help for a list of actual options

Link to comment
Share on other sites

Do you mean labels? Library already supports them: each torrent has label field and you can receive label list with torrent_list( labels ), but cli utility doesn't yet show any labels. I will try to implement them the following week (the one that starts on 18 of October :) ). But patches are always welcome!

Link to comment
Share on other sites

Yeah, Labels. I was talking more about setting them than retrieving them but both are handy.

Looks like you haven't used the setprops call in the library so far, so I'll see about following your coding style and getting at the very least labels implemented tomorrow or Tuseday. I might just go through the entire list of possibilities for setprops while I'm at it though.

Link to comment
Share on other sites

Huh, easier than I thought for never having touched python before. Definitely never going to be my favorite language but I've seen worse. Labels are working, I'll go through the rest of setprops as I get time/the desire.

Link: patch

Oh, have a look at torrent_set_label if you would? It's currently making a request for each hash supplied because done like torrent_[start|stop|pause|etc...] it only changes the label of the last hash supplied. It's almost certainly something exceedingly simple but I've exhausted my patience for the night.

Link to comment
Share on other sites

Added ability to download files from the uTorrent server and generate magnet links from available torrents. Also beware, some command line switches changed to improve experience. For example login info switches are all uppercase now, -F is synonym to --force and can be used in place of --data --torrent when removing torrents, -f and -I is merged into -i

Link to comment
Share on other sites

Another update, added ability to set torrent properties (labels, upload/download speed), list filtering by label, batch file priority setting, torrent list caching (so that two consecutive requests to torrent_list() will use less traffic), ability to see complete torrent info with --dump

Link to comment
Share on other sites

  • 2 weeks later...
I keep getting an invalid syntax:

mortis% python utorrentctl.py --help

You should run it either like:

python3 utorrentctl.py --help

or make it executable:

chmod +x utorrentctl.py

and then run just like any executable file:

./utorrentctl.py --help

All above supposes that python3 in Ubuntu is installed with python3 binary name. Please let me know if it helps.

Link to comment
Share on other sites

  • 2 weeks later...
  • 1 month later...

Archived

This topic is now archived and is closed to further replies.


×
×
  • Create New...