RTorrent

RTorrent

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:

class rtorrent.RTorrent(target)[source]

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.

add_torrent(*args)
Loads a torrent into rtorrent from the torrent path.

Original libTorrent method: load

add_torrent_raw(*args)
Loads a torrent into rtorrent from a given string. Will also start the download immediately.

Original libTorrent method: load_raw_start

add_torrent_start(*args)
Loads a torrent into rtorrent from the torrent path. Will also start the download immediately.

Original libTorrent method: load_start

create_view(*args)
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(*args)
Execute command as rtorrent user and return output as string.

Original libTorrent method: execute_capture

get_client_version(*args)
Returns the rTorrent version.

Original libTorrent method: system.client_version

get_cwd(*args)
Returns the current working directory.

Original libTorrent method: system.get_cwd

get_download_list(_type='')[source]

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.

get_download_rate(*args)
Returns the current download rate.

Original libTorrent method: get_down_rate

get_download_rate_total(*args)
Returns the total downloaded data.

Original libTorrent method: get_down_total

get_download_throttle(*args)
Returns the download upload throttle.

Original libTorrent method: get_download_rate

get_hostname(*args)
Returns the hostname.

Original libTorrent method: system.hostname

get_ip(*args)
Returns the IP rtorrent is bound to. (For XMLRPC?)

Original libTorrent method: get_ip

get_libtorrent_version(*args)
Returns the libTorrent version.

Original libTorrent method: system.library_version

get_max_memory_usage(*args)
Returns rtorrent maximum memory usage.

Original libTorrent method: get_max_memory_usage

get_memory_usage(*args)
Returns rtorrent memory usage.

Original libTorrent method: get_memory_usage

get_process_id(*args)
Returns the process ID.

Original libTorrent method: system.pid

get_upload_rate(*args)
Returns the current upload rate.

Original libTorrent method: get_up_rate

get_upload_rate_total(*args)
Returns the total uploaded data.

Original libTorrent method: get_up_total

get_upload_throttle(*args)
Returns the current upload throttle.

Original libTorrent method: get_upload_rate

get_view_list(*args)
Returns a list of all views.

Original libTorrent method: view_list

get_xmlrpc_size_limit(*args)
Returns the XMLRPC Size Limit

Original libTorrent method: get_xmlrpc_size_limit

query()[source]

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_download_throttle(*args)
Set the current download throttle. Pass the new throttle size in bytes.

Original libTorrent method: set_download_rate

set_upload_throttle(*args)
Set the upload throttle. Pass the new throttle size in bytes.

Original libTorrent method: set_upload_rate

set_xmlrpc_size_limit(*args)
Set the XMLRPC size limit.

Original libTorrent method: set_xmlrpc_size_limit

Table Of Contents

Previous topic

Introduction for Developers

Next topic

Torrent Model

This Page