From 0570f5869194c10e9fd1b2f9f28b690d5a97740b Mon Sep 17 00:00:00 2001 From: Luqman <16263232+Riztard@users.noreply.github.com> Date: Mon, 22 Jan 2024 22:28:03 +0700 Subject: [PATCH] Mangaku: fix latest, add more manga details (#489) --- src/id/mangaku/build.gradle | 2 +- .../kanade/tachiyomi/extension/id/mangaku/Mangaku.kt | 12 ++++++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/id/mangaku/build.gradle b/src/id/mangaku/build.gradle index 5a14ff62e..fe8432427 100644 --- a/src/id/mangaku/build.gradle +++ b/src/id/mangaku/build.gradle @@ -1,7 +1,7 @@ ext { extName = 'Mangaku' extClass = '.Mangaku' - extVersionCode = 8 + extVersionCode = 9 } apply from: "$rootDir/common.gradle" diff --git a/src/id/mangaku/src/eu/kanade/tachiyomi/extension/id/mangaku/Mangaku.kt b/src/id/mangaku/src/eu/kanade/tachiyomi/extension/id/mangaku/Mangaku.kt index a40b18b6c..2832fccaa 100644 --- a/src/id/mangaku/src/eu/kanade/tachiyomi/extension/id/mangaku/Mangaku.kt +++ b/src/id/mangaku/src/eu/kanade/tachiyomi/extension/id/mangaku/Mangaku.kt @@ -97,11 +97,11 @@ class Mangaku : ParsedHttpSource() { override fun latestUpdatesRequest(page: Int): Request = GET(baseUrl, headers) - override fun latestUpdatesSelector() = "div.kiri_anime div.utao, div.proyek div.utao" + override fun latestUpdatesSelector() = "div.kiri_anime div.utao" override fun latestUpdatesFromElement(element: Element): SManga = SManga.create().apply { setUrlWithoutDomain(element.select("div.uta div.luf a.series").attr("href")) - title = element.select("div.uta div.luf a.series").attr("title") + title = element.select("div.uta div.luf a.series").text() thumbnail_url = element.select("div.uta div.imgu img").attr("abs:data-src") } @@ -129,13 +129,17 @@ class Mangaku : ParsedHttpSource() { .select("#sidebar-a a[imageanchor] > img, #abc a[imageanchor] > img") .attr("abs:src") + genre = document.select(".inf:contains(Genre) p a, .inf:contains(Type) p").joinToString { it.text() } document.select("#wrapper-a #content-a .inf, #abc .inf").forEach { row -> when (row.select(".infx").text()) { - "Genre" -> genre = row.select("p a[rel=tag]").joinToString { it.text() } "Author" -> author = row.select("p").text() "Sinopsis" -> description = row.select("p").text() } } + val altName = document.selectFirst(".inf:contains(Alternative) p")?.ownText().takeIf { it.isNullOrBlank().not() } + altName?.let { + description = "$description\n\nAlternative Name: $altName".trim() + } } override fun chapterListSelector() = "#content-b > div > a, .fndsosmed-social + div > a" @@ -205,7 +209,7 @@ class Mangaku : ParsedHttpSource() { handler.post { webView?.destroy() } if (latch.count == 1L) { - throw Exception("Kehabisan waktu saat men-decrypt tautan gambar") //Timeout while decrypting image links + throw Exception("Kehabisan waktu saat men-decrypt tautan gambar") // Timeout while decrypting image links } return jsInterface.images.mapIndexed { i, url ->