Update GalleryAdults (#3416)

This commit is contained in:
Cuong M. Tran 2024-06-05 19:21:41 +07:00 committed by GitHub
parent 342486eac0
commit 43659aeaf6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 14 additions and 9 deletions

View File

@ -2,4 +2,4 @@ plugins {
id("lib-multisrc")
}
baseVersionCode = 1
baseVersionCode = 2

View File

@ -294,7 +294,7 @@ abstract class GalleryAdults(
val categoryFilters = filters.filterIsInstance<CategoryFilters>().firstOrNull()
// Only for query string or multiple tags
val url = "$baseUrl/search".toHttpUrl().newBuilder().apply {
val url = "$baseUrl/search/".toHttpUrl().newBuilder().apply {
getSortOrderURIs().forEachIndexed { index, pair ->
addQueryParameter(pair.second, toBinary(sortOrderFilter?.state == index))
}
@ -310,7 +310,7 @@ abstract class GalleryAdults(
addEncodedQueryParameter(intermediateSearchKey, buildQueryString(selectedGenres.map { it.name }, query))
addPageUri(page)
}
return GET(url.build())
return GET(url.build(), headers)
}
protected open val advancedSearchKey = "key"
@ -331,7 +331,7 @@ abstract class GalleryAdults(
// Advanced search
val advancedSearchFilters = filters.filterIsInstance<AdvancedTextFilter>()
val url = "$baseUrl/$advancedSearchUri".toHttpUrl().newBuilder().apply {
val url = "$baseUrl/$advancedSearchUri/".toHttpUrl().newBuilder().apply {
getSortOrderURIs().forEachIndexed { index, pair ->
addQueryParameter(pair.second, toBinary(sortOrderFilter?.state == index))
}
@ -379,7 +379,7 @@ abstract class GalleryAdults(
addEncodedQueryParameter(advancedSearchKey, keys.joinToString("+"))
addPageUri(page)
}
return GET(url.build())
return GET(url.build(), headers)
}
/**

View File

@ -18,6 +18,15 @@ class AsmHentai(
lang = lang,
) {
override val supportsLatest = mangaLang.isNotBlank()
override val supportSpeechless: Boolean = true
override fun Element.mangaLang() =
select("a:has(.flag)").attr("href")
.removeSuffix("/").substringAfterLast("/")
.let {
// Include Speechless in search results
if (it == LANGUAGE_SPEECHLESS) mangaLang else it
}
override fun Element.mangaUrl() =
selectFirst(".image a")?.attr("abs:href")
@ -25,10 +34,6 @@ class AsmHentai(
override fun Element.mangaThumbnail() =
selectFirst(".image img")?.imgAttr()
override fun Element.mangaLang() =
select("a:has(.flag)").attr("href")
.removeSuffix("/").substringAfterLast("/")
override fun popularMangaSelector() = ".preview_item"
override val favoritePath = "inc/user.php?act=favs"