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, url = it.url,
quality = it.quality, quality = it.quality,
videoUrl = it.videoUrl, videoUrl = it.videoUrl,
headers = it.headers,
audioTracks = it.audioTracks, audioTracks = it.audioTracks,
subtitleTracks = playlistUtils.fixSubtitles(it.subtitleTracks), subtitleTracks = playlistUtils.fixSubtitles(it.subtitleTracks),
) )

View file

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

View file

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

View file

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

View file

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