Extractor: added Moviesapi and fix some extractors

This commit is contained in:
Sofie99 2023-07-11 17:47:19 +07:00
parent 37064133be
commit dc255338de
3 changed files with 20 additions and 22 deletions

View file

@ -12,6 +12,11 @@ import javax.crypto.spec.IvParameterSpec
import javax.crypto.spec.PBEKeySpec
import javax.crypto.spec.SecretKeySpec
class Moviesapi : Chillx() {
override val name = "Moviesapi"
override val mainUrl = "https://w1.moviesapi.club"
}
class Bestx : Chillx() {
override val name = "Bestx"
override val mainUrl = "https://bestx.stream"
@ -27,7 +32,7 @@ open class Chillx : ExtractorApi() {
override val requiresReferer = true
companion object {
private const val KEY = "4VqE3#N7zt&HEP^a"
private const val KEY = "11x&W5UBrcqn\$9Yl"
}
override suspend fun getUrl(
@ -45,7 +50,7 @@ open class Chillx : ExtractorApi() {
val encData = AppUtils.tryParseJson<AESData>(base64Decode(master ?: return))
val decrypt = cryptoAESHandler(encData ?: return, KEY, false)
val source = Regex("""sources:\s*\[\{"file":"([^"]+)""").find(decrypt)?.groupValues?.get(1)
val source = Regex(""""?file"?:\s*"([^"]+)""").find(decrypt)?.groupValues?.get(1)
val tracks = Regex("""tracks:\s*\[(.+)]""").find(decrypt)?.groupValues?.get(1)
// required

View file

@ -65,27 +65,19 @@ open class Filesim : ExtractorApi() {
subtitleCallback: (SubtitleFile) -> Unit,
callback: (ExtractorLink) -> Unit
) {
val response = app.get(url, referer = referer).document
response.select("script[type=text/javascript]").map { script ->
if (script.data().contains(Regex("eval\\(function\\(p,a,c,k,e,[rd]"))) {
val unpackedscript = getAndUnpack(script.data())
val m3u8Regex = Regex("file.\"(.*?m3u8.*?)\"")
val m3u8 = m3u8Regex.find(unpackedscript)?.destructured?.component1() ?: ""
if (m3u8.isNotEmpty()) {
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)
generateM3u8(
name,
m3u8,
m3u8 ?: return,
mainUrl
).forEach(callback)
}
}
}
}
/* private data class ResponseSource(
@JsonProperty("file") val file: String,
@JsonProperty("type") val type: String?,
@JsonProperty("label") val label: String?
) */
}

View file

@ -357,6 +357,7 @@ val extractorApis: MutableList<ExtractorApi> = arrayListOf(
DesuDrive(),
Chillx(),
Moviesapi(),
Watchx(),
Bestx(),
Keephealth(),