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

Asynchronous torrent search against a public API. More...

#include <torrentsearcher.h>

+ Inheritance diagram for TorrentSearcher:
+ Collaboration diagram for TorrentSearcher:

Signals

void searchComplete (const QList< TorrentSearchResult > &results)
 Emitted when a search completes successfully.
 
void searchFailed (const QString &errorMessage)
 Emitted when a search fails (network error, parse error, etc.).
 

Public Member Functions

 TorrentSearcher (QObject *parent=nullptr)
 Construct a TorrentSearcher.
 
void search (const QString &query)
 Start an asynchronous search.
 
QString apiBaseUrl () const
 Base URL for the search API (default: "https://apibay.org").
 
void setApiBaseUrl (const QString &value)
 Set a custom search API base URL.
 
QNetworkProxy networkProxy () const
 SOCKS5 proxy used for search HTTP requests.
 
void setNetworkProxy (const QNetworkProxy &value)
 Set a SOCKS5 proxy for search requests.
 

Detailed Description

Asynchronous torrent search against a public API.

TorrentSearcher queries an HTTP torrent index (default: apibay.org) and returns results as a list of TorrentSearchResult objects. Results are filtered to the Audio category.

auto* searcher = new TorrentSearcher(this);
this, [](const QList<TorrentSearchResult>& results) {
for (const auto& r : results)
qDebug() << r.name() << r.seeders();
});
searcher->search("pink floyd");
Asynchronous torrent search against a public API.
void searchComplete(const QList< TorrentSearchResult > &results)
Emitted when a search completes successfully.

Definition at line 27 of file torrentsearcher.h.

Constructor & Destructor Documentation

◆ TorrentSearcher()

TorrentSearcher::TorrentSearcher ( QObject *  parent = nullptr)
explicit

Construct a TorrentSearcher.

Parameters
parentOptional QObject parent.

Member Function Documentation

◆ apiBaseUrl()

QString TorrentSearcher::apiBaseUrl ( ) const
inline

Base URL for the search API (default: "https://apibay.org").

Definition at line 47 of file torrentsearcher.h.

◆ networkProxy()

QNetworkProxy TorrentSearcher::networkProxy ( ) const
inline

SOCKS5 proxy used for search HTTP requests.

Definition at line 52 of file torrentsearcher.h.

◆ search()

void TorrentSearcher::search ( const QString &  query)

Start an asynchronous search.

Parameters
queryThe search query string.

Results arrive via searchComplete(); errors via searchFailed().

◆ searchComplete

void TorrentSearcher::searchComplete ( const QList< TorrentSearchResult > &  results)
signal

Emitted when a search completes successfully.

May be empty if no results were found.

◆ setApiBaseUrl()

void TorrentSearcher::setApiBaseUrl ( const QString &  value)
inline

Set a custom search API base URL.

Definition at line 49 of file torrentsearcher.h.

◆ setNetworkProxy()

void TorrentSearcher::setNetworkProxy ( const QNetworkProxy &  value)
inline

Set a SOCKS5 proxy for search requests.

Definition at line 54 of file torrentsearcher.h.


The documentation for this class was generated from the following file: