Hentai-chan: Fixed chapter name parsing and image links parsing for mangas, that has quotes in the title (#2532)

Hentai-chan small fixes
This commit is contained in:
Kirill 2020-03-28 19:52:18 +05:00 committed by GitHub
parent 22b48ab3ca
commit 778c63a412
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 3 deletions

View File

@ -5,7 +5,7 @@ ext {
appName = 'Tachiyomi: Henchan'
pkgNameSuffix = 'ru.henchan'
extClass = '.Henchan'
extVersionCode = 14
extVersionCode = 15
libVersion = '1.2'
}
dependencies {

View File

@ -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<JsonObject>(imgString)["fullimg"].array
}