KanoopTorrentQt 0.1.0
Qt6 wrapper library for libtorrent-rasterbar
Loading...
Searching...
No Matches
KanoopTorrentQt

A Qt6 wrapper library for libtorrent-rasterbar providing a clean, signal/slot-based API for BitTorrent operations.

Core Classes

Class Description
TorrentClient Session manager: add/remove torrents, bandwidth and connection limits, proxy, encryption, DHT/LSD, IP filtering, resume data persistence
Torrent Single torrent handle: control, progress, file management, peer info, tracker management, per-torrent options
TorrentCreator Create .torrent metainfo files from local content
TorrentSearcher Asynchronous torrent search against public APIs
MagnetLink Parse and construct magnet URIs (hex and Base32 info hashes)

Value Classes

Class Description
SessionStats Aggregate session statistics snapshot (transfer totals, rates, DHT nodes)
PeerInfo Connected peer snapshot (address, client, rates, progress, flags)
TorrentSearchResult Search result metadata (name, size, seeders, leechers)

Quick Start

#include <Kanoop/torrent/torrentclient.h>
#include <Kanoop/torrent/magnetlink.h>
auto* client = new TorrentClient(this);
client->setDefaultDownloadDirectory("/tmp/downloads");
client->setResumeDataDirectory("/tmp/resume");
client->setDownloadRateLimit(5 * 1024 * 1024); // 5 MB/s
client->loadResumeData(); // restore previous session
MagnetLink link("magnet:?xt=urn:btih:...");
Torrent* t = client->addTorrent(link);
connect(t, &Torrent::progressUpdated, [](double ratio) {
qDebug() << "Progress:" << int(ratio * 100) << "%";
});
connect(t, &Torrent::downloadComplete, []() {
qDebug() << "Done!";
});
Qt wrapper around a libtorrent session.
Represents a single torrent within a TorrentClient session.
Definition torrent.h:22
void downloadComplete()
Emitted once when the entire torrent download completes.
void progressUpdated(double ratio)
Emitted periodically during download with the current progress ratio (0.0–1.0).
void setSequentialDownload(bool enabled)
Enable or disable sequential piece downloading.

Creating Torrents

#include <Kanoop/torrent/torrentcreator.h>
creator.setTrackers({"udp://tracker.example.com:6969/announce"});
creator.setComment("My content");
creator.setPrivate(true);
if (creator.create("/path/to/content", "/tmp/output.torrent")) {
qDebug() << creator.fileCount() << "files," << creator.pieceCount() << "pieces";
}
Creates .torrent metainfo files from local content.
int pieceCount() const
Number of pieces in the torrent.
void setPrivate(bool enabled)
Mark the torrent as private (BEP 27).
bool create(const QString &sourcePath, const QString &outputPath)
Create a .torrent file from local content.
void setComment(const QString &value)
Set the comment embedded in the torrent metainfo.
int fileCount() const
Number of files in the torrent.
void setTrackers(const QStringList &urls)
Set tracker announce URLs.

Links