From 9d79f5f8dc1eeb67164397321cf4686d434cda51 Mon Sep 17 00:00:00 2001 From: jopejoe1 <34899572+jopejoe1@users.noreply.github.com> Date: Sat, 9 Oct 2021 01:13:51 +1300 Subject: [PATCH] HBrowse Improve Chapter detection (#9390) * Improved chapter detection * Update build.gradle --- src/en/hbrowse/build.gradle | 2 +- .../tachiyomi/extension/en/hbrowse/HBrowse.kt | 15 ++++++++++----- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/src/en/hbrowse/build.gradle b/src/en/hbrowse/build.gradle index 8f26b2c5b..a4bcf4768 100644 --- a/src/en/hbrowse/build.gradle +++ b/src/en/hbrowse/build.gradle @@ -5,7 +5,7 @@ ext { extName = 'HBrowse' pkgNameSuffix = 'en.hbrowse' extClass = '.HBrowse' - extVersionCode = 5 + extVersionCode = 6 isNsfw = true } diff --git a/src/en/hbrowse/src/eu/kanade/tachiyomi/extension/en/hbrowse/HBrowse.kt b/src/en/hbrowse/src/eu/kanade/tachiyomi/extension/en/hbrowse/HBrowse.kt index e062569cb..5dc426e72 100644 --- a/src/en/hbrowse/src/eu/kanade/tachiyomi/extension/en/hbrowse/HBrowse.kt +++ b/src/en/hbrowse/src/eu/kanade/tachiyomi/extension/en/hbrowse/HBrowse.kt @@ -10,10 +10,11 @@ import eu.kanade.tachiyomi.source.model.SManga import eu.kanade.tachiyomi.source.online.ParsedHttpSource import kotlinx.serialization.decodeFromString import kotlinx.serialization.json.Json +import okhttp3.Response +import okhttp3.Request +import okhttp3.OkHttpClient import okhttp3.CookieJar import okhttp3.FormBody -import okhttp3.OkHttpClient -import okhttp3.Request import org.jsoup.nodes.Document import org.jsoup.nodes.Element import uy.kohesive.injekt.injectLazy @@ -162,12 +163,16 @@ class HBrowse : ParsedHttpSource() { // Chapters - override fun chapterListSelector() = "h2:contains(read manga online) + table a:contains(chapter)" + override fun chapterListSelector() = "h2:contains(read manga online) + table tr" + + override fun chapterListParse(response: Response): List { + return super.chapterListParse(response).reversed() + } override fun chapterFromElement(element: Element): SChapter { return SChapter.create().apply { - name = element.text().substringAfter("View ") - setUrlWithoutDomain(element.attr("href")) + name = element.select("td:first-of-type").text() + setUrlWithoutDomain(element.select("a.listLink").attr("href")) } }