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