From f803219c993bfd4e6911d01d19c20ca64ee5797f Mon Sep 17 00:00:00 2001 From: phisher98 <153359846+phisher98@users.noreply.github.com> Date: Fri, 3 May 2024 08:11:55 +0530 Subject: [PATCH] Update Chillx.kt --- .../java/com/lagradost/cloudstream3/extractors/Chillx.kt | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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 175f3d1d..3a11e874 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/extractors/Chillx.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/extractors/Chillx.kt @@ -41,7 +41,6 @@ open class Chillx : ExtractorApi() { referer = url, ).text )?.groupValues?.get(1) - val key = app.get("https://raw.githubusercontent.com/rushi-chavan/multi-keys/keys/keys.json").parsedSafe()?.key?.get(0) ?: throw ErrorLoadingException("Unable to get key") val decrypt = cryptoAESHandler(master ?: "",key.toByteArray(), false)?.replace("\\", "") ?: throw ErrorLoadingException("failed to decrypt") val source = Regex(""""?file"?:\s*"([^"]+)""").find(decrypt)?.groupValues?.get(1) val subtitles = Regex("""subtitle"?:\s*"([^"]+)""").find(decrypt)?.groupValues?.get(1) @@ -85,6 +84,13 @@ open class Chillx : ExtractorApi() { } } + private var key: String? = null + val key = fetchKey() ?: throw ErrorLoadingException("Unable to get key") + + private suspend fun fetchKey(): String? { + return app.get("https://raw.githubusercontent.com/rushi-chavan/multi-keys/keys/keys.json").parsedSafe()?.key?.get(0)?.also { key = it } + } + data class Keys( @JsonProperty("chillx") val key: List )