Update chillx extractor (#979)

* Update chillxextractor

* bump exts using chillx
This commit is contained in:
V3u47ZoN 2025-05-03 10:20:12 +00:00 committed by GitHub
parent 36a480cd46
commit dd28b05f01
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 14 additions and 12 deletions

View file

@ -44,6 +44,7 @@ class ChillxExtractor(private val client: OkHttpClient, private val headers: Hea
url = it.url,
quality = it.quality,
videoUrl = it.videoUrl,
headers = it.headers,
audioTracks = it.audioTracks,
subtitleTracks = playlistUtils.fixSubtitles(it.subtitleTracks),
)

View file

@ -10,6 +10,7 @@ import android.webkit.WebResourceResponse
import android.webkit.WebView
import android.webkit.WebViewClient
import eu.kanade.tachiyomi.network.GET
import eu.kanade.tachiyomi.util.asJsoup
import okhttp3.Headers
import okhttp3.OkHttpClient
import uy.kohesive.injekt.injectLazy
@ -60,8 +61,8 @@ class WebViewResolver(
view: WebView?,
request: WebResourceRequest?
): WebResourceResponse? {
if (request?.url.toString().contains("assets/js/library")) {
return patchScript(request!!.url.toString(), interfaceName)
if (request?.url.toString().equals(embedUrl, true)) {
return patchBody(request!!.url.toString(), interfaceName)
?: super.shouldInterceptRequest(view, request)
}
@ -92,12 +93,12 @@ class WebViewResolver(
return List(length) { charPool.random() }.joinToString("")
}
private fun patchScript(scriptUrl: String, interfaceName: String): WebResourceResponse? {
val scriptBody = client.newCall(GET(scriptUrl)).execute().body.string()
private fun patchBody(url: String, interfaceName: String): WebResourceResponse? {
val html = client.newCall(GET(url, globalHeaders)).execute().asJsoup()
val oldFunc = randomString()
val newBody = buildString {
append(
val script = html.createElement("script").apply {
appendText(
"""
const $oldFunc = Function;
window.Function = function (...args) {
@ -108,17 +109,17 @@ class WebViewResolver(
};
""".trimIndent()
)
append(scriptBody)
}
html.body().insertChildren(0, script)
return WebResourceResponse(
"application/javascript",
"text/html",
"utf-8",
200,
"ok",
mapOf("server" to "cloudflare"),
ByteArrayInputStream(newBody.toByteArray()),
ByteArrayInputStream(html.outerHtml().toByteArray()),
)
}
}

View file

@ -1,7 +1,7 @@
ext {
extName = 'Hikari'
extClass = '.Hikari'
extVersionCode = 19
extVersionCode = 20
}
apply from: "$rootDir/common.gradle"

View file

@ -1,7 +1,7 @@
ext {
extName = 'Tokuzilla'
extClass = '.Tokuzilla'
extVersionCode = 22
extVersionCode = 23
}
apply from: "$rootDir/common.gradle"

View file

@ -3,7 +3,7 @@ ext {
extClass = '.AniSAGA'
themePkg = 'dooplay'
baseUrl = 'https://www.anisaga.org'
overrideVersionCode = 18
overrideVersionCode = 19
isNsfw = false
}