RCO: Fail to get image links. (#8474)

* RCO: Fail to get image links.

* Update regex
This commit is contained in:
lamaxama 2025-04-15 15:08:24 +08:00 committed by Draff
parent 877ebd33c7
commit 962a22aa34
No known key found for this signature in database
GPG Key ID: E8A89F3211677653
2 changed files with 4 additions and 4 deletions

View File

@ -1,7 +1,7 @@
ext {
extName = 'ReadComicOnline'
extClass = '.Readcomiconline'
extVersionCode = 30
extVersionCode = 31
}
apply from: "$rootDir/common.gradle"

View File

@ -236,8 +236,8 @@ class Readcomiconline : ConfigurableSource, ParsedHttpSource() {
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 key2 = match?.groups?.get(2)?.value ?: throw Exception("Fail to get image links.")
val key1 = match?.groups?.get(1)?.value ?: throw Exception("Fail to get image links. Logging in via WebView may fix this issue.")
val key2 = match?.groups?.get(2)?.value ?: throw Exception("Fail to get image links. Logging in via WebView may fix this issue.")
handler.post {
val innerWv = WebView(Injekt.get<Application>())
@ -444,6 +444,6 @@ class Readcomiconline : ConfigurableSource, ParsedHttpSource() {
private const val QUALITY_PREF = "qualitypref"
private const val SERVER_PREF_TITLE = "Server Preference"
private const val SERVER_PREF = "serverpref"
private val KEY_REGEX = """\.attr\(\s*['"]src['"]\s*,\s*([\w]+)\(\s*([\w]+)\[\s*currImage""".toRegex()
private val KEY_REGEX = """\.attr\(\s*['"]src['"]\s*,\s*([\w]+)\(\s*([\w]+)\[\s*\w+""".toRegex()
}
}