fixed LayarKacaProvider & IdlixProvider

This commit is contained in:
hexated 2022-10-23 04:08:57 +07:00
parent aeb9a2cc32
commit 5b6d22783e
4 changed files with 34 additions and 20 deletions

View file

@ -1,5 +1,5 @@
// use an integer for version numbers // use an integer for version numbers
version = 5 version = 6
cloudstream { cloudstream {
@ -24,5 +24,5 @@ cloudstream {
"AsianDrama", "AsianDrama",
) )
iconUrl = "https://www.google.com/s2/favicons?domain=94.103.82.88&sz=%size%" iconUrl = "https://www.google.com/s2/favicons?domain=109.234.36.69&sz=%size%"
} }

View file

@ -282,7 +282,9 @@ class IdlixProvider : MainAPI() {
"post" to id, "post" to id,
"nume" to nume, "nume" to nume,
"type" to type "type" to type
) ),
headers = mapOf("X-Requested-With" to "XMLHttpRequest"),
referer = data
).parsed<ResponseHash>().embed_url ).parsed<ResponseHash>().embed_url
when { when {

View file

@ -1,5 +1,5 @@
// use an integer for version numbers // use an integer for version numbers
version = 4 version = 5
cloudstream { cloudstream {
@ -23,5 +23,5 @@ cloudstream {
"Movie", "Movie",
) )
iconUrl = "https://www.google.com/s2/favicons?domain=lk21.homes&sz=%size%" iconUrl = "https://www.google.com/s2/favicons?domain=lk21official.org&sz=%size%"
} }

View file

@ -5,11 +5,13 @@ 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.utils.ExtractorLink import com.lagradost.cloudstream3.utils.ExtractorLink
import com.lagradost.cloudstream3.utils.loadExtractor import com.lagradost.cloudstream3.utils.loadExtractor
import org.jsoup.Jsoup
import org.jsoup.nodes.Element import org.jsoup.nodes.Element
class LayarKacaProvider : MainAPI() { class LayarKacaProvider : MainAPI() {
override var mainUrl = "https://lk21official.biz" override var mainUrl = "https://lk21official.org"
// private val redirectUrl = "https://nd21x1.github.io"
private val seriesUrl = "https://nontondrama.icu"
override var name = "LayarKaca" override var name = "LayarKaca"
override val hasMainPage = true override val hasMainPage = true
override var lang = "id" override var lang = "id"
@ -22,15 +24,13 @@ class LayarKacaProvider : MainAPI() {
override val mainPage = mainPageOf( override val mainPage = mainPageOf(
"$mainUrl/populer/page/" to "Film Terplopuler", "$mainUrl/populer/page/" to "Film Terplopuler",
"$mainUrl/latest-series/page/" to "Series Terbaru", "$mainUrl/rating/page/" to "Film Berdasarkan IMDb Rating",
"$mainUrl/series/asian/page/" to "Film Asian Terbaru", "$mainUrl/most-commented/page/" to "Film Dengan Komentar Terbanyak",
"$seriesUrl/latest/page/" to "Series Terbaru",
"$seriesUrl/series/asian/page/" to "Film Asian Terbaru",
"$mainUrl/latest/page/" to "Film Upload Terbaru", "$mainUrl/latest/page/" to "Film Upload Terbaru",
) )
companion object {
private const val seriesUrl = "https://nontondrama.today"
}
override suspend fun getMainPage( override suspend fun getMainPage(
page: Int, page: Int,
request: MainPageRequest request: MainPageRequest
@ -64,22 +64,34 @@ class LayarKacaProvider : MainAPI() {
private fun Element.toSearchResult(): SearchResponse? { private fun Element.toSearchResult(): SearchResponse? {
val title = this.selectFirst("h1.grid-title > a")?.ownText()?.trim() ?: return null val title = this.selectFirst("h1.grid-title > a")?.ownText()?.trim() ?: return null
val href = getProperLink(fixUrl(this.selectFirst("h1.grid-title > a")!!.attr("href")), title) val href = fixUrl(this.selectFirst("a")!!.attr("href"))
val posterUrl = fixUrlNull(this.selectFirst(".grid-poster > a > img")?.attr("src")) val posterUrl = fixUrlNull(this.selectFirst(".grid-poster > a > img")?.attr("src"))
val type =
if (this.selectFirst("div.last-episode") == null) TvType.Movie else TvType.TvSeries
return if (type == TvType.TvSeries) {
val episode = this.selectFirst("div.last-episode span")?.text()?.filter { it.isDigit() }
?.toIntOrNull()
newAnimeSearchResponse(title, href, TvType.TvSeries) {
this.posterUrl = posterUrl
addSub(episode)
}
} else {
val quality = this.select("div.quality").text().trim() val quality = this.select("div.quality").text().trim()
return newMovieSearchResponse(title, href, TvType.Movie) { newMovieSearchResponse(title, href, TvType.Movie) {
this.posterUrl = posterUrl this.posterUrl = posterUrl
addQuality(quality) addQuality(quality)
} }
} }
}
override suspend fun search(query: String): List<SearchResponse> { override suspend fun search(query: String): List<SearchResponse> {
val document = app.get( "$mainUrl/?s=$query").document val document = app.get("$mainUrl/?s=$query").document
return document.select("div.search-item").map { return document.select("div.search-item").map {
val title = it.selectFirst("h2 > a")!!.text().trim() val title = it.selectFirst("h2 > a")!!.text().trim()
val type = it.selectFirst("p.cat-links a")?.attr("href").toString() val type = it.selectFirst("p.cat-links a")?.attr("href").toString()
val href = getProperLink(it.selectFirst("h2 > a")!!.attr("href"), type) val href = getProperLink(it.selectFirst("a")!!.attr("href"), type)
val posterUrl = fixUrl(it.selectFirst("img.img-thumbnail")?.attr("src").toString()) val posterUrl = fixUrl(it.selectFirst("img.img-thumbnail")?.attr("src").toString())
newTvSeriesSearchResponse(title, href, TvType.TvSeries) { newTvSeriesSearchResponse(title, href, TvType.TvSeries) {
this.posterUrl = posterUrl this.posterUrl = posterUrl