From 08fa378e2836e959ae1ec2fc482e5bd189960476 Mon Sep 17 00:00:00 2001 From: hexated Date: Sun, 12 Mar 2023 02:20:52 +0700 Subject: [PATCH] LayarKaca: updated domain --- LayarKacaProvider/build.gradle.kts | 2 +- .../src/main/kotlin/com/hexated/Filemoon.kt | 33 ------------------- .../kotlin/com/hexated/LayarKacaProvider.kt | 6 ++-- .../com/hexated/LayarKacaProviderPlugin.kt | 1 - 4 files changed, 5 insertions(+), 37 deletions(-) delete mode 100644 LayarKacaProvider/src/main/kotlin/com/hexated/Filemoon.kt diff --git a/LayarKacaProvider/build.gradle.kts b/LayarKacaProvider/build.gradle.kts index e768faab..1fb01fc5 100644 --- a/LayarKacaProvider/build.gradle.kts +++ b/LayarKacaProvider/build.gradle.kts @@ -1,5 +1,5 @@ // use an integer for version numbers -version = 10 +version = 11 cloudstream { diff --git a/LayarKacaProvider/src/main/kotlin/com/hexated/Filemoon.kt b/LayarKacaProvider/src/main/kotlin/com/hexated/Filemoon.kt deleted file mode 100644 index 2af8eace..00000000 --- a/LayarKacaProvider/src/main/kotlin/com/hexated/Filemoon.kt +++ /dev/null @@ -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) } - } - -} \ No newline at end of file diff --git a/LayarKacaProvider/src/main/kotlin/com/hexated/LayarKacaProvider.kt b/LayarKacaProvider/src/main/kotlin/com/hexated/LayarKacaProvider.kt index 7dbcc9e3..a2ac6129 100644 --- a/LayarKacaProvider/src/main/kotlin/com/hexated/LayarKacaProvider.kt +++ b/LayarKacaProvider/src/main/kotlin/com/hexated/LayarKacaProvider.kt @@ -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 { - 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() diff --git a/LayarKacaProvider/src/main/kotlin/com/hexated/LayarKacaProviderPlugin.kt b/LayarKacaProvider/src/main/kotlin/com/hexated/LayarKacaProviderPlugin.kt index 6aeb7a18..9743b456 100644 --- a/LayarKacaProvider/src/main/kotlin/com/hexated/LayarKacaProviderPlugin.kt +++ b/LayarKacaProvider/src/main/kotlin/com/hexated/LayarKacaProviderPlugin.kt @@ -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()) } } \ No newline at end of file