fix Chillx

This commit is contained in:
Sofie99 2023-12-04 16:24:09 +07:00
parent f103fb2dd7
commit 5826ae2301

View file

@ -23,13 +23,14 @@ class Watchx : Chillx() {
override val name = "Watchx" override val name = "Watchx"
override val mainUrl = "https://watchx.top" override val mainUrl = "https://watchx.top"
} }
open class Chillx : ExtractorApi() { open class Chillx : ExtractorApi() {
override val name = "Chillx" override val name = "Chillx"
override val mainUrl = "https://chillx.top" override val mainUrl = "https://chillx.top"
override val requiresReferer = true override val requiresReferer = true
companion object { companion object {
private const val KEY = "eN0^>\$^#M08uFv%c" private const val KEY = "tSIsE8FgpRkv3QQQ"
} }
override suspend fun getUrl( override suspend fun getUrl(
@ -38,10 +39,14 @@ open class Chillx : ExtractorApi() {
subtitleCallback: (SubtitleFile) -> Unit, subtitleCallback: (SubtitleFile) -> Unit,
callback: (ExtractorLink) -> Unit callback: (ExtractorLink) -> Unit
) { ) {
val master = Regex("MasterJS\\s*=\\s*'([^']+)").find( val master = Regex("\\s*=\\s*'([^']+)").find(
app.get( app.get(
url, url,
referer = referer referer = referer ?: "",
headers = mapOf(
"Accept" to "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8",
"Accept-Language" to "en-US,en;q=0.5",
)
).text ).text
)?.groupValues?.get(1) )?.groupValues?.get(1)
val decrypt = cryptoAESHandler(master ?: return, KEY.toByteArray(), false)?.replace("\\", "") ?: throw ErrorLoadingException("failed to decrypt") val decrypt = cryptoAESHandler(master ?: return, KEY.toByteArray(), false)?.replace("\\", "") ?: throw ErrorLoadingException("failed to decrypt")