https://github.com/pyed/rtapi
Raw rTorrent XML-RPC in Go
https://github.com/pyed/rtapi
go golang rtorrent xmlrpc
Last synced: 5 months ago
JSON representation
Raw rTorrent XML-RPC in Go
- Host: GitHub
- URL: https://github.com/pyed/rtapi
- Owner: pyed
- License: apache-2.0
- Created: 2017-04-19T22:44:27.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2025-09-21T00:06:10.000Z (9 months ago)
- Last Synced: 2025-09-21T02:29:37.402Z (9 months ago)
- Topics: go, golang, rtorrent, xmlrpc
- Language: Go
- Homepage:
- Size: 37.1 KB
- Stars: 5
- Watchers: 2
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# rtapi
Raw rTorrent XML-RPC in Go, Written for [rtelegram](https://github.com/pyed/rtelegram)
## Requirements
* [`rTorrent`](https://github.com/rakshasa/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
``` go
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)
}
}
```