qbittorrent-haxe
Haxe client implementation for qBittorrent's Web API.
Releasing versions
The library is available on Haxelib.
haxelib install qbittorrent
Usage
The entire API is implemented through methods, so it is not strictly necessary to be familiar with the API's documentation. All options are available either as method parameters, or as documented structure types. Additionally, all return types are documented as structure types, so using this library is as intuitive as possible.
var qbt = new QBittorrentClient("localhost", 8080, "username", "password");
qbt.addTorrent('magnet:?xt=urn:btih:2C6B6858D61D...', {
paused: true,
savepath: '/downloads/'
});
qbt.torrentsPause('2c6b6858d61da9543d4231a71db4b1c9264b0685');
Torrents can be added as one or more URLs (http://, https://, magnet:, bc://bt/), or paths to torrent files.
qbt.addTorrents([
'path/to/ubuntu-20.04.5-desktop-amd64.iso.torrent',
'https://releases.ubuntu.com/20.04/ubuntu-20.04.5-live-server-amd64.iso.torrent',
'magnet:?xt=urn:btih:2C6B6858D61D...'
]);
Most methods that operate on torrents, accept either:
- A torrent hash, or a list of torrent hashes.
- A torrent object, or a list of torrent objects.
- The constant
All.
qbt.torrentsPause([ '2c6b6858d61da9543d4231a71db4b1c9264b0685', 'C9A337562CB0360FD6F5AB40FD2B1B81D5325DBD' ]);
var torr: Torrent = qbt.getTorrent('2c6b6858d61da9543d4231a71db4b1c9264b0685');
qbt.torrentsResume(torr);
qbt.torrentsDelete(All);
Versioning & Compatibility
The version numbering of this Haxelib represents the compatibility with the corresponding versions of qBittorrent's WebUI API.
Specifically, the number follows the format: QM.QmQp.Mp.
- The
QMpart corresponds to the major numbers of the WebUI API. - The
QmQppair corresponds to the combined minor and patch version numbers of the WebUI API. - The
Mppart is the major and patch number of the library. The major number will be incremented for breaking changes, and the patch number only for forward and backward compatible changes.
So for example, Haxelib versions v2.82.* should all be compatible with WebUI API version v2.8.2.