RCO: Fix timeout getting image links error (#8433)
* RCO: Fix timeout getting image links error * Update regex
This commit is contained in:
parent
54055cb43c
commit
1d2fc4493c
@ -1,7 +1,7 @@
|
|||||||
ext {
|
ext {
|
||||||
extName = 'ReadComicOnline'
|
extName = 'ReadComicOnline'
|
||||||
extClass = '.Readcomiconline'
|
extClass = '.Readcomiconline'
|
||||||
extVersionCode = 29
|
extVersionCode = 30
|
||||||
}
|
}
|
||||||
|
|
||||||
apply from: "$rootDir/common.gradle"
|
apply from: "$rootDir/common.gradle"
|
||||||
|
@ -234,7 +234,8 @@ class Readcomiconline : ConfigurableSource, ParsedHttpSource() {
|
|||||||
var webView: WebView? = null
|
var webView: WebView? = null
|
||||||
var images: List<String> = emptyList()
|
var images: List<String> = emptyList()
|
||||||
|
|
||||||
val match = KEY_REGEX.find(document.outerHtml())
|
val html = document.outerHtml()
|
||||||
|
val match = KEY_REGEX.find(html)
|
||||||
val key1 = match?.groups?.get(1)?.value ?: throw Exception("Fail to get image links.")
|
val key1 = match?.groups?.get(1)?.value ?: throw Exception("Fail to get image links.")
|
||||||
val key2 = match?.groups?.get(2)?.value ?: throw Exception("Fail to get image links.")
|
val key2 = match?.groups?.get(2)?.value ?: throw Exception("Fail to get image links.")
|
||||||
handler.post {
|
handler.post {
|
||||||
@ -285,14 +286,14 @@ class Readcomiconline : ConfigurableSource, ParsedHttpSource() {
|
|||||||
|
|
||||||
innerWv.loadDataWithBaseURL(
|
innerWv.loadDataWithBaseURL(
|
||||||
document.location(),
|
document.location(),
|
||||||
document.outerHtml(),
|
html,
|
||||||
"text/html",
|
"text/html",
|
||||||
"UTF-8",
|
"UTF-8",
|
||||||
null,
|
null,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
latch.await(30, TimeUnit.SECONDS)
|
latch.await(10, TimeUnit.SECONDS)
|
||||||
handler.post { webView?.destroy() }
|
handler.post { webView?.destroy() }
|
||||||
|
|
||||||
if (latch.count == 1L) {
|
if (latch.count == 1L) {
|
||||||
@ -443,6 +444,6 @@ class Readcomiconline : ConfigurableSource, ParsedHttpSource() {
|
|||||||
private const val QUALITY_PREF = "qualitypref"
|
private const val QUALITY_PREF = "qualitypref"
|
||||||
private const val SERVER_PREF_TITLE = "Server Preference"
|
private const val SERVER_PREF_TITLE = "Server Preference"
|
||||||
private const val SERVER_PREF = "serverpref"
|
private const val SERVER_PREF = "serverpref"
|
||||||
private val KEY_REGEX = """\.attr\('src',\s*([^\(]+)\(([^\[]+)\[currImage\]\)""".toRegex()
|
private val KEY_REGEX = """\.attr\(\s*['"]src['"]\s*,\s*([\w]+)\(\s*([\w]+)\[\s*currImage""".toRegex()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user