fix layarkaca

This commit is contained in:
alex 2023-12-31 12:07:11 +07:00
parent efaa9db40b
commit 1e2f746676
4 changed files with 117 additions and 57 deletions

View file

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

View file

@ -0,0 +1,86 @@
package com.hexated
import com.lagradost.cloudstream3.SubtitleFile
import com.lagradost.cloudstream3.app
import com.lagradost.cloudstream3.extractors.Filesim
import com.lagradost.cloudstream3.utils.ExtractorApi
import com.lagradost.cloudstream3.utils.ExtractorLink
import com.lagradost.cloudstream3.utils.INFER_TYPE
import com.lagradost.cloudstream3.utils.M3u8Helper
import com.lagradost.cloudstream3.utils.getQualityFromName
open class Emturbovid : ExtractorApi() {
override val name = "Emturbovid"
override val mainUrl = "https://emturbovid.com"
override val requiresReferer = true
override suspend fun getUrl(
url: String,
referer: String?,
subtitleCallback: (SubtitleFile) -> Unit,
callback: (ExtractorLink) -> Unit
) {
val response = app.get(url, referer = referer)
val m3u8 = Regex("[\"'](.*?master\\.m3u8.*?)[\"']").find(response.text)?.groupValues?.getOrNull(1)
M3u8Helper.generateM3u8(
name,
m3u8 ?: return,
mainUrl
).forEach(callback)
}
}
open class Hownetwork : ExtractorApi() {
override val name = "Hownetwork"
override val mainUrl = "https://stream.hownetwork.xyz"
override val requiresReferer = true
override suspend fun getUrl(
url: String,
referer: String?,
subtitleCallback: (SubtitleFile) -> Unit,
callback: (ExtractorLink) -> Unit
) {
val id = url.substringAfter("id=")
val res = app.post(
"$mainUrl/api.php?id=$id",
data = mapOf(
"r" to "https://playeriframe.shop/",
"d" to "stream.hownetwork.xyz",
),
referer = url,
headers = mapOf(
"X-Requested-With" to "XMLHttpRequest"
)
).parsedSafe<Sources>()
res?.data?.map {
callback.invoke(
ExtractorLink(
this.name,
this.name,
it.file,
url,
getQualityFromName(it.label),
INFER_TYPE
)
)
}
}
data class Sources(
val data: ArrayList<Data>
) {
data class Data(
val file: String,
val label: String?,
)
}
}
class Furher : Filesim() {
override val name = "Furher"
override var mainUrl = "https://furher.in"
}

View file

@ -8,8 +8,8 @@ import com.lagradost.cloudstream3.utils.*
import org.jsoup.nodes.Element
class LayarKacaProvider : MainAPI() {
override var mainUrl = "https://tv6.lk21official.wiki"
private var seriesUrl = "https://tv8.nontondrama.click"
override var mainUrl = "https://tv7.lk21official.wiki"
private var seriesUrl = "https://tv9.nontondrama.click"
override var name = "LayarKaca"
override val hasMainPage = true
override var lang = "id"
@ -23,7 +23,7 @@ class LayarKacaProvider : MainAPI() {
"$mainUrl/populer/page/" to "Film Terplopuler",
"$mainUrl/rating/page/" to "Film Berdasarkan IMDb Rating",
"$mainUrl/most-commented/page/" to "Film Dengan Komentar Terbanyak",
"$seriesUrl/latest/page/" to "Series Terbaru",
"$seriesUrl/latest-series/page/" to "Series Terbaru",
"$seriesUrl/series/asian/page/" to "Film Asian Terbaru",
"$mainUrl/latest/page/" to "Film Upload Terbaru",
)
@ -173,30 +173,3 @@ class LayarKacaProvider : MainAPI() {
}
}
open class Emturbovid : ExtractorApi() {
override val name = "Emturbovid"
override val mainUrl = "https://emturbovid.com"
override val requiresReferer = true
override suspend fun getUrl(
url: String,
referer: String?,
subtitleCallback: (SubtitleFile) -> Unit,
callback: (ExtractorLink) -> Unit
) {
val response = app.get(url, referer = referer)
val m3u8 = Regex("[\"'](.*?master\\.m3u8.*?)[\"']").find(response.text)?.groupValues?.getOrNull(1)
M3u8Helper.generateM3u8(
name,
m3u8 ?: return,
mainUrl
).forEach(callback)
}
}
class Furher : Filesim() {
override val name = "Furher"
override var mainUrl = "https://furher.in"
}

View file

@ -12,5 +12,6 @@ class LayarKacaProviderPlugin: Plugin() {
registerMainAPI(LayarKacaProvider())
registerExtractorAPI(Emturbovid())
registerExtractorAPI(Furher())
registerExtractorAPI(Hownetwork())
}
}