commonMain.providers.LibreProvider.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of torrentsearch Show documentation
Show all versions of torrentsearch Show documentation
Torrent Provider API client written in Kotlin.
The newest version!
package torrentsearch.providers
import torrentsearch.models.Category
import torrentsearch.models.ProviderResult
import torrentsearch.models.SearchParam
import torrentsearch.models.TorrentDescription
import torrentsearch.models.TorrentQuery
internal class LibreProvider(
enabled: Boolean = true,
) : BaseTorrentProvider(enabled) {
override val name: String = "libre"
override val baseUrl: String = ""
override val tokenPath: String = ""
override val searchPath: String = ""
override val categories: Map = mapOf(Category.MOVIES to "")
override val searchParams: Map = emptyMap()
private val torrents = listOf(
TorrentDescription(
provider = name,
hash = "08ada5a7a6183aae1e09d831df6748d566095a10",
magnetUrl = "magnet:?xt=urn:btih:08ada5a7a6183aae1e09d831df6748d566095a10&dn=Sintel&tr=udp%3A%2F%2Fexplodie.org%3A6969&tr=udp%3A%2F%2Ftracker.coppersurfer.tk%3A6969&tr=udp%3A%2F%2Ftracker.empire-js.us%3A1337&tr=udp%3A%2F%2Ftracker.leechers-paradise.org%3A6969&tr=udp%3A%2F%2Ftracker.opentrackr.org%3A1337&tr=wss%3A%2F%2Ftracker.btorrent.xyz&tr=wss%3A%2F%2Ftracker.fastcast.nz&tr=wss%3A%2F%2Ftracker.openwebtorrent.com&ws=https%3A%2F%2Fwebtorrent.io%2Ftorrents%2F&xs=https%3A%2F%2Fwebtorrent.io%2Ftorrents%2Fsintel.torrent",
title = "Sintel",
size = 0L,
seeds = 0,
peers = 0,
themoviedbId = 45745,
imdbId = "tt1727587",
),
TorrentDescription(
provider = name,
hash = "dd8255ecdc7ca55fb0bbf81323d87062db1f6d1c",
magnetUrl = "magnet:?xt=urn:btih:dd8255ecdc7ca55fb0bbf81323d87062db1f6d1c&dn=Big+Buck+Bunny&tr=udp%3A%2F%2Fexplodie.org%3A6969&tr=udp%3A%2F%2Ftracker.coppersurfer.tk%3A6969&tr=udp%3A%2F%2Ftracker.empire-js.us%3A1337&tr=udp%3A%2F%2Ftracker.leechers-paradise.org%3A6969&tr=udp%3A%2F%2Ftracker.opentrackr.org%3A1337&tr=wss%3A%2F%2Ftracker.btorrent.xyz&tr=wss%3A%2F%2Ftracker.fastcast.nz&tr=wss%3A%2F%2Ftracker.openwebtorrent.com&ws=https%3A%2F%2Fwebtorrent.io%2Ftorrents%2F&xs=https%3A%2F%2Fwebtorrent.io%2Ftorrents%2Fbig-buck-bunny.torrent",
title = "Big Buck Bunny",
size = 0L,
seeds = 0,
peers = 0,
themoviedbId = 10378,
imdbId = "tt1254207",
),
TorrentDescription(
provider = name,
hash = "c9e15763f722f23e98a29decdfae341b98d53056",
magnetUrl = "magnet:?xt=urn:btih:c9e15763f722f23e98a29decdfae341b98d53056&dn=Cosmos+Laundromat&tr=udp%3A%2F%2Fexplodie.org%3A6969&tr=udp%3A%2F%2Ftracker.coppersurfer.tk%3A6969&tr=udp%3A%2F%2Ftracker.empire-js.us%3A1337&tr=udp%3A%2F%2Ftracker.leechers-paradise.org%3A6969&tr=udp%3A%2F%2Ftracker.opentrackr.org%3A1337&tr=wss%3A%2F%2Ftracker.btorrent.xyz&tr=wss%3A%2F%2Ftracker.fastcast.nz&tr=wss%3A%2F%2Ftracker.openwebtorrent.com&ws=https%3A%2F%2Fwebtorrent.io%2Ftorrents%2F&xs=https%3A%2F%2Fwebtorrent.io%2Ftorrents%2Fcosmos-laundromat.torrent",
title = "Cosmos Laundromat",
size = 0L,
seeds = 0,
peers = 0,
themoviedbId = 358332,
imdbId = "tt4957236",
),
TorrentDescription(
provider = name,
hash = "209c8226b299b308beaf2b9cd3fb49212dbd13ec",
magnetUrl = "magnet:?xt=urn:btih:209c8226b299b308beaf2b9cd3fb49212dbd13ec&dn=Tears+of+Steel&tr=udp%3A%2F%2Fexplodie.org%3A6969&tr=udp%3A%2F%2Ftracker.coppersurfer.tk%3A6969&tr=udp%3A%2F%2Ftracker.empire-js.us%3A1337&tr=udp%3A%2F%2Ftracker.leechers-paradise.org%3A6969&tr=udp%3A%2F%2Ftracker.opentrackr.org%3A1337&tr=wss%3A%2F%2Ftracker.btorrent.xyz&tr=wss%3A%2F%2Ftracker.fastcast.nz&tr=wss%3A%2F%2Ftracker.openwebtorrent.com&ws=https%3A%2F%2Fwebtorrent.io%2Ftorrents%2F&xs=https%3A%2F%2Fwebtorrent.io%2Ftorrents%2Ftears-of-steel.torrent",
title = "Tears of Steel",
size = 0L,
seeds = 0,
peers = 0,
themoviedbId = 133701,
imdbId = "tt2285752",
),
)
override suspend fun search(query: TorrentQuery): ProviderResult {
val queryString = query.content
if (queryString.isNullOrBlank()) {
return ProviderResult.Error.InvalidQueryError(name, "Libre provider requires query content string.")
}
val results = torrents.filter { it.title.contains(query.content.orEmpty(), true) }
return ProviderResult.Success(name, results)
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy