fix LayarKacaProvider

This commit is contained in:
hexated 2023-08-03 03:58:04 +07:00
parent ab639e3f48
commit 24f5f1a4db
3 changed files with 14 additions and 17 deletions

View file

@ -1,5 +1,5 @@
// use an integer for version numbers
version = 14
version = 15
cloudstream {

View file

@ -3,27 +3,23 @@ package com.hexated
import com.lagradost.cloudstream3.*
import com.lagradost.cloudstream3.LoadResponse.Companion.addActors
import com.lagradost.cloudstream3.LoadResponse.Companion.addTrailer
import com.lagradost.cloudstream3.extractors.Filesim
import com.lagradost.cloudstream3.utils.*
import org.jsoup.nodes.Element
import java.net.URLDecoder
class LayarKacaProvider : MainAPI() {
override var mainUrl = "https://tv.lk21official.pro"
override var mainUrl = "https://tv1.lk21official.pro"
private var seriesUrl = "https://tv1.nontondrama.click"
override var name = "LayarKaca"
override val hasMainPage = true
override var lang = "id"
override val hasDownloadSupport = true
override val supportedTypes = setOf(
TvType.Movie,
TvType.TvSeries,
TvType.AsianDrama
)
companion object {
const val bananalicious = "https://bananalicious.xyz"
}
override val mainPage = mainPageOf(
"$mainUrl/populer/page/" to "Film Terplopuler",
"$mainUrl/rating/page/" to "Film Berdasarkan IMDb Rating",
@ -166,21 +162,16 @@ class LayarKacaProvider : MainAPI() {
document.select("ul#loadProviders > li").map {
fixUrl(it.select("a").attr("href"))
}.apmap {
val link = when {
it.startsWith("https://layarkacaxxi.icu") -> {
it.substringBeforeLast("/")
}
it.startsWith(bananalicious) -> decode(it.substringAfter("url="))
else -> {
it
}
}
loadExtractor(link, bananalicious, subtitleCallback, callback)
loadExtractor(it.getIframe(), "https://nganunganu.sbs", subtitleCallback, callback)
}
return true
}
private suspend fun String.getIframe() : String {
return app.get(this, referer = "$seriesUrl/").document.select("div.embed iframe").attr("src")
}
private fun decode(input: String): String = URLDecoder.decode(input, "utf-8").replace(" ", "%20")
}
@ -206,3 +197,8 @@ open class Emturbovid : ExtractorApi() {
}
}
class Furher : Filesim() {
override val name = "Furher"
override var mainUrl = "https://furher.in"
}

View file

@ -11,5 +11,6 @@ class LayarKacaProviderPlugin: Plugin() {
// All providers should be added in this manner. Please don't edit the providers list directly.
registerMainAPI(LayarKacaProvider())
registerExtractorAPI(Emturbovid())
registerExtractorAPI(Furher())
}
}