Add Manhuascan.us (#3965)

This commit is contained in:
Vetle Ledaal 2024-07-12 13:16:25 +02:00 committed by Draff
parent f99c22a81d
commit 9fb6efe03d
No known key found for this signature in database
GPG Key ID: E8A89F3211677653
7 changed files with 59 additions and 0 deletions

View File

@ -0,0 +1,10 @@
ext {
extName = 'Manhuascan.us'
extClass = '.ManhuascanUs'
themePkg = 'mangathemesia'
baseUrl = 'https://manhuascan.us'
overrideVersionCode = 0
isNsfw = true
}
apply from: "$rootDir/common.gradle"

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 KiB

View File

@ -0,0 +1,49 @@
package eu.kanade.tachiyomi.extension.en.manhuascanus
import eu.kanade.tachiyomi.multisrc.mangathemesia.MangaThemesia
import eu.kanade.tachiyomi.network.GET
import eu.kanade.tachiyomi.source.model.Filter
import eu.kanade.tachiyomi.source.model.FilterList
import okhttp3.HttpUrl.Companion.toHttpUrl
import okhttp3.Request
import java.text.SimpleDateFormat
import java.util.Locale
class ManhuascanUs : MangaThemesia(
"Manhuascan.us",
"https://manhuascan.us",
"en",
mangaUrlDirectory = "/manga-list",
dateFormat = SimpleDateFormat("dd-MM-yyyy", Locale.ROOT),
) {
override val seriesAuthorSelector = ".tsinfo .imptdt:contains(Author) a"
override fun searchMangaRequest(page: Int, query: String, filters: FilterList): Request {
val url = baseUrl.toHttpUrl().newBuilder()
.addPathSegment(mangaUrlDirectory.substring(1))
.addQueryParameter("search", query)
.addQueryParameter("page", page.toString())
filters.forEach { filter ->
when (filter) {
is OrderByFilter -> {
url.addQueryParameter("order", filter.selectedValue())
}
else -> { /* Do Nothing */ }
}
}
url.addPathSegment("")
return GET(url.build(), headers)
}
override fun getFilterList(): FilterList {
val orderByFilter = super.getFilterList().find { it is OrderByFilter } as? OrderByFilter
return FilterList(
Filter.Header("NOTE: Ignored if using text search!"),
Filter.Separator(),
orderByFilter!!,
)
}
}