Introducing go-rtorrent

a RTorrent XML-RPC client for Go (golang)

a RTorrent XML-RPC client for Go (golang)

See the source code on GitHub (LICENSE)

Documentation on GoDoc

RTorrent is a popular torrent client that has low resource requirements. It is often run on remote servers and bundled with ruTorrent serving as a front end web client. ruTorrent interfaces with RTorrent using its XML-RPC interface, which is the same interface this library uses. For this project I took some of the most important pieces of that interface and exposed them through a Golang library.

This library allows you to connect to your RTorrent server and issue basic commands such as:

  • Add torrents by URL (must be accessible by your RTorrent server)
  • Upload .torrent files directly
  • List torrents
  • List files for an existing torrent
  • Set the label on an existing torrent
  • Get basic stats, such as total downloaded/uploaded, IP of the server, etc.

This only allows for interacting with the RTorrent instance and does not provide a way to download the actual file contents.

The main challenge when creating this library was figuring out how to interface with XML-RPC in Golang. I tried using some existing XML-RPC client libraries, but found that they had many errors and were very complex. I ended up taking some simpler sample code and modifying it a bit to support this specific use case. This would all be much easier and have better type safety/support if RTorrent supported a gRPC interface (for which there is standard support in Golang).

As always, when dealing with any file sharing technology, it is up to the user to ensure that he works within the boundaries of the laws that pertain to him. I do not in any way endorse or encourage copyright infringement, and am not responsible for the use of this library to do such.

General problem solver. Freelance beer practitioner. Prone to coding all day.

Castle Rock, CO https://michaelrobinson.io