BaseTorrentProvider

abstract class BaseTorrentProvider(enabledByDefault: Boolean = true) : TorrentProvider

The base class for creating new TorrentProviders.

Parameters

enabledByDefault

If the provider requires authentication credentials, set to false and the user will be required to call enable with authentication details.

Constructors

Link copied to clipboard
constructor(enabledByDefault: Boolean = true)

Properties

Link copied to clipboard
abstract val baseUrl: String

The Provider's base url. (ex. https://provider.link)

Link copied to clipboard
abstract val categories: Map<Category, String>

Maps a url safe string of provider categories to a Category.

Link copied to clipboard
override var isEnabled: Boolean

True if the provider is enabled.

Link copied to clipboard
abstract val name: String

The Provider's name.

Link copied to clipboard

The result limit for search requests.

Link copied to clipboard

The Provider's available query parameters and names.

Link copied to clipboard
abstract val searchPath: String

The Provider's path to search data.

Link copied to clipboard
abstract val tokenPath: String

The Provider's path to acquire a token.

Functions

Link copied to clipboard
open override fun disable()

Disable this provider, so it cannot be used until enable is called.

Link copied to clipboard
open override fun enable(username: String?, password: String?, cookies: List<String>)

Enable this provider using the provided authentication details.

Link copied to clipboard
open suspend fun resolve(torrents: List<TorrentDescription>): ResolveResult

Resolve missing details such as the torrent hash/magnetUrl for TorrentDescriptions which require an additional request to obtain.

Link copied to clipboard
abstract suspend fun search(query: TorrentQuery): ProviderResult

Execute a search for the given query in category, returning TorrentDescriptions for each of the Provider's entries.