diff --git a/src/en/mangahasu/build.gradle b/src/en/mangahasu/build.gradle index c0e88eba8..fada89491 100644 --- a/src/en/mangahasu/build.gradle +++ b/src/en/mangahasu/build.gradle @@ -6,7 +6,7 @@ ext { extName = 'Mangahasu' pkgNameSuffix = 'en.mangahasu' extClass = '.Mangahasu' - extVersionCode = 13 + extVersionCode = 14 libVersion = '1.2' } diff --git a/src/en/mangahasu/src/eu/kanade/tachiyomi/extension/en/mangahasu/Mangahasu.kt b/src/en/mangahasu/src/eu/kanade/tachiyomi/extension/en/mangahasu/Mangahasu.kt index c19ee0c84..792131ed0 100644 --- a/src/en/mangahasu/src/eu/kanade/tachiyomi/extension/en/mangahasu/Mangahasu.kt +++ b/src/en/mangahasu/src/eu/kanade/tachiyomi/extension/en/mangahasu/Mangahasu.kt @@ -41,19 +41,20 @@ class Mangahasu : ParsedHttpSource() { .add("Referer", baseUrl) override fun popularMangaRequest(page: Int): Request = - GET("$baseUrl/directory.html?page=$page", headers) + GET("$baseUrl/most-popular.html?page=$page", headers) override fun latestUpdatesRequest(page: Int): Request = GET("$baseUrl/latest-releases.html?page=$page", headers) - override fun popularMangaSelector() = "div.div_item" + // Only selects popular of all time + override fun popularMangaSelector() = "div.right div.div_item" override fun latestUpdatesSelector() = "div.div_item" override fun popularMangaFromElement(element: Element): SManga { val manga = SManga.create() manga.thumbnail_url = element.select("img").first().attr("src") - element.select("a.name-manga").first().let { + element.select("a:has(h3.name-manga), a.name-manga").first().let { manga.setUrlWithoutDomain(it.attr("href")) manga.title = it.text() } @@ -91,8 +92,7 @@ class Mangahasu : ParsedHttpSource() { return GET(url.toString(), headers) } - override fun searchMangaSelector() = - popularMangaSelector() + override fun searchMangaSelector() = latestUpdatesSelector() override fun searchMangaFromElement(element: Element): SManga = popularMangaFromElement(element) @@ -104,9 +104,9 @@ class Mangahasu : ParsedHttpSource() { val infoElement = document.select(".info-c").first() val manga = SManga.create() - manga.author = infoElement.select(".info")[0].text() - manga.artist = infoElement.select(".info")[1].text() - manga.genre = infoElement.select(".info")[3].text() + manga.author = isUpdating(infoElement.select(".info")[0].text()) + manga.artist = isUpdating(infoElement.select(".info")[1].text()) + manga.genre = isUpdating(infoElement.select(".info")[3].text()) manga.status = parseStatus(infoElement.select(".info")[4].text()) manga.description = document.select("div.content-info:has(h3:contains(summary)) div").first()?.text() manga.thumbnail_url = document.select("div.info-img img").attr("src") @@ -119,6 +119,10 @@ class Mangahasu : ParsedHttpSource() { else -> SManga.UNKNOWN } + private fun isUpdating(string: String): String { + return if (string == "Updating...") "" else string + } + override fun chapterListSelector() = "tbody tr" override fun chapterFromElement(element: Element): SChapter {