diff --git a/src/ru/henchan/build.gradle b/src/ru/henchan/build.gradle index b251f32b8..f3a44b0cc 100644 --- a/src/ru/henchan/build.gradle +++ b/src/ru/henchan/build.gradle @@ -6,7 +6,7 @@ ext { extName = 'Henchan' pkgNameSuffix = 'ru.henchan' extClass = '.Henchan' - extVersionCode = 33 + extVersionCode = 34 isNsfw = true } diff --git a/src/ru/henchan/src/eu/kanade/tachiyomi/extension/ru/henchan/Henchan.kt b/src/ru/henchan/src/eu/kanade/tachiyomi/extension/ru/henchan/Henchan.kt index 99bb6fc71..9cf86da83 100644 --- a/src/ru/henchan/src/eu/kanade/tachiyomi/extension/ru/henchan/Henchan.kt +++ b/src/ru/henchan/src/eu/kanade/tachiyomi/extension/ru/henchan/Henchan.kt @@ -27,11 +27,11 @@ class Henchan : ParsedHttpSource() { override val name = "Henchan" - override val baseUrl = "https://xxx.hentaichan.live" + override val baseUrl = "https://xxxx.hentaichan.live" override val lang = "ru" - override val supportsLatest = false + override val supportsLatest = true private val rateLimitInterceptor = RateLimitInterceptor(2) @@ -41,6 +41,9 @@ class Henchan : ParsedHttpSource() { override fun popularMangaRequest(page: Int): Request = GET("$baseUrl/mostfavorites&sort=manga?offset=${20 * (page - 1)}", headers) + override fun latestUpdatesRequest(page: Int): Request = + GET("$baseUrl/manga/new?offset=${20 * (page - 1)}", headers) + override fun searchMangaRequest(page: Int, query: String, filters: FilterList): Request { val url = if (query.isNotEmpty()) { @@ -57,6 +60,7 @@ class Henchan : ParsedHttpSource() { genres += (if (f.isExcluded()) "-" else "") + f.id + '+' } } + else -> return@forEach } } @@ -66,6 +70,7 @@ class Henchan : ParsedHttpSource() { is OrderBy -> { order = filter.toUriPartWithGenres() } + else -> return@forEach } } "$baseUrl/tags/${genres.dropLast(1)}&sort=manga$order?offset=${20 * (page - 1)}" @@ -75,6 +80,7 @@ class Henchan : ParsedHttpSource() { is OrderBy -> { order = filter.toUriPartWithoutGenres() } + else -> return@forEach } } "$baseUrl/$order?offset=${20 * (page - 1)}" @@ -85,14 +91,11 @@ class Henchan : ParsedHttpSource() { override fun popularMangaSelector() = "div.content_row" - override fun latestUpdatesRequest(page: Int): Request = throw UnsupportedOperationException("Not used") - override fun latestUpdatesSelector() = throw UnsupportedOperationException("Not used") - override fun latestUpdatesFromElement(element: Element) = throw UnsupportedOperationException("Not used") - override fun latestUpdatesNextPageSelector() = throw UnsupportedOperationException("Not used") + override fun latestUpdatesSelector() = popularMangaSelector() override fun searchMangaSelector() = ".content_row:not(:has(div.item:containsOwn(Тип)))" - private fun String.getHQThumbnail(): String? { + private fun String.getHQThumbnail(): String { val isExHenManga = this.contains("/manganew_thumbs_blur/") val regex = "(?<=/)manganew_thumbs\\w*?(?=/)".toRegex(RegexOption.IGNORE_CASE) return this.replace(regex, "showfull_retina/manga") @@ -110,11 +113,16 @@ class Henchan : ParsedHttpSource() { return manga } + override fun latestUpdatesFromElement(element: Element): SManga = + popularMangaFromElement(element) + override fun searchMangaFromElement(element: Element): SManga = popularMangaFromElement(element) override fun popularMangaNextPageSelector() = "#pagination > a:contains(Вперед)" + override fun latestUpdatesNextPageSelector() = popularMangaNextPageSelector() + override fun searchMangaNextPageSelector() = "#nextlink, ${popularMangaNextPageSelector()}" override fun mangaDetailsParse(document: Document): SManga {