Fix missing latest pages in Gattsu sources. (#10608)
This commit is contained in:
parent
f2f6b00e4e
commit
1e0146eea0
|
@ -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()
|
||||||
|
}
|
|
@ -29,8 +29,6 @@ class UniversoHentai : Gattsu(
|
||||||
setUrlWithoutDomain(element.attr("href"))
|
setUrlWithoutDomain(element.attr("href"))
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun latestUpdatesNextPageSelector() = searchMangaNextPageSelector()
|
|
||||||
|
|
||||||
override fun mangaDetailsParse(document: Document): SManga = SManga.create().apply {
|
override fun mangaDetailsParse(document: Document): SManga = SManga.create().apply {
|
||||||
val postBox = document.selectFirst(chapterListSelector())!!
|
val postBox = document.selectFirst(chapterListSelector())!!
|
||||||
|
|
||||||
|
|
|
@ -42,7 +42,10 @@ abstract class Gattsu(
|
||||||
|
|
||||||
override fun popularMangaNextPageSelector(): String? = latestUpdatesNextPageSelector()
|
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]"
|
override fun latestUpdatesSelector() = "div.meio div.lista ul li a[href^=$baseUrl]"
|
||||||
|
|
||||||
|
@ -52,7 +55,7 @@ abstract class Gattsu(
|
||||||
setUrlWithoutDomain(element.attr("href"))
|
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 {
|
override fun searchMangaRequest(page: Int, query: String, filters: FilterList): Request {
|
||||||
val searchUrl = "$baseUrl/page/$page/".toHttpUrlOrNull()!!.newBuilder()
|
val searchUrl = "$baseUrl/page/$page/".toHttpUrlOrNull()!!.newBuilder()
|
||||||
|
@ -67,7 +70,7 @@ abstract class Gattsu(
|
||||||
|
|
||||||
override fun searchMangaFromElement(element: Element): SManga = latestUpdatesFromElement(element)
|
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 {
|
override fun mangaDetailsParse(document: Document): SManga = SManga.create().apply {
|
||||||
val postBox = document.select("div.meio div.post-box").first()!!
|
val postBox = document.select("div.meio div.post-box").first()!!
|
||||||
|
|
|
@ -9,7 +9,7 @@ class GattsuGenerator : ThemeSourceGenerator {
|
||||||
|
|
||||||
override val themeClass = "Gattsu"
|
override val themeClass = "Gattsu"
|
||||||
|
|
||||||
override val baseVersionCode: Int = 2
|
override val baseVersionCode: Int = 3
|
||||||
|
|
||||||
override val sources = listOf(
|
override val sources = listOf(
|
||||||
SingleLang("Hentai Season", "https://hentaiseason.com", "pt-BR", isNsfw = true),
|
SingleLang("Hentai Season", "https://hentaiseason.com", "pt-BR", isNsfw = true),
|
||||||
|
|
Loading…
Reference in New Issue