Add three sources to Madara (#19096)
* Add MangasNoSekai * Remove comment * Use new chapter endpoint * Add RichtoScan * Change Locale * Add HouseMangas
After Width: | Height: | Size: 5.5 KiB |
After Width: | Height: | Size: 3.0 KiB |
After Width: | Height: | Size: 8.1 KiB |
After Width: | Height: | Size: 15 KiB |
After Width: | Height: | Size: 23 KiB |
After Width: | Height: | Size: 150 KiB |
|
@ -0,0 +1,61 @@
|
||||||
|
package eu.kanade.tachiyomi.extension.es.housemangas
|
||||||
|
|
||||||
|
import eu.kanade.tachiyomi.multisrc.madara.Madara
|
||||||
|
import eu.kanade.tachiyomi.network.POST
|
||||||
|
import eu.kanade.tachiyomi.network.interceptor.rateLimit
|
||||||
|
import okhttp3.FormBody
|
||||||
|
import okhttp3.Request
|
||||||
|
import java.text.SimpleDateFormat
|
||||||
|
import java.util.Locale
|
||||||
|
import java.util.concurrent.TimeUnit
|
||||||
|
|
||||||
|
class HouseMangas : Madara(
|
||||||
|
"HouseMangas",
|
||||||
|
"https://housemangas.com",
|
||||||
|
"es",
|
||||||
|
dateFormat = SimpleDateFormat("MMMM dd, yyyy", Locale("es")),
|
||||||
|
) {
|
||||||
|
override val client = super.client.newBuilder()
|
||||||
|
.rateLimit(2, 1, TimeUnit.SECONDS)
|
||||||
|
.build()
|
||||||
|
|
||||||
|
override val useNewChapterEndpoint = true
|
||||||
|
|
||||||
|
override fun popularMangaNextPageSelector() = "body:not(:has(.no-posts))"
|
||||||
|
|
||||||
|
override val mangaDetailsSelectorStatus = "div.post-content_item:contains(Estado) > div.summary-content"
|
||||||
|
|
||||||
|
private fun loadMoreRequest(page: Int, metaKey: String): Request {
|
||||||
|
val formBody = FormBody.Builder().apply {
|
||||||
|
add("action", "madara_load_more")
|
||||||
|
add("page", page.toString())
|
||||||
|
add("template", "madara-core/content/content-archive")
|
||||||
|
add("vars[paged]", "1")
|
||||||
|
add("vars[orderby]", "meta_value_num")
|
||||||
|
add("vars[template]", "archive")
|
||||||
|
add("vars[sidebar]", "right")
|
||||||
|
add("vars[post_type]", "wp-manga")
|
||||||
|
add("vars[post_status]", "publish")
|
||||||
|
add("vars[meta_key]", metaKey)
|
||||||
|
add("vars[order]", "desc")
|
||||||
|
add("vars[meta_query][relation]", "AND")
|
||||||
|
add("vars[manga_archives_item_layout]", "default")
|
||||||
|
}.build()
|
||||||
|
|
||||||
|
val xhrHeaders = headersBuilder()
|
||||||
|
.add("Content-Length", formBody.contentLength().toString())
|
||||||
|
.add("Content-Type", formBody.contentType().toString())
|
||||||
|
.add("X-Requested-With", "XMLHttpRequest")
|
||||||
|
.build()
|
||||||
|
|
||||||
|
return POST("$baseUrl/wp-admin/admin-ajax.php", xhrHeaders, formBody)
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun popularMangaRequest(page: Int): Request {
|
||||||
|
return loadMoreRequest(page - 1, "_wp_manga_views")
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun latestUpdatesRequest(page: Int): Request {
|
||||||
|
return loadMoreRequest(page - 1, "_latest_update")
|
||||||
|
}
|
||||||
|
}
|
After Width: | Height: | Size: 6.7 KiB |
After Width: | Height: | Size: 3.5 KiB |
After Width: | Height: | Size: 11 KiB |
After Width: | Height: | Size: 21 KiB |
After Width: | Height: | Size: 33 KiB |
After Width: | Height: | Size: 241 KiB |
|
@ -0,0 +1,96 @@
|
||||||
|
package eu.kanade.tachiyomi.extension.es.mangasnosekai
|
||||||
|
|
||||||
|
import eu.kanade.tachiyomi.multisrc.madara.Madara
|
||||||
|
import eu.kanade.tachiyomi.network.interceptor.rateLimitHost
|
||||||
|
import eu.kanade.tachiyomi.source.model.SManga
|
||||||
|
import okhttp3.HttpUrl.Companion.toHttpUrl
|
||||||
|
import org.jsoup.nodes.Document
|
||||||
|
import java.text.SimpleDateFormat
|
||||||
|
import java.util.Locale
|
||||||
|
|
||||||
|
class MangasNoSekai : Madara(
|
||||||
|
"Mangas No Sekai",
|
||||||
|
"https://mangasnosekai.com",
|
||||||
|
"es",
|
||||||
|
SimpleDateFormat("MMMM dd, yyyy", Locale("es")),
|
||||||
|
) {
|
||||||
|
override val client = super.client.newBuilder()
|
||||||
|
.rateLimitHost(baseUrl.toHttpUrl(), 2, 1)
|
||||||
|
.build()
|
||||||
|
|
||||||
|
override val useNewChapterEndpoint = true
|
||||||
|
|
||||||
|
override fun searchMangaNextPageSelector() = "nav.navigation a.next"
|
||||||
|
|
||||||
|
override val mangaDetailsSelectorTitle = "div.summary-content h1.titleManga"
|
||||||
|
override val mangaDetailsSelectorThumbnail = "div.tab-summary img.img-responsive"
|
||||||
|
override val mangaDetailsSelectorDescription = "div.summary-content div.artist-content"
|
||||||
|
override val mangaDetailsSelectorStatus = "div.summary-content ul.general-List li:has(span:contains(Estado))"
|
||||||
|
override val mangaDetailsSelectorAuthor = "div.summary-content ul.general-List li:has(span:contains(Autor))"
|
||||||
|
override val mangaDetailsSelectorArtist = "div.summary-content ul.general-List li:has(span:contains(Dibujante))"
|
||||||
|
override val seriesTypeSelector = "div.summary-content ul.general-List li:has(span:contains(Tipo))"
|
||||||
|
|
||||||
|
override fun mangaDetailsParse(document: Document): SManga {
|
||||||
|
val manga = SManga.create()
|
||||||
|
with(document) {
|
||||||
|
selectFirst(mangaDetailsSelectorTitle)?.let {
|
||||||
|
manga.title = it.ownText()
|
||||||
|
}
|
||||||
|
selectFirst(mangaDetailsSelectorAuthor)?.ownText()?.let {
|
||||||
|
manga.author = it
|
||||||
|
}
|
||||||
|
selectFirst(mangaDetailsSelectorArtist)?.ownText()?.let {
|
||||||
|
manga.artist = it
|
||||||
|
}
|
||||||
|
select(mangaDetailsSelectorDescription).let {
|
||||||
|
manga.description = it.text()
|
||||||
|
}
|
||||||
|
select(mangaDetailsSelectorThumbnail).first()?.let {
|
||||||
|
manga.thumbnail_url = imageFromElement(it)
|
||||||
|
}
|
||||||
|
selectFirst(mangaDetailsSelectorStatus)?.ownText()?.let {
|
||||||
|
manga.status = when (it) {
|
||||||
|
in completedStatusList -> SManga.COMPLETED
|
||||||
|
in ongoingStatusList -> SManga.ONGOING
|
||||||
|
in hiatusStatusList -> SManga.ON_HIATUS
|
||||||
|
in canceledStatusList -> SManga.CANCELLED
|
||||||
|
else -> SManga.UNKNOWN
|
||||||
|
}
|
||||||
|
}
|
||||||
|
val genres = select(mangaDetailsSelectorGenre)
|
||||||
|
.map { element -> element.text().lowercase(Locale.ROOT) }
|
||||||
|
.toMutableSet()
|
||||||
|
|
||||||
|
// add manga/manhwa/manhua thinggy to genre
|
||||||
|
document.select(seriesTypeSelector).firstOrNull()?.ownText()?.let {
|
||||||
|
if (it.isEmpty().not() && it.notUpdating() && it != "-" && genres.contains(it).not()) {
|
||||||
|
genres.add(it.lowercase(Locale.ROOT))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
manga.genre = genres.toList().joinToString(", ") { genre ->
|
||||||
|
genre.replaceFirstChar {
|
||||||
|
if (it.isLowerCase()) {
|
||||||
|
it.titlecase(
|
||||||
|
Locale.ROOT,
|
||||||
|
)
|
||||||
|
} else {
|
||||||
|
it.toString()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// add alternative name to manga description
|
||||||
|
document.select(altNameSelector).firstOrNull()?.ownText()?.let {
|
||||||
|
if (it.isBlank().not() && it.notUpdating()) {
|
||||||
|
manga.description = when {
|
||||||
|
manga.description.isNullOrBlank() -> altName + it
|
||||||
|
else -> manga.description + "\n\n$altName" + it
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return manga
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,59 @@
|
||||||
|
package eu.kanade.tachiyomi.extension.es.richtoscan
|
||||||
|
|
||||||
|
import eu.kanade.tachiyomi.multisrc.madara.Madara
|
||||||
|
import eu.kanade.tachiyomi.network.POST
|
||||||
|
import eu.kanade.tachiyomi.network.interceptor.rateLimit
|
||||||
|
import okhttp3.FormBody
|
||||||
|
import okhttp3.Request
|
||||||
|
import java.text.SimpleDateFormat
|
||||||
|
import java.util.Locale
|
||||||
|
import java.util.concurrent.TimeUnit
|
||||||
|
|
||||||
|
class RichtoScan : Madara(
|
||||||
|
"RichtoScan",
|
||||||
|
"https://richtoscan.com",
|
||||||
|
"es",
|
||||||
|
dateFormat = SimpleDateFormat("MMMM dd, yyyy", Locale.ROOT),
|
||||||
|
) {
|
||||||
|
override val client = super.client.newBuilder()
|
||||||
|
.rateLimit(2, 1, TimeUnit.SECONDS)
|
||||||
|
.build()
|
||||||
|
|
||||||
|
override val useNewChapterEndpoint = true
|
||||||
|
|
||||||
|
override fun popularMangaNextPageSelector() = "body:not(:has(.no-posts))"
|
||||||
|
|
||||||
|
private fun loadMoreRequest(page: Int, metaKey: String): Request {
|
||||||
|
val formBody = FormBody.Builder().apply {
|
||||||
|
add("action", "madara_load_more")
|
||||||
|
add("page", page.toString())
|
||||||
|
add("template", "madara-core/content/content-archive")
|
||||||
|
add("vars[paged]", "1")
|
||||||
|
add("vars[orderby]", "meta_value_num")
|
||||||
|
add("vars[template]", "archive")
|
||||||
|
add("vars[sidebar]", "right")
|
||||||
|
add("vars[post_type]", "wp-manga")
|
||||||
|
add("vars[post_status]", "publish")
|
||||||
|
add("vars[meta_key]", metaKey)
|
||||||
|
add("vars[order]", "desc")
|
||||||
|
add("vars[meta_query][relation]", "AND")
|
||||||
|
add("vars[manga_archives_item_layout]", "default")
|
||||||
|
}.build()
|
||||||
|
|
||||||
|
val xhrHeaders = headersBuilder()
|
||||||
|
.add("Content-Length", formBody.contentLength().toString())
|
||||||
|
.add("Content-Type", formBody.contentType().toString())
|
||||||
|
.add("X-Requested-With", "XMLHttpRequest")
|
||||||
|
.build()
|
||||||
|
|
||||||
|
return POST("$baseUrl/wp-admin/admin-ajax.php", xhrHeaders, formBody)
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun popularMangaRequest(page: Int): Request {
|
||||||
|
return loadMoreRequest(page - 1, "_wp_manga_views")
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun latestUpdatesRequest(page: Int): Request {
|
||||||
|
return loadMoreRequest(page - 1, "_latest_update")
|
||||||
|
}
|
||||||
|
}
|
|
@ -148,6 +148,7 @@ class MadaraGenerator : ThemeSourceGenerator {
|
||||||
SingleLang("Hizomanga", "https://hizomanga.com", "ar", overrideVersionCode = 1),
|
SingleLang("Hizomanga", "https://hizomanga.com", "ar", overrideVersionCode = 1),
|
||||||
SingleLang("HM2D", "https://mangadistrict.com/hdoujin", "en", isNsfw = true, overrideVersionCode = 1),
|
SingleLang("HM2D", "https://mangadistrict.com/hdoujin", "en", isNsfw = true, overrideVersionCode = 1),
|
||||||
SingleLang("hManhwa", "https://hmanhwa.com", "en", isNsfw = true, overrideVersionCode = 1),
|
SingleLang("hManhwa", "https://hmanhwa.com", "en", isNsfw = true, overrideVersionCode = 1),
|
||||||
|
SingleLang("HouseMangas", "https://housemangas.com", "es"),
|
||||||
SingleLang("Hreads", "https://hreads.net", "en", isNsfw = true, overrideVersionCode = 1),
|
SingleLang("Hreads", "https://hreads.net", "en", isNsfw = true, overrideVersionCode = 1),
|
||||||
SingleLang("I Love Manhwa", "https://ilovemanhwa.com", "en", isNsfw = true),
|
SingleLang("I Love Manhwa", "https://ilovemanhwa.com", "en", isNsfw = true),
|
||||||
SingleLang("Ikifeng", "https://ikifeng.com", "es", isNsfw = true),
|
SingleLang("Ikifeng", "https://ikifeng.com", "es", isNsfw = true),
|
||||||
|
@ -288,6 +289,7 @@ class MadaraGenerator : ThemeSourceGenerator {
|
||||||
SingleLang("MangaRosie", "https://mangarosie.in", "en", isNsfw = true),
|
SingleLang("MangaRosie", "https://mangarosie.in", "en", isNsfw = true),
|
||||||
SingleLang("MangaRuby.com", "https://mangaruby.com", "en", isNsfw = true, className = "MangaRubyCom"),
|
SingleLang("MangaRuby.com", "https://mangaruby.com", "en", isNsfw = true, className = "MangaRubyCom"),
|
||||||
SingleLang("Mangaryu", "https://mangaryu.com", "en", isNsfw = true),
|
SingleLang("Mangaryu", "https://mangaryu.com", "en", isNsfw = true),
|
||||||
|
SingleLang("Mangas No Sekai", "https://mangasnosekai.com", "es"),
|
||||||
SingleLang("Mangas Origines", "https://mangas-origines.xyz", "fr", isNsfw = true, overrideVersionCode = 4),
|
SingleLang("Mangas Origines", "https://mangas-origines.xyz", "fr", isNsfw = true, overrideVersionCode = 4),
|
||||||
SingleLang("Mangas-Origines.fr", "https://mangas-origines.fr", "fr", className = "MangasOriginesFr"),
|
SingleLang("Mangas-Origines.fr", "https://mangas-origines.fr", "fr", className = "MangasOriginesFr"),
|
||||||
SingleLang("MangaSco", "https://manhwasco.net", "en", overrideVersionCode = 2),
|
SingleLang("MangaSco", "https://manhwasco.net", "en", overrideVersionCode = 2),
|
||||||
|
@ -413,6 +415,7 @@ class MadaraGenerator : ThemeSourceGenerator {
|
||||||
SingleLang("ReadMangaFree", "https://readmangafree.net", "en", isNsfw = true),
|
SingleLang("ReadMangaFree", "https://readmangafree.net", "en", isNsfw = true),
|
||||||
SingleLang("ReadManhua", "https://readmanhua.net", "en", overrideVersionCode = 2),
|
SingleLang("ReadManhua", "https://readmanhua.net", "en", overrideVersionCode = 2),
|
||||||
SingleLang("Rh2PlusManga", "https://www.rh2plusmanga.com", "th", isNsfw = true, overrideVersionCode = 5),
|
SingleLang("Rh2PlusManga", "https://www.rh2plusmanga.com", "th", isNsfw = true, overrideVersionCode = 5),
|
||||||
|
SingleLang("RichtoScan", "https://richtoscan.com", "es"),
|
||||||
SingleLang("Rightdark Scan", "https://rightdark-scan.com", "es"),
|
SingleLang("Rightdark Scan", "https://rightdark-scan.com", "es"),
|
||||||
SingleLang("Rio2 Manga", "https://rio2manga.com", "en"),
|
SingleLang("Rio2 Manga", "https://rio2manga.com", "en"),
|
||||||
SingleLang("ROG Mangás", "https://rogmangas.com", "pt-BR", pkgName = "mangasoverall", className = "RogMangas", overrideVersionCode = 1),
|
SingleLang("ROG Mangás", "https://rogmangas.com", "pt-BR", pkgName = "mangasoverall", className = "RogMangas", overrideVersionCode = 1),
|
||||||
|
|