#rtorrent #xmlrpc #rpc #remote #control


XMLRPC API bindings for rtorrent

13 releases (5 stable)

1.0.4 May 7, 2022
1.0.3 Dec 12, 2021
1.0.2 Oct 28, 2021
0.2.1 Oct 23, 2021
0.1.0 Sep 16, 2021

#270 in Cryptography

Download history 2/week @ 2023-06-09 27/week @ 2023-06-16 12/week @ 2023-06-23 43/week @ 2023-06-30 11/week @ 2023-07-07 6/week @ 2023-07-14 12/week @ 2023-07-21 16/week @ 2023-07-28 7/week @ 2023-08-04 22/week @ 2023-08-11 20/week @ 2023-08-18 19/week @ 2023-08-25 12/week @ 2023-09-01 24/week @ 2023-09-08 20/week @ 2023-09-15 5/week @ 2023-09-22

62 downloads per month
Used in rtorrent-utils

MIT license



Typed, Rust-ey bindings for the XMLRPC rtorrent API


The top-level structure is Server, which represents a logical XMLRPC endpoint. (For now, only HTTP endpoints are supported, but that could be expanded relatively easily.)

One can get a list of loaded torrents via Server::download_list(). Download objects represent a loaded torrent (identified by SHA1 digest, in hex).

For each Download, there are a number of accessors for attributes on that loaded torrent. (Accessors on Download correspond to the d.* methods in the rtorrent API.) Additionally, one can get a list of trackers for that download with Download::trackes().

Tracker objects represent a specific tracker for a given download. (Accessors on Tracker correspond to the t.* methods in the rtorrent API.) One example is Tracker::url().

We can get the Peers for a loaded torrent via the Download::peers() method. Peers represent other participants in the swarm for that particular torrent. (Accessors on Peer correspond to the p.* methods in the rtorrent API.) One example is Peer::address().

File objects represent an individual file associated with a download. Downloads may have one or more Download::files(). Accessors on File correspond to the f.* methods in the rtorrent API. An example is File::path().


For each torrent, print its name, and whether or not it is active.

use rtorrent_xmlrpc_bindings as rtorrent;
use rtorrent::Result;

fn main() -> Result<()> {
    let handle = rtorrent::Server::new("");
    for dl in handle.download_list()? {
        println!("{}: {}", dl.name()?, if dl.is_active()? { "active" } else { "inactive" });

Do the same thing, using the multicall API.

use rtorrent_xmlrpc_bindings as rtorrent;
use rtorrent::multicall::d;

let handle = rtorrent::Server::new("");
    .for_each(|(name, active)| {
        println!("{}: {}", name, if active { "active" } else { "inactive" });


~30K SLoC