mirror of
https://github.com/recloudstream/cloudstream.git
synced 2024-08-15 01:53:11 +00:00
Update Chillx.kt
Update for Chillx Thanks to @rowdy for Key update
This commit is contained in:
parent
a516831b9d
commit
a9be26db08
1 changed files with 15 additions and 15 deletions
|
@ -24,6 +24,11 @@ class Watchx : Chillx() {
|
||||||
override val mainUrl = "https://watchx.top"
|
override val mainUrl = "https://watchx.top"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
class AnimesagaStream : Chillx() {
|
||||||
|
override val name = "AnimesagaStream"
|
||||||
|
override val mainUrl = "https://stream.anplay.in"
|
||||||
|
}
|
||||||
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"
|
||||||
|
@ -36,20 +41,15 @@ open class Chillx : ExtractorApi() {
|
||||||
subtitleCallback: (SubtitleFile) -> Unit,
|
subtitleCallback: (SubtitleFile) -> Unit,
|
||||||
callback: (ExtractorLink) -> Unit
|
callback: (ExtractorLink) -> Unit
|
||||||
) {
|
) {
|
||||||
val master = Regex("\\s*=\\s*'([^']+)").find(
|
val master = Regex("""JScript[\w+]?\s*=\s*'([^']+)""").find(
|
||||||
app.get(
|
app.get(
|
||||||
url,
|
url,
|
||||||
referer = referer ?: "",
|
referer = url ?: "",
|
||||||
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, getKey().toByteArray(), false)?.replace("\\", "") ?: throw ErrorLoadingException("failed to decrypt")
|
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 source = Regex(""""?file"?:\s*"([^"]+)""").find(decrypt)?.groupValues?.get(1)
|
||||||
|
|
||||||
val subtitles = Regex("""subtitle"?:\s*"([^"]+)""").find(decrypt)?.groupValues?.get(1)
|
val subtitles = Regex("""subtitle"?:\s*"([^"]+)""").find(decrypt)?.groupValues?.get(1)
|
||||||
val subtitlePattern = """\[(.*?)\](https?://[^\s,]+)""".toRegex()
|
val subtitlePattern = """\[(.*?)\](https?://[^\s,]+)""".toRegex()
|
||||||
val matches = subtitlePattern.findAll(subtitles ?: "")
|
val matches = subtitlePattern.findAll(subtitles ?: "")
|
||||||
|
@ -83,23 +83,23 @@ open class Chillx : ExtractorApi() {
|
||||||
headers = headers
|
headers = headers
|
||||||
).forEach(callback)
|
).forEach(callback)
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun decodeUnicodeEscape(input: String): String {
|
private fun decodeUnicodeEscape(input: String): String {
|
||||||
val regex = Regex("u([0-9a-fA-F]{4})")
|
val regex = Regex("u([0-9a-fA-F]{4})")
|
||||||
return regex.replace(input) {
|
return regex.replace(input) {
|
||||||
it.groupValues[1].toInt(16).toChar().toString()
|
it.groupValues[1].toInt(16).toChar().toString()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
suspend fun getKey() = key ?: fetchKey().also { key = it }
|
|
||||||
|
|
||||||
private suspend fun fetchKey(): String {
|
|
||||||
return app.get("https://raw.githubusercontent.com/Sofie99/Resources/main/chillix_key.json").parsed()
|
|
||||||
}
|
|
||||||
|
|
||||||
data class Tracks(
|
data class Tracks(
|
||||||
@JsonProperty("file") val file: String? = null,
|
@JsonProperty("file") val file: String? = null,
|
||||||
@JsonProperty("label") val label: String? = null,
|
@JsonProperty("label") val label: String? = null,
|
||||||
@JsonProperty("kind") val kind: String? = null,
|
@JsonProperty("kind") val kind: String? = null,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
data class Keys(
|
||||||
|
@JsonProperty("chillx") val key: List<String>
|
||||||
|
)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue