add alternative name, cleaning some code, add icon (#6484)
* MangaSee/Life: add alt name, cleaning add alternative name to manga description cleaning series type code * WPMangaReader: add alt name, cleaning add alternative name to manga description cleaning series type code * FMReader: add alt name add alternative name to manga description remove author name if its "Updating" * MangaPark: add alt name add alternative name to manga description * WPMangaStream: add alt name, cleaning add alternative name to manga description cleaning series type code * MangaBox: add alt name add alternative name to manga description * MaidManga: add alt name, cleaning add alternative name to manga description cleaning series type code * Komiku: cleaning code cleaning series type code * ManhuaID: cleaning code cleaning series type code * cleaning, tweaking * add 18+ * add some source icon in fmreader Co-Authored-By: Ankit Singh <as280093@gmail.com> * add some source icon in wpmangareader Co-Authored-By: Ankit Singh <as280093@gmail.com> * add some source icon in wpmangastream Co-Authored-By: Ankit Singh <as280093@gmail.com> * Ngomik: fix thumbnail and chapter images Co-authored-by: Ankit Singh <as280093@gmail.com>
This commit is contained in:
@ -159,14 +159,29 @@ abstract class FMReader(
|
||||
val infoElement = document.select("div.row").first()
|
||||
|
||||
return SManga.create().apply {
|
||||
author = infoElement.select("li a.btn-info").text()
|
||||
infoElement.select("li a.btn-info").text().let {
|
||||
if (it.contains("Updating", true).not()) author = it
|
||||
}
|
||||
genre = infoElement.select("li a.btn-danger").joinToString { it.text() }
|
||||
status = parseStatus(infoElement.select("li a.btn-success").first()?.text())
|
||||
description = document.select("div.detail .content, div.row ~ div.row:has(h3:first-child) p, .summary-content p").text().trim()
|
||||
thumbnail_url = infoElement.select("img.thumbnail").imgAttr()
|
||||
|
||||
// add alternative name to manga description
|
||||
infoElement.select(altNameSelector).firstOrNull()?.ownText()?.let {
|
||||
if (it.isEmpty().not() && it.contains("Updating", true).not()) {
|
||||
description += when {
|
||||
description!!.isEmpty() -> altName + it
|
||||
else -> "\n\n$altName" + it
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
open val altNameSelector = "li:contains(Other names)"
|
||||
open val altName = "Alternative Name" // the alt name already contains ": " eg. ": alt name1, alt name2"
|
||||
|
||||
// languages: en, vi, tr
|
||||
fun parseStatus(status: String?): Int {
|
||||
val completedWords = setOf("completed", "complete", "incomplete", "đã hoàn thành", "tamamlandı", "hoàn thành")
|
||||
|
@ -10,48 +10,23 @@ class FMReaderGenerator : ThemeSourceGenerator {
|
||||
|
||||
override val themeClass = "FMReader"
|
||||
|
||||
override val baseVersionCode: Int = 1
|
||||
override val baseVersionCode: Int = 2
|
||||
|
||||
/** For future sources: when testing and popularMangaRequest() returns a Jsoup error instead of results
|
||||
* most likely the fix is to override popularMangaNextPageSelector() */
|
||||
|
||||
override val sources = listOf(
|
||||
SingleLang(
|
||||
"18LHPlus",
|
||||
"https://18lhplus.com",
|
||||
"en",
|
||||
className = "EighteenLHPlus"
|
||||
),
|
||||
SingleLang("18LHPlus", "https://18lhplus.com", "en", className = "EighteenLHPlus"),
|
||||
SingleLang("Epik Manga", "https://www.epikmanga.com", "tr"),
|
||||
SingleLang(
|
||||
"HanaScan (RawQQ)",
|
||||
"https://hanascan.com",
|
||||
"ja",
|
||||
className = "HanaScanRawQQ"
|
||||
),
|
||||
SingleLang("HanaScan (RawQQ)", "https://hanascan.com", "ja", className = "HanaScanRawQQ"),
|
||||
SingleLang("HeroScan", "https://heroscan.com", "en"),
|
||||
SingleLang("KissLove", "https://kissaway.net", "ja"),
|
||||
SingleLang(
|
||||
"LHTranslation",
|
||||
"https://lhtranslation.net",
|
||||
"en",
|
||||
overrideVersionCode = 1
|
||||
),
|
||||
SingleLang("LHTranslation", "https://lhtranslation.net", "en", overrideVersionCode = 1),
|
||||
SingleLang("Manga-TR", "https://manga-tr.com", "tr", className = "MangaTR"),
|
||||
SingleLang("ManhuaScan", "https://manhuascan.com", "en"),
|
||||
SingleLang("Manhwa18", "https://manhwa18.com", "en"),
|
||||
MultiLang(
|
||||
"Manhwa18.net",
|
||||
"https://manhwa18.net",
|
||||
listOf("en", "ko"),
|
||||
className = "Manhwa18NetFactory"
|
||||
),
|
||||
SingleLang(
|
||||
"ManhwaSmut",
|
||||
"https://manhwasmut.com",
|
||||
"en",
|
||||
overrideVersionCode = 1
|
||||
),
|
||||
SingleLang("ManhuaScan", "https://manhuascan.com", "en", isNsfw = true),
|
||||
SingleLang("Manhwa18", "https://manhwa18.com", "en", isNsfw = true),
|
||||
MultiLang("Manhwa18.net", "https://manhwa18.net", listOf("en", "ko"), className = "Manhwa18NetFactory", isNsfw = true),
|
||||
SingleLang("ManhwaSmut", "https://manhwasmut.com", "en", isNsfw = true, overrideVersionCode = 1),
|
||||
SingleLang("RawLH", "https://lovehug.net", "ja"),
|
||||
SingleLang("Say Truyen", "https://saytruyen.com", "vi"),
|
||||
SingleLang("KSGroupScans", "https://ksgroupscans.com", "en"),
|
||||
|
@ -154,9 +154,22 @@ abstract class MangaBox(
|
||||
?.replace("""<\s*br\s*/?>""".toRegex(), "\n")
|
||||
?.replace("<[^>]*>".toRegex(), "")
|
||||
thumbnail_url = document.select(thumbnailSelector).attr("abs:src")
|
||||
|
||||
// add alternative name to manga description
|
||||
document.select(altNameSelector).firstOrNull()?.ownText()?.let {
|
||||
if (it.isEmpty().not()) {
|
||||
description += when {
|
||||
description!!.isEmpty() -> altName + it
|
||||
else -> "\n\n$altName" + it
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
open val altNameSelector = ".story-alternative, tr:has(.info-alternative) h2"
|
||||
open val altName = "Alternative Name" + ": "
|
||||
|
||||
private fun parseStatus(status: String?) = when {
|
||||
status == null -> SManga.UNKNOWN
|
||||
status.contains("Ongoing") -> SManga.ONGOING
|
||||
|
@ -9,7 +9,7 @@ class MangaBoxGenerator : ThemeSourceGenerator {
|
||||
|
||||
override val themeClass = "MangaBox"
|
||||
|
||||
override val baseVersionCode: Int = 1
|
||||
override val baseVersionCode: Int = 2
|
||||
|
||||
override val sources = listOf(
|
||||
SingleLang("Mangakakalot", "https://mangakakalot.com", "en"),
|
||||
|
@ -186,16 +186,33 @@ abstract class NepNep(
|
||||
SManga.create().apply {
|
||||
title = info.select("h1").text()
|
||||
author = info.select("li.list-group-item:has(span:contains(Author)) a").first()?.text()
|
||||
genre = info.select("li.list-group-item:has(span:contains(Genre)) a").joinToString { it.text() }
|
||||
status = info.select("li.list-group-item:has(span:contains(Status)) a:contains(scan)").text().toStatus()
|
||||
description = info.select("div.Content").text()
|
||||
thumbnail_url = info.select("img").attr("abs:src")
|
||||
|
||||
// add manga/manhwa/manhua thinggy to genre
|
||||
val type = info.select("li.list-group-item:has(span:contains(Type)) a, a[href*=type\\=]").firstOrNull()?.ownText()
|
||||
genre += if (genre!!.contains(type.toString(), true) || type == "-") ""
|
||||
else if (!type.isNullOrEmpty() && !genre.isNullOrEmpty()) ", $type"
|
||||
else if (!type.isNullOrEmpty() && genre.isNullOrEmpty()) "$type" else ""
|
||||
val genres = info.select("li.list-group-item:has(span:contains(Genre)) a")
|
||||
.map { element -> element.text() }
|
||||
.toMutableSet()
|
||||
|
||||
// add series type(manga/manhwa/manhua/other) thinggy to genre
|
||||
info.select("li.list-group-item:has(span:contains(Type)) a, a[href*=type\\=]").firstOrNull()?.ownText()?.let {
|
||||
if (it.isEmpty().not()) {
|
||||
genres.add(it)
|
||||
}
|
||||
}
|
||||
|
||||
genre = genres.toList().joinToString(", ")
|
||||
|
||||
// add alternative name to manga description
|
||||
val altName = "Alternative Name: "
|
||||
info.select("li.list-group-item:has(span:contains(Alter))").firstOrNull()?.ownText()?.let {
|
||||
if (it.isEmpty().not() && it !="N/A") {
|
||||
description += when {
|
||||
description!!.isEmpty() -> altName + it
|
||||
else -> "\n\n$altName" + it
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -9,7 +9,7 @@ class NepNepGenerator : ThemeSourceGenerator {
|
||||
|
||||
override val themeClass = "NepNep"
|
||||
|
||||
override val baseVersionCode: Int = 2
|
||||
override val baseVersionCode: Int = 3
|
||||
|
||||
override val sources = listOf(
|
||||
SingleLang("MangaSee", "https://mangasee123.com", "en", overrideVersionCode = 20),
|
||||
|
@ -30,12 +30,12 @@ abstract class WPMangaReader(
|
||||
override val client: OkHttpClient = network.cloudflareClient
|
||||
|
||||
// popular
|
||||
override fun popularMangaSelector() = ".utao .uta .imgu, .listupd .bs .bsx "
|
||||
override fun popularMangaSelector() = ".utao .uta .imgu, .listupd .bs .bsx, .listo .bs .bsx"
|
||||
|
||||
override fun popularMangaRequest(page: Int) = GET("$baseUrl$mangaUrlDirectory/?page=$page&order=popular", headers)
|
||||
|
||||
override fun popularMangaFromElement(element: Element) = SManga.create().apply {
|
||||
thumbnail_url = element.select("img").attr("src")
|
||||
thumbnail_url = element.select("img").attr("abs:src")
|
||||
title = element.select("a").attr("title")
|
||||
setUrlWithoutDomain(element.select("a").attr("href"))
|
||||
}
|
||||
@ -84,15 +84,31 @@ abstract class WPMangaReader(
|
||||
.text()
|
||||
)
|
||||
|
||||
thumbnail_url = document.select(".infomanga > div[itemprop=image] img, .thumb img").attr("src")
|
||||
thumbnail_url = document.select(".infomanga > div[itemprop=image] img, .thumb img").attr("abs:src")
|
||||
description = document.select(".desc, .entry-content[itemprop=description]").joinToString("\n") { it.text() }
|
||||
|
||||
// add series type(manga/manhwa/manhua/other) thinggy to genre
|
||||
val type = document.select("span:contains(Type) a, .imptdt:contains(Type) a, a[href*=type\\=], .infotable tr:contains(Type) td:last-child").firstOrNull()?.ownText()
|
||||
genre += if (genre!!.contains(type.toString())) "" else if (!type.isNullOrEmpty() && !genre.isNullOrEmpty()) ", $type"
|
||||
else if (!type.isNullOrEmpty() && genre.isNullOrEmpty()) "$type" else ""
|
||||
document.select(seriesTypeSelector).firstOrNull()?.ownText()?.let {
|
||||
if (it.isEmpty().not() && genre!!.contains(it, true).not()) {
|
||||
genre += if (genre!!.isEmpty()) it else ", $it"
|
||||
}
|
||||
}
|
||||
|
||||
// add alternative name to manga description
|
||||
document.select(altNameSelector).firstOrNull()?.ownText()?.let {
|
||||
if (it.isEmpty().not()) {
|
||||
description += when {
|
||||
description!!.isEmpty() -> altName + it
|
||||
else -> "\n\n$altName" + it
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
open val seriesTypeSelector = "span:contains(Type) a, .imptdt:contains(Type) a, a[href*=type\\=], .infotable tr:contains(Type) td:last-child"
|
||||
open val altNameSelector = ".alternative, .seriestualt"
|
||||
open val altName = "Alternative Name" + ": "
|
||||
|
||||
private fun parseStatus(status: String) = when {
|
||||
status.contains("Ongoing") -> SManga.ONGOING
|
||||
status.contains("Completed") -> SManga.COMPLETED
|
||||
|
@ -9,7 +9,7 @@ class WPMangaReaderGenerator : ThemeSourceGenerator {
|
||||
|
||||
override val themeClass = "WPMangaReader"
|
||||
|
||||
override val baseVersionCode: Int = 3
|
||||
override val baseVersionCode: Int = 4
|
||||
|
||||
override val sources = listOf(
|
||||
SingleLang("Hikari Scan", "https://hikariscan.com.br", "pt-BR", overrideVersionCode = 1),
|
||||
|
@ -165,21 +165,42 @@ abstract class WPMangaStream(
|
||||
override fun mangaDetailsParse(document: Document): SManga {
|
||||
return SManga.create().apply {
|
||||
document.select("div.bigcontent, div.animefull, div.main-info").firstOrNull()?.let { infoElement ->
|
||||
genre = infoElement.select("span:contains(Genre) a, .mgen a").joinToString { it.text() }
|
||||
status = parseStatus(infoElement.select("span:contains(Status:), .imptdt:contains(Status) i").firstOrNull()?.ownText())
|
||||
author = infoElement.select("span:contains(Author:), span:contains(Pengarang:), .fmed b:contains(Author)+span, .imptdt:contains(Author) i").firstOrNull()?.ownText()
|
||||
artist = infoElement.select(".fmed b:contains(Artist)+span, .imptdt:contains(Artist) i").firstOrNull()?.ownText()
|
||||
description = infoElement.select("div.desc p, div.entry-content p").joinToString("\n") { it.text() }
|
||||
thumbnail_url = infoElement.select("div.thumb img").imgAttr()
|
||||
|
||||
// add manga/manhwa/manhua thinggy to genre
|
||||
val type = document.select("span:contains(Type) a, .imptdt:contains(Type) a, a[href*=type\\=], .infotable tr:contains(Type) td:last-child").firstOrNull()?.ownText()
|
||||
genre += if (genre!!.contains(type.toString())) "" else if (!type.isNullOrEmpty() && !genre.isNullOrEmpty()) ", $type"
|
||||
else if (!type.isNullOrEmpty() && genre.isNullOrEmpty()) "$type" else ""
|
||||
val genres = infoElement.select("span:contains(Genre) a, .mgen a")
|
||||
.map { element -> element.text().toLowerCase() }
|
||||
.toMutableSet()
|
||||
|
||||
// add series type(manga/manhwa/manhua/other) thinggy to genre
|
||||
document.select(seriesTypeSelector).firstOrNull()?.ownText()?.let {
|
||||
if (it.isEmpty().not() && genres.contains(it).not()) {
|
||||
genres.add(it.toLowerCase())
|
||||
}
|
||||
}
|
||||
|
||||
genre = genres.toList().map { it.capitalize() }.joinToString(", ")
|
||||
|
||||
// add alternative name to manga description
|
||||
document.select(altNameSelector).firstOrNull()?.ownText()?.let {
|
||||
if (it.isEmpty().not() && it !="N/A" && it != "-") {
|
||||
description += when {
|
||||
description!!.isEmpty() -> altName + it
|
||||
else -> "\n\n$altName" + it
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
open val seriesTypeSelector = "span:contains(Type) a, .imptdt:contains(Type) a, a[href*=type\\=], .infotable tr:contains(Type) td:last-child"
|
||||
open val altNameSelector = ".alternative, .wd-full:contains(Alt) span, .alter, .seriestualt"
|
||||
open val altName = "Alternative Name" + ": "
|
||||
|
||||
protected fun parseStatus(element: String?): Int = when {
|
||||
element == null -> SManga.UNKNOWN
|
||||
listOf("ongoing", "publishing").any { it.contains(element, ignoreCase = true) } -> SManga.ONGOING
|
||||
|
@ -9,7 +9,7 @@ class WPMangaStreamGenerator : ThemeSourceGenerator {
|
||||
|
||||
override val themeClass = "WPMangaStream"
|
||||
|
||||
override val baseVersionCode: Int = 3
|
||||
override val baseVersionCode: Int = 4
|
||||
|
||||
override val sources = listOf(
|
||||
SingleLang("KlanKomik", "https://klankomik.com", "id"),
|
||||
|
Reference in New Issue
Block a user