Dart wrapper for qBittorrent Web API.
This package provides a Dart wrapper for qBittorrent Web API.
To use this package, you will need a qBittorrent server running with the Web API enabled.
Supported Web API version: qBittorrent v4.1+
Create a QBittorrentApiV2 instance by providing the URL of your qBittorrent server.
final qbittorrent = QBittorrentApiV2(
baseUrl: 'http://localhost:8080',
cookiesStrategy: const DiskCookiesStrategy(directory: '.cookies'),
logger: true,
);InMemoryCookiesStrategy: Stores cookies in memory. (Default)DiskCookiesStrategy: Stores cookies in files on disk.WebCookiesStrategy: Dummy strategy for not managing cookies (for Flutter Web).
- set
cookiesStrategytoWebCookiesStrategyas cookies are managed by the browser.
final qbittorrent = QBittorrentApiV2(
baseUrl: 'http://localhost:8080',
cookiesStrategy: UniversalPlatform.isWeb ? const WebCookiesStrategy() : const InMemoryCookiesStrategy(),
logger: kDebugMode,
);This package provides methods to interact with various API endpoints. Belows are some of the examples.
To see all available methods, check out qBittorrent WebUI API Documentation.
await qbittorent.auth.login(username: 'username', password: 'password');// Add torrents by urls.
final torrents = NewTorrents.urls(urls: ['https://example.torrent', 'https://example-2.torrent']);
await qbittorrent.torrents.addNewTorrents(torrents: torrents);
// Add torrents by files.
final torrents = NewTorrents.files(files: [File('./example.torrent')]);
await qbittorrent.torrents.addNewTorrents(torrents: torrents);
// Add torrent by bytes.
final newTorrents = NewTorrents.bytes(bytes: [FileBytes(filename: 'example.torrent', bytes: bytes)]);
await qbittorrent.torrents.addNewTorrents(torrents: torrents);const interval = Duration(seconds: 3); // Refresh interval
final stream = qbittorrent.sync.subscribeMainData(interval: interval).listen((data) {
// Handle main data update
});const hash = "123123"; // Torrent hash
const interval = Duration(seconds: 3); // Refresh interval
final stream = qbittorrent.torrents.subscribeProperties(hash: hash, interval: interval).listen((data) {
// Handle torrent properties update
});- This package is under active development. If you find any bug, please create an issue on Github.