mirror of
https://github.com/hexated/cloudstream-extensions-hexated.git
synced 2024-08-15 00:03:22 +00:00
LayarKaca: updated domain
This commit is contained in:
parent
ec7c2a1be7
commit
08fa378e28
4 changed files with 5 additions and 37 deletions
|
@ -1,5 +1,5 @@
|
||||||
// use an integer for version numbers
|
// use an integer for version numbers
|
||||||
version = 10
|
version = 11
|
||||||
|
|
||||||
|
|
||||||
cloudstream {
|
cloudstream {
|
||||||
|
|
|
@ -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) }
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -10,7 +10,7 @@ import java.net.URI
|
||||||
import java.net.URLDecoder
|
import java.net.URLDecoder
|
||||||
|
|
||||||
class LayarKacaProvider : MainAPI() {
|
class LayarKacaProvider : MainAPI() {
|
||||||
override var mainUrl = "https://tv.lk21official.lol"
|
override var mainUrl = "https://tv.lk21official.live"
|
||||||
private var seriesUrl = "https://drama2.nontondrama.lol"
|
private var seriesUrl = "https://drama2.nontondrama.lol"
|
||||||
override var name = "LayarKaca"
|
override var name = "LayarKaca"
|
||||||
override val hasMainPage = true
|
override val hasMainPage = true
|
||||||
|
@ -96,7 +96,9 @@ class LayarKacaProvider : MainAPI() {
|
||||||
}
|
}
|
||||||
|
|
||||||
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 req = app.get("$mainUrl/?s=$query")
|
||||||
|
mainUrl = getBaseUrl(req.url)
|
||||||
|
val document = req.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()
|
||||||
|
|
|
@ -10,6 +10,5 @@ class LayarKacaProviderPlugin: Plugin() {
|
||||||
override fun load(context: Context) {
|
override fun load(context: Context) {
|
||||||
// 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(Filemoon())
|
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in a new issue