SussyToons: Fix memory leak (#8240)
* Fix memory leak * Remove variable
This commit is contained in:
parent
fa09f8122d
commit
09d9b33080
@ -1,7 +1,7 @@
|
||||
ext {
|
||||
extName = 'Sussy Toons'
|
||||
extClass = '.SussyToons'
|
||||
extVersionCode = 52
|
||||
extVersionCode = 53
|
||||
isNsfw = true
|
||||
}
|
||||
|
||||
|
@ -309,20 +309,21 @@ class SussyToons : HttpSource(), ConfigurableSource {
|
||||
// ============================= Utilities ====================================
|
||||
|
||||
private fun Response.parseScriptToJson(): String? {
|
||||
val quickJs = QuickJs.create()
|
||||
val document = asJsoup()
|
||||
val script = document.select("script")
|
||||
.map(Element::data)
|
||||
.filter(String::isNotEmpty)
|
||||
.joinToString("\n")
|
||||
|
||||
val content = quickJs.evaluate(
|
||||
"""
|
||||
val content = QuickJs.create().use {
|
||||
it.evaluate(
|
||||
"""
|
||||
globalThis.self = globalThis;
|
||||
$script
|
||||
self.__next_f.map(it => it[it.length - 1]).join('')
|
||||
""".trimIndent(),
|
||||
) as String
|
||||
""".trimIndent(),
|
||||
) as String
|
||||
}
|
||||
|
||||
return PAGE_JSON_REGEX.find(content)?.groups?.get(0)?.value
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user