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 // use an integer for version numbers
version = 14 version = 15
cloudstream { cloudstream {

View file

@ -3,27 +3,23 @@ package com.hexated
import com.lagradost.cloudstream3.* import com.lagradost.cloudstream3.*
import com.lagradost.cloudstream3.LoadResponse.Companion.addActors import com.lagradost.cloudstream3.LoadResponse.Companion.addActors
import com.lagradost.cloudstream3.LoadResponse.Companion.addTrailer import com.lagradost.cloudstream3.LoadResponse.Companion.addTrailer
import com.lagradost.cloudstream3.extractors.Filesim
import com.lagradost.cloudstream3.utils.* import com.lagradost.cloudstream3.utils.*
import org.jsoup.nodes.Element import org.jsoup.nodes.Element
import java.net.URLDecoder import java.net.URLDecoder
class LayarKacaProvider : MainAPI() { class LayarKacaProvider : MainAPI() {
override var mainUrl = "https://tv.lk21official.pro" override var mainUrl = "https://tv1.lk21official.pro"
private var seriesUrl = "https://tv1.nontondrama.click" private var seriesUrl = "https://tv1.nontondrama.click"
override var name = "LayarKaca" override var name = "LayarKaca"
override val hasMainPage = true override val hasMainPage = true
override var lang = "id" override var lang = "id"
override val hasDownloadSupport = true
override val supportedTypes = setOf( override val supportedTypes = setOf(
TvType.Movie, TvType.Movie,
TvType.TvSeries, TvType.TvSeries,
TvType.AsianDrama TvType.AsianDrama
) )
companion object {
const val bananalicious = "https://bananalicious.xyz"
}
override val mainPage = mainPageOf( override val mainPage = mainPageOf(
"$mainUrl/populer/page/" to "Film Terplopuler", "$mainUrl/populer/page/" to "Film Terplopuler",
"$mainUrl/rating/page/" to "Film Berdasarkan IMDb Rating", "$mainUrl/rating/page/" to "Film Berdasarkan IMDb Rating",
@ -166,21 +162,16 @@ class LayarKacaProvider : MainAPI() {
document.select("ul#loadProviders > li").map { document.select("ul#loadProviders > li").map {
fixUrl(it.select("a").attr("href")) fixUrl(it.select("a").attr("href"))
}.apmap { }.apmap {
val link = when { loadExtractor(it.getIframe(), "https://nganunganu.sbs", subtitleCallback, callback)
it.startsWith("https://layarkacaxxi.icu") -> {
it.substringBeforeLast("/")
}
it.startsWith(bananalicious) -> decode(it.substringAfter("url="))
else -> {
it
}
}
loadExtractor(link, bananalicious, subtitleCallback, callback)
} }
return true 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") 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. // All providers should be added in this manner. Please don't edit the providers list directly.
registerMainAPI(LayarKacaProvider()) registerMainAPI(LayarKacaProvider())
registerExtractorAPI(Emturbovid()) registerExtractorAPI(Emturbovid())
registerExtractorAPI(Furher())
} }
} }