From 927453d9fe0bb370ae811ea6df10f385eb0862b6 Mon Sep 17 00:00:00 2001 From: Sofie <117321707+Sofie99@users.noreply.github.com> Date: Wed, 12 Jul 2023 23:15:25 +0700 Subject: [PATCH] Extractor: added Moviesapi and fix some extractors (#504) * Extractor: added Pixeldrain, Wibufile and fix some extractors * Extractor: added Moviesapi and fix some extractors --------- Co-authored-by: Sofie99 --- .../cloudstream3/extractors/Chillx.kt | 9 ++++-- .../cloudstream3/extractors/Filesim.kt | 32 +++++++------------ .../cloudstream3/utils/ExtractorApi.kt | 1 + 3 files changed, 20 insertions(+), 22 deletions(-) diff --git a/app/src/main/java/com/lagradost/cloudstream3/extractors/Chillx.kt b/app/src/main/java/com/lagradost/cloudstream3/extractors/Chillx.kt index 1c548e74..b4f3d897 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/extractors/Chillx.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/extractors/Chillx.kt @@ -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(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 diff --git a/app/src/main/java/com/lagradost/cloudstream3/extractors/Filesim.kt b/app/src/main/java/com/lagradost/cloudstream3/extractors/Filesim.kt index be0efd0c..a1148bb8 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/extractors/Filesim.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/extractors/Filesim.kt @@ -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()) { - generateM3u8( - name, - m3u8, - mainUrl - ).forEach(callback) - } - } + 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 ?: return, + mainUrl + ).forEach(callback) } - /* private data class ResponseSource( - @JsonProperty("file") val file: String, - @JsonProperty("type") val type: String?, - @JsonProperty("label") val label: String? - ) */ - } \ No newline at end of file diff --git a/app/src/main/java/com/lagradost/cloudstream3/utils/ExtractorApi.kt b/app/src/main/java/com/lagradost/cloudstream3/utils/ExtractorApi.kt index f0c1ea3b..f6f76fe7 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/utils/ExtractorApi.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/utils/ExtractorApi.kt @@ -357,6 +357,7 @@ val extractorApis: MutableList = arrayListOf( DesuDrive(), Chillx(), + Moviesapi(), Watchx(), Bestx(), Keephealth(),