From cdcaaabaa6f59f051727e5b5ec70a914b903481d Mon Sep 17 00:00:00 2001 From: Oldwangtouchtouchdoge <18094567+Oldwangtouchtouchdoge@users.noreply.github.com> Date: Tue, 28 Jul 2020 02:53:32 +0800 Subject: [PATCH] : Add the backslashes to escape '\}' back. (#3926) * Add the backslashes to escape '\}' back. * Fix manga.genre format in mangaDetailsParse() to display multiple multiple genre separately. --- src/zh/manhuagui/build.gradle | 2 +- .../kanade/tachiyomi/extension/zh/manhuagui/Manhuagui.kt | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/zh/manhuagui/build.gradle b/src/zh/manhuagui/build.gradle index 78fb2d709..b507aef9a 100644 --- a/src/zh/manhuagui/build.gradle +++ b/src/zh/manhuagui/build.gradle @@ -5,7 +5,7 @@ ext { extName = 'ManHuaGui' pkgNameSuffix = 'zh.manhuagui' extClass = '.Manhuagui' - extVersionCode = 3 + extVersionCode = 4 libVersion = '1.2' } 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 6a6ee3229..767a88bcd 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 @@ -224,7 +224,7 @@ class Manhuagui : ConfigurableSource, ParsedHttpSource() { manga.description = document.select("div#intro-all").text().trim() manga.thumbnail_url = document.select("p.hcover > img").attr("abs:src") manga.artist = document.select("span:contains(漫画作者) > a , span:contains(漫畫作者) > a").text().trim() - manga.genre = document.select("span:contains(漫画剧情) > a , span:contains(漫畫劇情) > a").text().trim() + manga.genre = document.select("span:contains(漫画剧情) > a , span:contains(漫畫劇情) > a").text().trim().replace(" ", ", ") manga.status = when (document.select("div.book-detail > ul.detail-list > li.status > span > span").first().text()) { "连载中" -> SManga.ONGOING "已完结" -> SManga.COMPLETED @@ -252,13 +252,15 @@ class Manhuagui : ConfigurableSource, ParsedHttpSource() { error("R18作品显示开关未开启或未生效") // "R18 setting didn't enabled or became effective" val html = document.html() - val re = Regex("""window\[".*?"](\(.*\)\s*\{[\s\S]+}\s*\(.*\))""") + // These "\" can't be remove: \} + val re = Regex("""window\[".*?"\](\(.*\)\s*\{[\s\S]+\}\s*\(.*\))""") val imgCode = re.find(html)?.groups?.get(1)?.value val imgDecode = Duktape.create().use { it.evaluate(jsDecodeFunc + imgCode) as String } - val re2 = Regex("""\{.*}""") + // \} + val re2 = Regex("""\{.*\}""") val imgJsonStr = re2.find(imgDecode)?.groups?.get(0)?.value val imageJson: Comic = gson.fromJson(imgJsonStr, Comic::class.java)