TorrentSearch

class TorrentSearch(httpClient: HttpClient = HttpClient(), enableDefaultProviders: Boolean = true, providers: List<TorrentProvider> = emptyList(), providerCache: TorrentProviderCache? = null)

Parameters

httpClient

The HttpClient to use for TorrentProvider search requests. NOTE: If providing a HttpClient used elsewhere in your app, do not call dispose as this will close your HttpClient

enableDefaultProviders

When false, the built-in default providers will be disabled. They can be enabled later with enableProvider.

providers

An optional list of custom TorrentProvider implementations.

providerCache

An optional TorrentProviderCache for caching.

Constructors

Link copied to clipboard
constructor(httpClient: HttpClient = HttpClient(), enableDefaultProviders: Boolean = true, providers: List<TorrentProvider> = emptyList(), providerCache: TorrentProviderCache? = null)

Functions

Link copied to clipboard

Disable the provider name, future queries will not be handled by this provider.

Link copied to clipboard
fun dispose()

Release the http client and prevent future use of this instance.

Link copied to clipboard

Returns a list of enabled providers.

Link copied to clipboard
fun enableProvider(name: String, username: String? = null, password: String? = null, cookies: List<String> = emptyList())

Enable the provider name with the included credentials and cookies.

Link copied to clipboard

Returns a list of available TorrentProvider instances.

Link copied to clipboard
fun search(buildQuery: TorrentQuery.() -> Unit): SearchResult

Search all enabled providers with the TorrentQuery.