From 9c45ca3a6821fb88042d2f37363417c34ad12ea3 Mon Sep 17 00:00:00 2001 From: Eugene <35057681+e-shl@users.noreply.github.com> Date: Fri, 2 Jul 2021 17:15:56 +0500 Subject: [PATCH] [RU]AllHentai fix status (#7937) * [RU]AllHentai fix status * LICENSED * pagination * // * as on the website --- src/ru/allhentai/build.gradle | 2 +- .../extension/ru/allhentai/AllHentai.kt | 26 +++++++++---------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/ru/allhentai/build.gradle b/src/ru/allhentai/build.gradle index 7bdb3a467..122afabc2 100644 --- a/src/ru/allhentai/build.gradle +++ b/src/ru/allhentai/build.gradle @@ -5,7 +5,7 @@ ext { extName = 'AllHentai' pkgNameSuffix = 'ru.allhentai' extClass = '.AllHentai' - extVersionCode = 7 + extVersionCode = 8 libVersion = '1.2' containsNsfw = true } diff --git a/src/ru/allhentai/src/eu/kanade/tachiyomi/extension/ru/allhentai/AllHentai.kt b/src/ru/allhentai/src/eu/kanade/tachiyomi/extension/ru/allhentai/AllHentai.kt index c5ce48c8c..dc8a9a528 100644 --- a/src/ru/allhentai/src/eu/kanade/tachiyomi/extension/ru/allhentai/AllHentai.kt +++ b/src/ru/allhentai/src/eu/kanade/tachiyomi/extension/ru/allhentai/AllHentai.kt @@ -42,13 +42,13 @@ class AllHentai : ParsedHttpSource() { override fun popularMangaSelector() = "div.tile" - override fun latestUpdatesSelector() = "div.tile" + override fun latestUpdatesSelector() = popularMangaSelector() override fun popularMangaRequest(page: Int): Request = - GET("$baseUrl/list?sortType=rate&offset=${70 * (page - 1)}&max=70", headers) + GET("$baseUrl/list?sortType=rate&offset=${70 * (page - 1)}", headers) override fun latestUpdatesRequest(page: Int): Request = - GET("$baseUrl/list?sortType=updated&offset=${70 * (page - 1)}&max=70", headers) + GET("$baseUrl/list?sortType=updated&offset=${70 * (page - 1)}", headers) override fun popularMangaFromElement(element: Element): SManga { val manga = SManga.create() @@ -65,7 +65,7 @@ class AllHentai : ParsedHttpSource() { override fun popularMangaNextPageSelector() = "a.nextLink" - override fun latestUpdatesNextPageSelector() = "a.nextLink" + override fun latestUpdatesNextPageSelector() = popularMangaNextPageSelector() override fun searchMangaRequest(page: Int, query: String, filters: FilterList): Request { val url = "$baseUrl/search/advanced".toHttpUrlOrNull()!!.newBuilder() @@ -89,14 +89,14 @@ class AllHentai : ParsedHttpSource() { is OrderBy -> { if (filter.state > 0) { val ord = arrayOf("not", "year", "rate", "popularity", "votes", "created", "updated")[filter.state] - val ordUrl = "$baseUrl/list?sortType=$ord".toHttpUrlOrNull()!!.newBuilder() + val ordUrl = "$baseUrl/list?sortType=$ord&offset=${70 * (page - 1)}".toHttpUrlOrNull()!!.newBuilder() return GET(ordUrl.toString(), headers) } } is Tags -> { if (filter.state > 0) { - val tagName = getTagsList()[filter.state].name - val tagUrl = "$baseUrl/list/tag/$tagName".toHttpUrlOrNull()!!.newBuilder() + val tagName = getTagsList()[filter.state].url + val tagUrl = "$baseUrl/list/tag/$tagName?offset=${70 * (page - 1)}".toHttpUrlOrNull()!!.newBuilder() return GET(tagUrl.toString(), headers) } } @@ -113,11 +113,11 @@ class AllHentai : ParsedHttpSource() { override fun searchMangaFromElement(element: Element): SManga = popularMangaFromElement(element) - // max 200 results - override fun searchMangaNextPageSelector(): Nothing? = null + // max 200 results (exception OrderBy,Tags) + override fun searchMangaNextPageSelector() = popularMangaNextPageSelector() override fun mangaDetailsParse(document: Document): SManga { - val infoElement = document.select("div.leftContent").first() + val infoElement = document.select(".expandable").first() val rawCategory = infoElement.select("span.elem_category").text() val category = if (rawCategory.isNotEmpty()) { rawCategory.toLowerCase() @@ -130,7 +130,7 @@ class AllHentai : ParsedHttpSource() { if (authorElement == null) { authorElement = infoElement.select("span.elem_screenwriter").first()?.text() } - manga.title = infoElement.select("h1.names .name").text() + manga.title = document.select("h1.names .name").text() manga.author = authorElement manga.artist = infoElement.select("span.elem_illustrator").first()?.text() manga.genre = infoElement.select("span.elem_genre").text().split(",").plusElement(category).joinToString { it.trim() } @@ -141,8 +141,8 @@ class AllHentai : ParsedHttpSource() { } private fun parseStatus(element: String): Int = when { - element.contains("Запрещена публикация произведения по копирайту") -> SManga.LICENSED - element.contains("