A Rust library for interacting with qBittorrent's Web API.
Implemented according to the official WebUI API (qBittorrent 5.0+). The crate also supports endpoints introduced through qBittorrent 5.2 (Web API v2.16.0), including features not yet covered by the official reference. For the most accurate and complete list of supported API methods and model fields, please refer to this crate's documentation on docs.rs.
Add dependency by running:
cargo add qbit-rsor manually add to Cargo.toml:
[dependencies]
qbit-rs = "0.5"With WebUI credentials, Qbit logs in automatically and renews the session if
its cookie expires:
use qbit_rs::Qbit;
use qbit_rs::model::Credential;
let credential = Credential::new("username", "password");
let api = Qbit::new("http://my-qb-instance.domain", credential);
let version = api.get_version().await;To reuse an existing WebUI session, provide its SID cookie:
use qbit_rs::Qbit;
let api = Qbit::builder()
.endpoint("http://my-qb-instance.domain")
.cookie("SID=1234567890")
.build();
let version = api.get_version().await;qBittorrent 5.2 and newer versions support stateless API-key authentication.
Qbit adds the required Bearer authorization scheme automatically:
use qbit_rs::Qbit;
let api = Qbit::builder()
.endpoint("http://my-qb-instance.domain")
.api_key("qbt_your_api_key")
.build();
let version = api.get_version().await;API keys cannot access the WebUI's static assets or authentication endpoints
such as login and logout.
The crate by default uses reqwest as the HTTP client. It also supports cyper (HTTP client for compio based on hyper) under the cyper feature flag. To use it, disable default features and enable cyper:
cargo add qbit-rs --no-default-features --features cyperNotice that this will also disable tls and typed-builder support for args. Make sure to enable builder, native-tls or rustls-tls if you need them.
For all methods, see Qbit.
The authentication, application, log, sync, transfer, torrent-management, RSS, and Search APIs are covered.
- Authentication
- Application
- Log
- Sync
- Transfer info
- Torrent management
- Get torrent list
- Download torrent file
- Get torrent generic properties
- Get torrent piece availability
- Get torrent trackers
- Get torrent web seeds
- Get torrent contents
- Get torrent pieces' states
- Get torrent pieces' hashes
- Add new torrent
- Stop torrents
- Start torrents
- Delete torrents
- Recheck torrents
- Reannounce torrents
- Reannounce torrents with selected trackers
- Edit trackers
- Remove trackers
- Add peers
- Add trackers to torrent
- Increase torrent priority
- Decrease torrent priority
- Maximal torrent priority
- Minimal torrent priority
- Set file priority
- Get torrent download limit
- Set torrent download limit
- Set torrent share limit
- Get torrent upload limit
- Set torrent upload limit
- Set torrent location
- Set torrent name
- Set torrent comment
- Set torrent category
- Get all categories
- Add new category
- Edit category
- Remove categories
- Add torrent tags
- Remove torrent tags
- Get all tags
- Create tags
- Delete tags
- Set automatic torrent management
- Toggle sequential download
- Set first/last piece priority
- Set force start
- Set super seeding
- Rename file
- Rename folder
- RSS (experimental)
- Search
- Undocumented