Update Chillx.kt

This commit is contained in:
phisher98 2024-05-03 08:11:55 +05:30 committed by GitHub
parent 0ac9d6f2a1
commit f803219c99
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 7 additions and 1 deletions

View File

@ -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<Keys>()?.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<String>
)