mirror of
https://github.com/keiyoushi/extensions-source.git
synced 2024-11-25 11:42:47 +01:00
Add hunters scans (#355)
* Add hunters scans * reorder imports * reorder more imports...
This commit is contained in:
parent
1a3eb0f11b
commit
7d239d140b
Binary file not shown.
After Width: | Height: | Size: 5.2 KiB |
Binary file not shown.
After Width: | Height: | Size: 2.6 KiB |
Binary file not shown.
After Width: | Height: | Size: 8.5 KiB |
Binary file not shown.
After Width: | Height: | Size: 17 KiB |
Binary file not shown.
After Width: | Height: | Size: 29 KiB |
59
multisrc/overrides/madara/huntersscans/src/HuntersScans.kt
Normal file
59
multisrc/overrides/madara/huntersscans/src/HuntersScans.kt
Normal file
@ -0,0 +1,59 @@
|
||||
package eu.kanade.tachiyomi.extension.pt.huntersscans
|
||||
|
||||
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.OkHttpClient
|
||||
import okhttp3.Request
|
||||
import java.text.SimpleDateFormat
|
||||
import java.util.Locale
|
||||
import java.util.concurrent.TimeUnit
|
||||
|
||||
class HuntersScans : Madara(
|
||||
"Hunters Scan",
|
||||
"https://huntersscan.xyz/",
|
||||
"pt-BR",
|
||||
SimpleDateFormat("dd 'de' MMMMM 'de' yyyy", Locale("pt", "BR")),
|
||||
) {
|
||||
|
||||
override val client: OkHttpClient = super.client.newBuilder()
|
||||
.rateLimit(1, 2, TimeUnit.SECONDS)
|
||||
.build()
|
||||
|
||||
override val useNewChapterEndpoint = true
|
||||
|
||||
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("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("Hunters Scans", "https://huntersscan.xyz", "pt-BR", isNsfw = true),
|
||||
SingleLang("I Love Manhwa", "https://ilovemanhwa.com", "en", isNsfw = true),
|
||||
SingleLang("Illusion Scan", "https://illusionscan.com", "pt-BR", isNsfw = true),
|
||||
SingleLang("Immortal Updates", "https://immortalupdates.com", "en", overrideVersionCode = 6),
|
||||
|
Loading…
Reference in New Issue
Block a user