From 778c63a4122cc150b5d4a0124775e42c824d4a95 Mon Sep 17 00:00:00 2001 From: Kirill Date: Sat, 28 Mar 2020 19:52:18 +0500 Subject: [PATCH] Hentai-chan: Fixed chapter name parsing and image links parsing for mangas, that has quotes in the title (#2532) Hentai-chan small fixes --- src/ru/henchan/build.gradle | 2 +- .../eu/kanade/tachiyomi/extension/ru/henchan/Henchan.kt | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/ru/henchan/build.gradle b/src/ru/henchan/build.gradle index 3794d6a50..c67e412c5 100644 --- a/src/ru/henchan/build.gradle +++ b/src/ru/henchan/build.gradle @@ -5,7 +5,7 @@ ext { appName = 'Tachiyomi: Henchan' pkgNameSuffix = 'ru.henchan' extClass = '.Henchan' - extVersionCode = 14 + extVersionCode = 15 libVersion = '1.2' } dependencies { diff --git a/src/ru/henchan/src/eu/kanade/tachiyomi/extension/ru/henchan/Henchan.kt b/src/ru/henchan/src/eu/kanade/tachiyomi/extension/ru/henchan/Henchan.kt index e5ece3270..960ca894c 100644 --- a/src/ru/henchan/src/eu/kanade/tachiyomi/extension/ru/henchan/Henchan.kt +++ b/src/ru/henchan/src/eu/kanade/tachiyomi/extension/ru/henchan/Henchan.kt @@ -165,7 +165,10 @@ class Henchan : ParsedHttpSource() { if (document.select("#right > div:nth-child(4)").text().contains(" похожий на ")) { val chap = SChapter.create() chap.setUrlWithoutDomain(document.select("#left > div > a").attr("href")) - chap.name = document.select("#right > div:nth-child(4)").text().split(" похожий на ")[1] + chap.name = document.select("#right > div:nth-child(4)").text() + .split(" похожий на ")[1] + .replace("\\\"", "\"") + .replace("\\'", "'") chap.chapter_number = 1F chap.date_upload = Date().time //setting to current date because of a sorting in the "Recent updates" section return listOf(chap) @@ -219,7 +222,7 @@ class Henchan : ParsedHttpSource() { private fun Document.parseJsonArray(): JsonArray { val imgScript = this.select("script:containsData(fullimg)").first().toString() - val imgString = imgScript.substring(imgScript.indexOf('{'), imgScript.lastIndexOf('}') + 1) + val imgString = imgScript.substring(imgScript.indexOf('{'), imgScript.lastIndexOf('}') + 1).replace(""", "\"") return gson.fromJson(imgString)["fullimg"].array }