Mangahub: fix selectors (#15184)
This commit is contained in:
parent
466ce8d739
commit
cbf15b16f7
|
@ -114,7 +114,7 @@ abstract class MangaHub(
|
||||||
|
|
||||||
// search
|
// search
|
||||||
override fun searchMangaRequest(page: Int, query: String, filters: FilterList): Request {
|
override fun searchMangaRequest(page: Int, query: String, filters: FilterList): Request {
|
||||||
var url = "$baseUrl/search/page/$page".toHttpUrlOrNull()!!.newBuilder()
|
val url = "$baseUrl/search/page/$page".toHttpUrlOrNull()!!.newBuilder()
|
||||||
url.addQueryParameter("q", query)
|
url.addQueryParameter("q", query)
|
||||||
(if (filters.isEmpty()) getFilterList() else filters).forEach { filter ->
|
(if (filters.isEmpty()) getFilterList() else filters).forEach { filter ->
|
||||||
when (filter) {
|
when (filter) {
|
||||||
|
@ -126,6 +126,7 @@ abstract class MangaHub(
|
||||||
val genre = filter.values[filter.state]
|
val genre = filter.values[filter.state]
|
||||||
url.addQueryParameter("genre", genre.key)
|
url.addQueryParameter("genre", genre.key)
|
||||||
}
|
}
|
||||||
|
else -> {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return GET(url.toString(), headers)
|
return GET(url.toString(), headers)
|
||||||
|
@ -157,7 +158,7 @@ abstract class MangaHub(
|
||||||
values.minByOrNull { it.url.length }!!
|
values.minByOrNull { it.url.length }!!
|
||||||
}.values.toList()
|
}.values.toList()
|
||||||
|
|
||||||
val hasNextPage = searchMangaNextPageSelector()?.let { selector ->
|
val hasNextPage = searchMangaNextPageSelector().let { selector ->
|
||||||
document.select(selector).first()
|
document.select(selector).first()
|
||||||
} != null
|
} != null
|
||||||
|
|
||||||
|
@ -203,9 +204,9 @@ abstract class MangaHub(
|
||||||
|
|
||||||
override fun chapterFromElement(element: Element): SChapter {
|
override fun chapterFromElement(element: Element): SChapter {
|
||||||
val chapter = SChapter.create()
|
val chapter = SChapter.create()
|
||||||
chapter.setUrlWithoutDomain(element.select("a[href*='$baseUrl']").attr("href"))
|
chapter.setUrlWithoutDomain(element.select("a[href*='$baseUrl']").last().attr("href"))
|
||||||
|
|
||||||
val titleHeader = element.select(".text-secondary").first()
|
val titleHeader = element.select("._8Qtbo").first()
|
||||||
val number = titleHeader.select("._3D1SJ").first().text()
|
val number = titleHeader.select("._3D1SJ").first().text()
|
||||||
val title = titleHeader.select("._2IG5P").first().text()
|
val title = titleHeader.select("._2IG5P").first().text()
|
||||||
|
|
||||||
|
|
|
@ -9,7 +9,7 @@ class MangaHubGenerator : ThemeSourceGenerator {
|
||||||
|
|
||||||
override val themeClass = "MangaHub"
|
override val themeClass = "MangaHub"
|
||||||
|
|
||||||
override val baseVersionCode: Int = 12
|
override val baseVersionCode: Int = 13
|
||||||
|
|
||||||
override val sources = listOf(
|
override val sources = listOf(
|
||||||
// SingleLang("1Manga.co", "https://1manga.co", "en", isNsfw = true, className = "OneMangaCo"),
|
// SingleLang("1Manga.co", "https://1manga.co", "en", isNsfw = true, className = "OneMangaCo"),
|
||||||
|
|
Loading…
Reference in New Issue