Skip to content

pyed/rtapi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

rtapi

Raw rTorrent XML-RPC in Go, Written for rtelegram

Requirements

  • rTorrent compiled with --with-xmlrpc-c.
  • scgi_port = localhost:5000 in your .rtorrent.rc

How to get

go get github.com/pyed/rtapi

How to use

package main

import (
	"fmt"

	"github.com/pyed/rtapi"
)

func main() {
	rt, err := rtapi.NewRtorrent("localhost:5000") // Or /path/to/socket for "scgi_local".
	if err != nil {
		// ...
	}

	// Get torrents
	torrents, err := rt.Torrents()
	if err != nil {
		// ...
	}

	fmt.Println("Number of torrents:", len(torrents))

	for _, t := range torrents {
		fmt.Println(t.Name)
	}
}

Releases

No releases published

Packages

No packages published

Languages