2023-07-20 08:44:27 +00:00
|
|
|
package com.hexated
|
|
|
|
|
2023-09-26 05:45:33 +00:00
|
|
|
import com.fasterxml.jackson.annotation.JsonProperty
|
|
|
|
import com.lagradost.cloudstream3.ErrorLoadingException
|
|
|
|
import com.lagradost.cloudstream3.SubtitleFile
|
2023-10-08 13:20:06 +00:00
|
|
|
import com.lagradost.cloudstream3.apmap
|
2023-09-26 05:45:33 +00:00
|
|
|
import com.lagradost.cloudstream3.app
|
2023-10-08 13:20:06 +00:00
|
|
|
import com.lagradost.cloudstream3.base64Decode
|
2023-09-01 22:48:35 +00:00
|
|
|
import com.lagradost.cloudstream3.extractors.*
|
2023-09-26 05:45:33 +00:00
|
|
|
import com.lagradost.cloudstream3.extractors.helper.AesHelper
|
|
|
|
import com.lagradost.cloudstream3.utils.AppUtils
|
2023-10-08 13:20:06 +00:00
|
|
|
import com.lagradost.cloudstream3.utils.ExtractorApi
|
2023-09-26 05:45:33 +00:00
|
|
|
import com.lagradost.cloudstream3.utils.ExtractorLink
|
|
|
|
import com.lagradost.cloudstream3.utils.M3u8Helper
|
2023-10-08 13:20:06 +00:00
|
|
|
import com.lagradost.cloudstream3.utils.loadExtractor
|
2023-09-30 16:31:50 +00:00
|
|
|
import org.jsoup.nodes.Document
|
|
|
|
import org.mozilla.javascript.Context
|
|
|
|
import org.mozilla.javascript.Scriptable
|
2023-09-01 22:48:35 +00:00
|
|
|
|
2023-10-08 13:20:06 +00:00
|
|
|
open class Uplayer : ExtractorApi() {
|
|
|
|
override val name = "Uplayer"
|
|
|
|
override val mainUrl = "https://uplayer.xyz"
|
|
|
|
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).text
|
|
|
|
val m3u8 = Regex("file:\\s*\"(.*?m3u8.*?)\"").find(res)?.groupValues?.getOrNull(1)
|
|
|
|
M3u8Helper.generateM3u8(
|
|
|
|
name,
|
|
|
|
m3u8 ?: return,
|
|
|
|
mainUrl
|
|
|
|
).forEach(callback)
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
open class Kotakajaib : ExtractorApi() {
|
|
|
|
override val name = "Kotakajaib"
|
|
|
|
override val mainUrl = "https://kotakajaib.me"
|
|
|
|
override val requiresReferer = true
|
|
|
|
|
|
|
|
override suspend fun getUrl(
|
|
|
|
url: String,
|
|
|
|
referer: String?,
|
|
|
|
subtitleCallback: (SubtitleFile) -> Unit,
|
|
|
|
callback: (ExtractorLink) -> Unit
|
|
|
|
) {
|
|
|
|
app.get(url,referer=referer).document.select("ul#dropdown-server li a").apmap {
|
|
|
|
loadExtractor(base64Decode(it.attr("data-frame")), "$mainUrl/", subtitleCallback, callback)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2023-09-01 22:48:35 +00:00
|
|
|
class Doods : DoodLaExtractor() {
|
|
|
|
override var name = "Doods"
|
|
|
|
override var mainUrl = "https://doods.pro"
|
|
|
|
}
|
2023-07-20 08:44:27 +00:00
|
|
|
|
|
|
|
class Dutamovie21 : StreamSB() {
|
|
|
|
override var name = "Dutamovie21"
|
|
|
|
override var mainUrl = "https://dutamovie21.xyz"
|
|
|
|
}
|
|
|
|
|
2023-08-23 22:12:42 +00:00
|
|
|
class FilelionsTo : Filesim() {
|
2023-07-20 08:44:27 +00:00
|
|
|
override val name = "Filelions"
|
|
|
|
override var mainUrl = "https://filelions.to"
|
|
|
|
}
|
|
|
|
|
2023-09-28 14:05:17 +00:00
|
|
|
class FilelionsOn : Filesim() {
|
|
|
|
override val name = "Filelions"
|
|
|
|
override var mainUrl = "https://filelions.online"
|
|
|
|
}
|
|
|
|
|
2023-08-23 22:12:42 +00:00
|
|
|
class Lylxan : Filesim() {
|
|
|
|
override val name = "Lylxan"
|
|
|
|
override var mainUrl = "https://lylxan.com"
|
|
|
|
}
|
|
|
|
|
2023-08-19 01:01:42 +00:00
|
|
|
class Embedwish : Filesim() {
|
|
|
|
override val name = "Embedwish"
|
|
|
|
override var mainUrl = "https://embedwish.com"
|
|
|
|
}
|
|
|
|
|
2023-07-20 08:44:27 +00:00
|
|
|
class Likessb : StreamSB() {
|
|
|
|
override var name = "Likessb"
|
|
|
|
override var mainUrl = "https://likessb.com"
|
|
|
|
}
|
|
|
|
|
|
|
|
class DbGdriveplayer : Gdriveplayer() {
|
|
|
|
override var mainUrl = "https://database.gdriveplayer.us"
|
2023-09-26 05:45:33 +00:00
|
|
|
}
|
|
|
|
|
2023-09-30 16:31:50 +00:00
|
|
|
object NineTv {
|
2023-09-26 05:45:33 +00:00
|
|
|
|
|
|
|
suspend fun getUrl(
|
|
|
|
url: String,
|
|
|
|
referer: String?,
|
|
|
|
subtitleCallback: (SubtitleFile) -> Unit,
|
|
|
|
callback: (ExtractorLink) -> Unit
|
|
|
|
) {
|
|
|
|
val mainUrl = getBaseUrl(url)
|
2023-11-08 21:34:56 +00:00
|
|
|
val res = app.get(url, headers = mapOf(
|
|
|
|
"Accept" to "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8",
|
|
|
|
"Accept-Language" to "en-US,en;q=0.5",
|
|
|
|
"Referer" to (referer ?: ""),
|
|
|
|
))
|
2023-10-31 20:00:38 +00:00
|
|
|
val master = Regex("\\s*=\\s*'([^']+)").find(res.text)?.groupValues?.get(1)
|
2023-09-30 16:31:50 +00:00
|
|
|
val key = res.document.getKeys() ?: throw ErrorLoadingException("can't generate key")
|
2023-09-26 05:45:33 +00:00
|
|
|
val decrypt = AesHelper.cryptoAESHandler(master ?: return, key.toByteArray(), false)
|
2023-09-30 16:31:50 +00:00
|
|
|
?.replace("\\", "")
|
|
|
|
?: throw ErrorLoadingException("failed to decrypt")
|
2023-09-26 05:45:33 +00:00
|
|
|
|
|
|
|
val source = Regex(""""?file"?:\s*"([^"]+)""").find(decrypt)?.groupValues?.get(1)
|
|
|
|
val tracks = Regex("""tracks:\s*\[(.+)]""").find(decrypt)?.groupValues?.get(1)
|
2023-10-01 08:34:30 +00:00
|
|
|
val name = url.getHost()
|
2023-09-26 05:45:33 +00:00
|
|
|
|
|
|
|
M3u8Helper.generateM3u8(
|
2023-10-01 08:34:30 +00:00
|
|
|
name,
|
|
|
|
source ?: return,
|
2023-09-26 05:45:33 +00:00
|
|
|
"$mainUrl/",
|
|
|
|
headers = mapOf(
|
|
|
|
"Accept" to "*/*",
|
|
|
|
"Connection" to "keep-alive",
|
|
|
|
"Sec-Fetch-Dest" to "empty",
|
|
|
|
"Sec-Fetch-Mode" to "cors",
|
|
|
|
"Sec-Fetch-Site" to "cross-site",
|
|
|
|
"Origin" to mainUrl,
|
|
|
|
)
|
|
|
|
).forEach(callback)
|
|
|
|
|
|
|
|
AppUtils.tryParseJson<List<Tracks>>("[$tracks]")
|
|
|
|
?.filter { it.kind == "captions" }?.map { track ->
|
|
|
|
subtitleCallback.invoke(
|
|
|
|
SubtitleFile(
|
|
|
|
track.label ?: "",
|
|
|
|
track.file ?: return@map null
|
|
|
|
)
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
2023-09-30 16:31:50 +00:00
|
|
|
|
|
|
|
private fun Document.getKeys(): String? {
|
|
|
|
val script = (this.selectFirst("script:containsData(eval\\()")?.data()
|
|
|
|
?.replace("eval(", "var result=")?.removeSuffix(");") + ";").trimIndent()
|
|
|
|
val run = script.runJS("result")
|
|
|
|
return """,\s*'([^']+)""".toRegex().find(run)?.groupValues?.getOrNull(1)
|
|
|
|
}
|
|
|
|
|
2023-11-08 21:34:56 +00:00
|
|
|
private fun String.runJS(variable: String): String {
|
2023-09-30 16:31:50 +00:00
|
|
|
val rhino = Context.enter()
|
|
|
|
rhino.optimizationLevel = -1
|
|
|
|
val scope: Scriptable = rhino.initSafeStandardObjects()
|
|
|
|
val result: String
|
|
|
|
try {
|
|
|
|
rhino.evaluateString(scope, this, "JavaScript", 1, null)
|
|
|
|
result = Context.toString(scope.get(variable, scope))
|
|
|
|
} finally {
|
|
|
|
Context.exit()
|
|
|
|
}
|
|
|
|
return result
|
2023-09-26 05:45:33 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
data class Tracks(
|
|
|
|
@JsonProperty("file") val file: String? = null,
|
|
|
|
@JsonProperty("label") val label: String? = null,
|
|
|
|
@JsonProperty("kind") val kind: String? = null,
|
|
|
|
)
|
2023-07-20 08:44:27 +00:00
|
|
|
}
|