A comprehensive Go client for interacting with the qBittorrent Web API. This library provides a simple and efficient way to manage your qBittorrent instance programmatically, supporting all major API endpoints.
- Full API Coverage: Supports all qBittorrent Web API endpoints, including torrent management, application preferences, RSS, and search.
- Easy to Use: Simple and intuitive API design for seamless integration into your Go projects.
- Authentication: Handles login and session management automatically.
- Error Handling: Robust error handling and status code checking for reliable operation.
- Extensible: Easily extendable to support future qBittorrent API updates.
To install the package, use go get
:
go get github.com/guchengod/qbittorrent-api-go
Here's a quick example to get you started:
package main
import (
"fmt"
"github.com/guchengod/qbittorrent-api-go/qbittorrent"
)
func main() {
client := qbittorrent.NewDefaultClient("http://localhost:8080")
err := client.Login("admin", "adminadmin")
if err != nil {
fmt.Println("Login failed:", err)
return
}
defer client.Logout()
version, err := client.GetApplicationVersion()
if err != nil {
fmt.Println("Failed to get application version:", err)
return
}
fmt.Println("Application version:", version)
}
- Authentication: Login, Logout
- Application: Get version, Shutdown, Get/set preferences
- Torrent Management: Add, pause, resume, delete, recheck, reannounce torrents
- RSS: Add feeds, manage items, set auto-downloading rules
- Search: Start, stop, and manage searches
- Sync: Get main data, torrent peers data
- Transfer Info: Get global transfer info, set speed limits
- Logs: Get main log, peer log
For detailed documentation, refer to the qBittorrent Web API Documentation.
Contributions are welcome! If you'd like to contribute, please follow these steps:
- Fork the repository.
- Create a new branch for your feature or bugfix.
- Commit your changes and push to your fork.
- Submit a pull request with a detailed description of your changes.
This project is licensed under the MIT License. See the LICENSE file for details.