The RTorrent class serves as an interface to a remote RTorrent instance. It implements a lot of the functionality that RTorrent exposes over XMLRPC; currently only XMLRPC over HTTP is supported; but support for direct SCGI is planned. Basically, HTTP support requires a web server to direct requests to RTorrent, whereas SCGI talks directly to RTorrent. (The web server also uses SCGI to talk to RTorrent)
The RTorrent constructor requires a host and optionally a port and url.
Some of the functions documented in here are in fact auto generated (at runtime); We did this for a few reasons: extendability and ease of use. (We can easily chain calls this way) They will only have one argument in the documentation: *args. Obviously some do not take any arguments; the docstring should (in the near future, anyway) explain exactly what variables should be passed.
A simple test:
RTorrent class. This wraps most of the RTorrent main functionality (read: global functionality) in a class. Think of, current upload and download, libTorrent version.
Methods specific to a Torrent can be found in the Torrent class.
Loads a torrent into rtorrent from the torrent path.
Original libTorrent method: load
Loads a torrent into rtorrent from a given string. Will also start the download immediately.
Original libTorrent method: load_raw_start
Loads a torrent into rtorrent from the torrent path. Will also start the download immediately.
Original libTorrent method: load_start
Creates a view; requires a single argument: A name for the view. WARNING: If you add an already existing view; rtorrent will simply crash (at least 0.8.6 does).
Original libTorrent method: view_add
Execute command as rtorrent user and return output as string.
Original libTorrent method: execute_capture
Returns the rTorrent version.
Original libTorrent method: system.client_version
Returns the current working directory.
Original libTorrent method: system.get_cwd
Returns a list of torrents. _type defines what is returned. Valid:
- ‘’ (Empty string), ‘default’
- ‘complete’
- ‘incomplete’
- ‘started’
- ‘stopped’
- ‘active’
- ‘hashing’
- ‘seeding’
Plus all customly defined views.
Returns the current download rate.
Original libTorrent method: get_down_rate
Returns the total downloaded data.
Original libTorrent method: get_down_total
Returns the download upload throttle.
Original libTorrent method: get_download_rate
Returns the hostname.
Original libTorrent method: system.hostname
Returns the IP rtorrent is bound to. (For XMLRPC?)
Original libTorrent method: get_ip
Returns the libTorrent version.
Original libTorrent method: system.library_version
Returns rtorrent maximum memory usage.
Original libTorrent method: get_max_memory_usage
Returns rtorrent memory usage.
Original libTorrent method: get_memory_usage
Returns the process ID.
Original libTorrent method: system.pid
Returns the current upload rate.
Original libTorrent method: get_up_rate
Returns the total uploaded data.
Original libTorrent method: get_up_total
Returns the current upload throttle.
Original libTorrent method: get_upload_rate
Returns a list of all views.
Original libTorrent method: view_list
Returns the XMLRPC Size Limit
Original libTorrent method: get_xmlrpc_size_limit
Query returns a new RTorrentQuery object with the target from the current RTorrent object.
Use this to execute several (different) calls on the RTorrent class in one request. This can increase performance and reduce latency and load.
See RTorrentQuery on how to use it.
Set the current download throttle. Pass the new throttle size in bytes.
Original libTorrent method: set_download_rate
Set the upload throttle. Pass the new throttle size in bytes.
Original libTorrent method: set_upload_rate
Set the XMLRPC size limit.
Original libTorrent method: set_xmlrpc_size_limit