LayarKaca: updated domain

This commit is contained in:
hexated 2023-03-12 02:20:52 +07:00
parent ec7c2a1be7
commit 08fa378e28
4 changed files with 5 additions and 37 deletions

View file

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

View file

@ -1,33 +0,0 @@
package com.hexated
import com.lagradost.cloudstream3.SubtitleFile
import com.lagradost.cloudstream3.app
import com.lagradost.cloudstream3.utils.*
import org.jsoup.nodes.Element
open class Filemoon : ExtractorApi() {
override val name = "Filemoon"
override val mainUrl = "https://filemoon.sx"
override val requiresReferer = true
override suspend fun getUrl(
url: String,
referer: String?,
subtitleCallback: (SubtitleFile) -> Unit,
callback: (ExtractorLink) -> Unit
) {
val doc = app.get(url).document
val link = unpackJs(doc)?.substringAfter("file:\"")?.substringBefore("\"")
M3u8Helper.generateM3u8(
name,
link ?: return,
"$mainUrl/",
).forEach(callback)
}
private fun unpackJs(script: Element): String? {
return script.select("script").find { it.data().contains("eval(function(p,a,c,k,e,d)") }
?.data()?.let { getAndUnpack(it) }
}
}

View file

@ -10,7 +10,7 @@ import java.net.URI
import java.net.URLDecoder
class LayarKacaProvider : MainAPI() {
override var mainUrl = "https://tv.lk21official.lol"
override var mainUrl = "https://tv.lk21official.live"
private var seriesUrl = "https://drama2.nontondrama.lol"
override var name = "LayarKaca"
override val hasMainPage = true
@ -96,7 +96,9 @@ class LayarKacaProvider : MainAPI() {
}
override suspend fun search(query: String): List<SearchResponse> {
val document = app.get("$mainUrl/?s=$query").document
val req = app.get("$mainUrl/?s=$query")
mainUrl = getBaseUrl(req.url)
val document = req.document
return document.select("div.search-item").map {
val title = it.selectFirst("h2 > a")!!.text().trim()
val type = it.selectFirst("p.cat-links a")?.attr("href").toString()

View file

@ -10,6 +10,5 @@ class LayarKacaProviderPlugin: Plugin() {
override fun load(context: Context) {
// All providers should be added in this manner. Please don't edit the providers list directly.
registerMainAPI(LayarKacaProvider())
registerExtractorAPI(Filemoon())
}
}