Update
This commit is contained in:
parent
f803219c99
commit
e2411e029f
|
@ -22,13 +22,12 @@ class Watchx : Chillx() {
|
|||
override val mainUrl = "https://watchx.top"
|
||||
}
|
||||
|
||||
|
||||
@Suppress("NAME_SHADOWING")
|
||||
open class Chillx : ExtractorApi() {
|
||||
override val name = "Chillx"
|
||||
override val mainUrl = "https://chillx.top"
|
||||
override val requiresReferer = true
|
||||
|
||||
@Suppress("NAME_SHADOWING")
|
||||
override suspend fun getUrl(
|
||||
url: String,
|
||||
referer: String?,
|
||||
|
@ -41,7 +40,7 @@ open class Chillx : ExtractorApi() {
|
|||
referer = url,
|
||||
).text
|
||||
)?.groupValues?.get(1)
|
||||
val decrypt = cryptoAESHandler(master ?: "",key.toByteArray(), false)?.replace("\\", "") ?: throw ErrorLoadingException("failed to decrypt")
|
||||
val decrypt = cryptoAESHandler(master ?: "",fetchKey().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)
|
||||
val subtitlePattern = """\[(.*?)](https?://[^\s,]+)""".toRegex()
|
||||
|
@ -84,11 +83,8 @@ 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 }
|
||||
private suspend fun fetchKey(): String {
|
||||
return app.get("https://raw.githubusercontent.com/rushi-chavan/multi-keys/keys/keys.json").parsedSafe<Keys>()?.key?.get(0) ?: throw ErrorLoadingException("Unable to get key")
|
||||
}
|
||||
|
||||
data class Keys(
|
||||
|
|
Loading…
Reference in New Issue