-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add hunters scans * reorder imports * reorder more imports...
- Loading branch information
1 parent
b9c5df4
commit 3273811
Showing
7 changed files
with
60 additions
and
0 deletions.
There are no files selected for viewing
Binary file added
BIN
+5.18 KB
multisrc/overrides/madara/huntersscans/res/mipmap-hdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+2.65 KB
multisrc/overrides/madara/huntersscans/res/mipmap-mdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+8.53 KB
multisrc/overrides/madara/huntersscans/res/mipmap-xhdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+17.3 KB
multisrc/overrides/madara/huntersscans/res/mipmap-xxhdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+28.7 KB
multisrc/overrides/madara/huntersscans/res/mipmap-xxxhdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
59 changes: 59 additions & 0 deletions
59
multisrc/overrides/madara/huntersscans/src/HuntersScans.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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") | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters