Manhwa18.cc little fixes (#14225)

This commit is contained in:
Dexroneum 2022-11-13 19:43:48 +00:00 committed by GitHub
parent f8845b1fb9
commit 61b063a7c0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 24 additions and 21 deletions

View File

@ -20,34 +20,36 @@ class Manhwa18CcFactory : SourceFactory {
)
}
class Manhwa18CcEN : Manhwa18Cc("Manhwa18.cc", "https://manhwa18.cc", "en") {
override fun popularMangaSelector() = "div.manga-item:not(:contains(Raw))"
}
class Manhwa18CcKO : Manhwa18Cc("Manhwa18.cc", "https://manhwa18.cc", "ko") {
override fun popularMangaSelector() = "div.manga-item:contains(Raw)"
}
class Manhwa18CcALL : Manhwa18Cc("Manhwa18.cc", "https://manhwa18.cc", "all")
class Manhwa18CcEN : Manhwa18Cc("Manhwa18.cc", "https://manhwa18.cc", "en") {
override fun popularMangaSelector() = "div.manga-item:not(:has(h3 a[title$='Raw']))"
}
class Manhwa18CcKO : Manhwa18Cc("Manhwa18.cc", "https://manhwa18.cc", "ko") {
override fun popularMangaSelector() = "div.manga-item:has(h3 a[title$='Raw'])"
override fun popularMangaRequest(page: Int): Request = GET("$baseUrl/raw/$page")
}
abstract class Manhwa18Cc(
override val name: String,
override val baseUrl: String,
lang: String
lang: String,
) : Madara(name, baseUrl, lang, SimpleDateFormat("dd MMM yyyy", Locale.US)) {
override val useLoadMoreSearch = false
override val fetchGenres = false
override fun popularMangaSelector() = "div.manga-item"
override val popularMangaUrlSelector = "div.data > h3 > a"
override fun popularMangaNextPageSelector() = "ul.pagination > li > a"
override fun popularMangaRequest(page: Int): Request {
return GET("$baseUrl/webtoons/$page?orderby=trending")
}
override val popularMangaUrlSelector = "div.manga-item div.data a"
override fun latestUpdatesRequest(page: Int): Request {
return GET("$baseUrl/webtoons/$page?orderby=latest")
}
override fun popularMangaNextPageSelector() = "ul.pagination li.next a"
override fun popularMangaRequest(page: Int): Request = GET("$baseUrl/webtoons/$page?orderby=trending")
override fun latestUpdatesRequest(page: Int): Request = GET("$baseUrl/webtoons/$page?orderby=latest")
override fun searchMangaSelector() = popularMangaSelector()
@ -58,22 +60,23 @@ abstract class Manhwa18Cc(
override fun searchMangaRequest(page: Int, query: String, filters: FilterList): Request {
// After searching and go back to popular page, it always sent empty query thus display
// "No results found" message. So this fix redirect to popular page.
if (query.isBlank())
return popularMangaRequest(1)
if (query.isBlank()) return popularMangaRequest(page)
return GET("$baseUrl/search?q=$query&page=$page")
}
override val mangaSubString = "webtoon"
override fun chapterListSelector() = "li.wleft"
override val mangaDetailsSelectorDescription = "div.panel-story-description div.dsct"
override fun chapterListSelector() = "li.a-h"
override fun chapterDateSelector() = "span.chapter-time"
override val pageListParseSelector = "div.read-content img"
override fun pageListParse(document: Document): List<Page> {
return document.select(pageListParseSelector).mapIndexed { index, element ->
override fun pageListParse(document: Document): List<Page> = mutableListOf<Page>().apply {
document.select(pageListParseSelector).mapIndexed { index, element ->
Page(
index,
document.location(),

View File

@ -15,7 +15,7 @@ class MadaraGenerator : ThemeSourceGenerator {
override val sources = listOf(
MultiLang("Leviatan Scans", "https://leviatanscans.com", listOf("en", "es"), className = "LeviatanScansFactory", overrideVersionCode = 13),
MultiLang("MangaForFree.net", "https://mangaforfree.net", listOf("en", "ko", "all"), isNsfw = true, className = "MangaForFreeFactory", pkgName = "mangaforfree", overrideVersionCode = 1),
MultiLang("Manhwa18.cc", "https://manhwa18.cc", listOf("en", "ko", "all"), isNsfw = true, className = "Manhwa18CcFactory", pkgName = "manhwa18cc", overrideVersionCode = 2),
MultiLang("Manhwa18.cc", "https://manhwa18.cc", listOf("en", "ko", "all"), isNsfw = true, className = "Manhwa18CcFactory", pkgName = "manhwa18cc", overrideVersionCode = 3),
MultiLang("Olympus Scanlation", "https://olympusscanlation.com", listOf("es", "pt-BR")),
MultiLang("Reaper Scans", "https://reaperscans.com", listOf("fr", "id", "tr"), className = "ReaperScansFactory", pkgName = "reaperscans", overrideVersionCode = 11),
MultiLang("Seven King Scanlation", "https://sksubs.net", listOf("es", "en"), isNsfw = true),