cloudstream-extensions-hexated/Movierulzhd/src/main/kotlin/com/hexated/Extractors.kt

73 lines
2.2 KiB
Kotlin
Raw Normal View History

2023-05-14 18:49:25 +00:00
package com.hexated
import com.lagradost.cloudstream3.SubtitleFile
import com.lagradost.cloudstream3.app
2023-12-09 19:06:33 +00:00
import com.lagradost.cloudstream3.extractors.Chillx
2023-05-14 18:49:25 +00:00
import com.lagradost.cloudstream3.utils.*
2023-11-21 16:51:29 +00:00
class Sbnmp : ExtractorApi() {
override val name = "Sbnmp"
override var mainUrl = "https://sbnmp.bar"
2023-11-21 16:51:29 +00:00
override val requiresReferer = true
2023-05-14 18:49:25 +00:00
override suspend fun getUrl(
url: String,
referer: String?,
subtitleCallback: (SubtitleFile) -> Unit,
callback: (ExtractorLink) -> Unit
) {
2023-11-21 16:51:29 +00:00
val response = app.get(url, referer = referer)
val script = if (!getPacked(response.text).isNullOrEmpty()) {
getAndUnpack(response.text)
} else {
response.document.selectFirst("script:containsData(sources:)")?.data()
}
val m3u8 =
Regex("file:\\s*\"(.*?m3u8.*?)\"").find(script ?: return)?.groupValues?.getOrNull(1)
2023-05-14 18:49:25 +00:00
callback.invoke(
ExtractorLink(
2023-11-21 16:51:29 +00:00
this.name,
this.name,
m3u8 ?: return,
mainUrl,
Qualities.Unknown.value,
INFER_TYPE,
2023-05-14 18:49:25 +00:00
)
)
}
}
2023-07-27 16:09:25 +00:00
open class Akamaicdn : ExtractorApi() {
override val name = "Akamaicdn"
override val mainUrl = "https://akamaicdn.life"
override val requiresReferer = true
override suspend fun getUrl(
url: String,
referer: String?,
subtitleCallback: (SubtitleFile) -> Unit,
callback: (ExtractorLink) -> Unit
) {
val res = app.get(url, referer = referer).document
2023-10-20 21:40:44 +00:00
val mappers = res.selectFirst("script:containsData(sniff\\()")?.data()?.substringAfter("sniff(")
?.substringBefore(");") ?: return
val ids = mappers.split(",").map { it.replace("\"", "") }
2023-07-27 16:09:25 +00:00
callback.invoke(
ExtractorLink(
this.name,
this.name,
2023-10-20 21:40:44 +00:00
"$mainUrl/m3u8/${ids[1]}/${ids[2]}/master.txt?s=1&cache=1",
2023-07-27 16:09:25 +00:00
url,
Qualities.Unknown.value,
isM3u8 = true,
)
)
}
}
2023-12-09 19:06:33 +00:00
class AnimesagaStream : Chillx() {
override val name = "AnimesagaStream"
override val mainUrl = "https://stream.animesaga.in"
}