diff --git a/src/zh/manhuagui/build.gradle b/src/zh/manhuagui/build.gradle index 292c910d0..7babce806 100644 --- a/src/zh/manhuagui/build.gradle +++ b/src/zh/manhuagui/build.gradle @@ -1,7 +1,7 @@ ext { extName = 'ManHuaGui' extClass = '.Manhuagui' - extVersionCode = 20 + extVersionCode = 21 } apply from: "$rootDir/common.gradle" diff --git a/src/zh/manhuagui/src/eu/kanade/tachiyomi/extension/zh/manhuagui/Manhuagui.kt b/src/zh/manhuagui/src/eu/kanade/tachiyomi/extension/zh/manhuagui/Manhuagui.kt index ef017935b..5000db967 100644 --- a/src/zh/manhuagui/src/eu/kanade/tachiyomi/extension/zh/manhuagui/Manhuagui.kt +++ b/src/zh/manhuagui/src/eu/kanade/tachiyomi/extension/zh/manhuagui/Manhuagui.kt @@ -380,6 +380,8 @@ class Manhuagui( private val packedContentRegex = Regex("""['"]([0-9A-Za-z+/=]+)['"]\[['"].*?['"]]\(['"].*?['"]\)""") + private val singleQuoteRegex = Regex("""\\'""") + override fun pageListParse(document: Document): List { // R18 warning element (#erroraudit_show) is remove by web page javascript, so here the warning element // will always exist if this manga is R18 limited whether R18 verification cookies has been sent or not. @@ -393,13 +395,13 @@ class Manhuagui( // Make the packed content normal again so :lib:unpacker can do its job it.replace(packedContentRegex) { match -> val lzs = match.groupValues[1] - val decoded = LZString.decompressFromBase64(lzs).replace("'", "\\'") - + val decoded = LZString.decompressFromBase64(lzs) "'$decoded'.split('|')" } } - val imgDecode = Unpacker.unpack(imgCode) - + // Convert single quote to dash before passing to unpack, since unpack will replace it + // with double quote, which may make json parse fail. + val imgDecode = Unpacker.unpack(singleQuoteRegex.replace(imgCode, "-")) val imgJsonStr = blockCcArgRegex.find(imgDecode)!!.groupValues[0] val imageJson: Comic = json.decodeFromString(imgJsonStr)