Fix missing latest pages in Gattsu sources. (#10608)

This commit is contained in:
Alessandro Jean 2022-01-31 09:12:57 -03:00 committed by GitHub
parent f2f6b00e4e
commit 1e0146eea0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 24 additions and 6 deletions

View File

@ -0,0 +1,17 @@
package eu.kanade.tachiyomi.extension.pt.hentaitokyo
import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor
import eu.kanade.tachiyomi.multisrc.gattsu.Gattsu
import okhttp3.OkHttpClient
import java.util.concurrent.TimeUnit
class HentaiTokyo : Gattsu(
"Hentai Tokyo",
"https://hentaitokyo.net",
"pt-BR"
) {
override val client: OkHttpClient = super.client.newBuilder()
.addInterceptor(RateLimitInterceptor(1, 2, TimeUnit.SECONDS))
.build()
}

View File

@ -29,8 +29,6 @@ class UniversoHentai : Gattsu(
setUrlWithoutDomain(element.attr("href"))
}
override fun latestUpdatesNextPageSelector() = searchMangaNextPageSelector()
override fun mangaDetailsParse(document: Document): SManga = SManga.create().apply {
val postBox = document.selectFirst(chapterListSelector())!!

View File

@ -42,7 +42,10 @@ abstract class Gattsu(
override fun popularMangaNextPageSelector(): String? = latestUpdatesNextPageSelector()
override fun latestUpdatesRequest(page: Int): Request = GET(baseUrl, headers)
override fun latestUpdatesRequest(page: Int): Request {
val path = if (page == 1) "" else "page/$page"
return GET("$baseUrl/$path", headers)
}
override fun latestUpdatesSelector() = "div.meio div.lista ul li a[href^=$baseUrl]"
@ -52,7 +55,7 @@ abstract class Gattsu(
setUrlWithoutDomain(element.attr("href"))
}
override fun latestUpdatesNextPageSelector(): String? = null
override fun latestUpdatesNextPageSelector(): String = "ul.paginacao li.next > a"
override fun searchMangaRequest(page: Int, query: String, filters: FilterList): Request {
val searchUrl = "$baseUrl/page/$page/".toHttpUrlOrNull()!!.newBuilder()
@ -67,7 +70,7 @@ abstract class Gattsu(
override fun searchMangaFromElement(element: Element): SManga = latestUpdatesFromElement(element)
override fun searchMangaNextPageSelector() = "ul.paginacao li.next > a"
override fun searchMangaNextPageSelector(): String = latestUpdatesNextPageSelector()
override fun mangaDetailsParse(document: Document): SManga = SManga.create().apply {
val postBox = document.select("div.meio div.post-box").first()!!

View File

@ -9,7 +9,7 @@ class GattsuGenerator : ThemeSourceGenerator {
override val themeClass = "Gattsu"
override val baseVersionCode: Int = 2
override val baseVersionCode: Int = 3
override val sources = listOf(
SingleLang("Hentai Season", "https://hentaiseason.com", "pt-BR", isNsfw = true),