Babel Wuxia (#17610)

* Babel Wuxia: move to Madara

* versionid
This commit is contained in:
AwkwardPeak7 2023-08-20 20:23:20 +05:00 committed by GitHub
parent 8d37adf0c2
commit a4cc989c8f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 57 additions and 1 deletions

View File

Before

Width:  |  Height:  |  Size: 98 KiB

After

Width:  |  Height:  |  Size: 98 KiB

View File

@ -0,0 +1,56 @@
package eu.kanade.tachiyomi.extension.en.babelwuxia
import eu.kanade.tachiyomi.multisrc.madara.Madara
import eu.kanade.tachiyomi.network.POST
import okhttp3.FormBody
import okhttp3.Request
class BabelWuxia : Madara("Babel Wuxia", "https://read.babelwuxia.com", "en") {
// moved from MangaThemesia
override val versionId = 2
override val useNewChapterEndpoint = true
override fun popularMangaNextPageSelector() = "body:not(:has(.no-posts))"
private fun madaraLoadMoreRequest(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[meta_query][0][paged]", "1")
add("vars[meta_query][0][orderby]", "meta_value_num")
add("vars[meta_query][0][template]", "archive")
add("vars[meta_query][0][sidebar]", "right")
add("vars[meta_query][0][post_type]", "wp-manga")
add("vars[meta_query][0][post_status]", "publish")
add("vars[meta_query][0][meta_key]", metaKey)
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 madaraLoadMoreRequest(page - 1, "_wp_manga_views")
}
override fun latestUpdatesRequest(page: Int): Request {
return madaraLoadMoreRequest(page - 1, "_latest_update")
}
}

View File

@ -52,6 +52,7 @@ class MadaraGenerator : ThemeSourceGenerator {
SingleLang("Atikrost", "https://atikrost.com", "tr", overrideVersionCode = 1),
SingleLang("AZManhwa", "https://azmanhwa.net", "en"),
SingleLang("Azora", "https://azoranov.com", "ar", overrideVersionCode = 6),
SingleLang("Babel Wuxia", "https://read.babelwuxia.com", "en"),
SingleLang("Bakaman", "https://bakaman.net", "th", overrideVersionCode = 1),
SingleLang("Banana Cítrica", "https://bananacitrica.com", "pt-BR", isNsfw = true, pkgName = "bananamecanica", className = "BananaCitrica", overrideVersionCode = 4),
SingleLang("Banana Manga", "https://bananamanga.net", "en", isNsfw = true),

View File

@ -22,7 +22,6 @@ class MangaThemesiaGenerator : ThemeSourceGenerator {
SingleLang("Arena Scans", "https://arenascans.net", "en", overrideVersionCode = 1),
SingleLang("Arkham Scan", "https://arkhamscan.com", "pt-BR"),
SingleLang("Azure Scans", "https://azuremanga.com", "en", overrideVersionCode = 1),
SingleLang("Babel Wuxia", "https://babelwuxia.com", "en", overrideVersionCode = 1),
SingleLang("Banana-Scan", "https://banana-scan.com", "fr", className = "BananaScan", isNsfw = true),
SingleLang("Beast Scans", "https://beast-scans.com", "ar"),
SingleLang("Boosei", "https://boosei.net", "id", overrideVersionCode = 2),