From 5fd379e71b5b63138987c0cff1e381e770906a93 Mon Sep 17 00:00:00 2001 From: Gilfar Date: Mon, 14 Nov 2016 18:38:10 +0100 Subject: [PATCH] update for seasonal manga from Mangasee --- .../data/source/online/english/Mangasee.kt | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/source/online/english/Mangasee.kt b/app/src/main/java/eu/kanade/tachiyomi/data/source/online/english/Mangasee.kt index edfe1f92d..c2bcc0c98 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/source/online/english/Mangasee.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/source/online/english/Mangasee.kt @@ -30,6 +30,8 @@ class Mangasee(override val id: Int) : ParsedOnlineSource() { private val recentUpdatesPattern = Pattern.compile("(.*?)\\s(\\d+)") + private val indexPattern = Pattern.compile("-index-(.*?)-") + override fun popularMangaInitialUrl() = "$baseUrl/search/request.php?sortBy=popularity&sortOrder=descending" override fun popularMangaSelector() = "div.requested > div.row" @@ -141,13 +143,21 @@ class Mangasee(override val id: Int) : ParsedOnlineSource() { override fun pageListParse(response: Response, pages: MutableList) { val document = response.asJsoup() - val url = response.request().url().toString().substringBeforeLast('/') + val fullUrl = response.request().url().toString() + val url = fullUrl.substringBeforeLast('/') val series = document.select("input.IndexName").first().attr("value") val chapter = document.select("span.CurChapter").first().text() + var index = "" + + val m = indexPattern.matcher(fullUrl) + if (m.find()) { + val indexNumber = m.group(1) + index = "-index-$indexNumber" + } document.select("div.ContainerNav").first().select("select.PageSelect > option").forEach { - pages.add(Page(pages.size, "$url/$series-chapter-$chapter-page-${pages.size + 1}.html")) + pages.add(Page(pages.size, "$url/$series-chapter-$chapter$index-page-${pages.size + 1}.html")) } pages.getOrNull(0)?.imageUrl = imageUrlParse(document) }