Komikcast: fix broken pagination (#13280)

* fix: latest update pagination & popular page

* update overrideVersionCode

* Apply suggestions from code review

Co-authored-by: Alessandro Jean <14254807+alessandrojean@users.noreply.github.com>

* remove slash to fix 301 redirect

Co-authored-by: Aris <maris@pmintl.net>
Co-authored-by: Alessandro Jean <14254807+alessandrojean@users.noreply.github.com>
This commit is contained in:
Muhamad Aris 2022-09-02 04:55:04 +07:00 committed by GitHub
parent 8d2c252e46
commit 8f0a4c8903
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 2 deletions

View File

@ -17,7 +17,7 @@ import java.util.concurrent.TimeUnit
class KomikCast : MangaThemesia(
"Komik Cast",
"https://komikcast.me",
baseUrl = "https://komikcast.me",
"id",
mangaUrlDirectory = "/daftar-komik"
) {
@ -45,6 +45,15 @@ class KomikCast : MangaThemesia(
return GET(page.imageUrl!!, newHeaders)
}
override fun popularMangaRequest(page: Int) = customPageRequest(page, "orderby", "popular")
override fun latestUpdatesRequest(page: Int) = customPageRequest(page, "sortby", "update")
private fun customPageRequest(page: Int, filterKey: String, filterValue: String): Request {
val pagePath = if (page > 1) "page/$page/" else ""
return GET("$baseUrl$mangaUrlDirectory/$pagePath?$filterKey=$filterValue", headers)
}
override fun searchMangaSelector() = "div.list-update_item"
override fun searchMangaFromElement(element: Element) = super.searchMangaFromElement(element).apply {

View File

@ -39,7 +39,7 @@ class MangaThemesiaGenerator : ThemeSourceGenerator {
SingleLang("Kiryuu", "https://kiryuu.id", "id", overrideVersionCode = 6),
SingleLang("KlanKomik", "https://klankomik.com", "id", overrideVersionCode = 1),
SingleLang("Komik AV", "https://komikav.com", "id", overrideVersionCode = 1),
SingleLang("Komik Cast", "https://komikcast.me", "id", overrideVersionCode = 12),
SingleLang("Komik Cast", "https://komikcast.me", "id", overrideVersionCode = 13),
SingleLang("Komik Lab", "https://komiklab.com", "id"),
SingleLang("Komik Station", "https://komikstation.co", "id", overrideVersionCode = 3),
SingleLang("KomikIndo.co", "https://komikindo.co", "id", className = "KomikindoCo", overrideVersionCode = 3),