diff --git a/multisrc/overrides/madara/huntersscans/res/mipmap-hdpi/ic_launcher.png b/multisrc/overrides/madara/huntersscans/res/mipmap-hdpi/ic_launcher.png new file mode 100644 index 000000000..731091352 Binary files /dev/null and b/multisrc/overrides/madara/huntersscans/res/mipmap-hdpi/ic_launcher.png differ diff --git a/multisrc/overrides/madara/huntersscans/res/mipmap-mdpi/ic_launcher.png b/multisrc/overrides/madara/huntersscans/res/mipmap-mdpi/ic_launcher.png new file mode 100644 index 000000000..3e0d81221 Binary files /dev/null and b/multisrc/overrides/madara/huntersscans/res/mipmap-mdpi/ic_launcher.png differ diff --git a/multisrc/overrides/madara/huntersscans/res/mipmap-xhdpi/ic_launcher.png b/multisrc/overrides/madara/huntersscans/res/mipmap-xhdpi/ic_launcher.png new file mode 100644 index 000000000..ffc5fd81c Binary files /dev/null and b/multisrc/overrides/madara/huntersscans/res/mipmap-xhdpi/ic_launcher.png differ diff --git a/multisrc/overrides/madara/huntersscans/res/mipmap-xxhdpi/ic_launcher.png b/multisrc/overrides/madara/huntersscans/res/mipmap-xxhdpi/ic_launcher.png new file mode 100644 index 000000000..f5307cdfa Binary files /dev/null and b/multisrc/overrides/madara/huntersscans/res/mipmap-xxhdpi/ic_launcher.png differ diff --git a/multisrc/overrides/madara/huntersscans/res/mipmap-xxxhdpi/ic_launcher.png b/multisrc/overrides/madara/huntersscans/res/mipmap-xxxhdpi/ic_launcher.png new file mode 100644 index 000000000..3faad563b Binary files /dev/null and b/multisrc/overrides/madara/huntersscans/res/mipmap-xxxhdpi/ic_launcher.png differ diff --git a/multisrc/overrides/madara/huntersscans/src/HuntersScans.kt b/multisrc/overrides/madara/huntersscans/src/HuntersScans.kt new file mode 100644 index 000000000..ce171501b --- /dev/null +++ b/multisrc/overrides/madara/huntersscans/src/HuntersScans.kt @@ -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") + } +} diff --git a/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/madara/MadaraGenerator.kt b/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/madara/MadaraGenerator.kt index 27d58f6d1..48f72576a 100644 --- a/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/madara/MadaraGenerator.kt +++ b/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/madara/MadaraGenerator.kt @@ -136,6 +136,7 @@ class MadaraGenerator : ThemeSourceGenerator { SingleLang("HM2D", "https://mangadistrict.com/hdoujin", "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),