[mgo] fix chapter selector, fix mobile search (#15040)

* mgo: fix chapter list selector

* fix search on mobile ua

* bump version

* make mgo work properly with either desktop or mobile ua
This commit is contained in:
Vetle Ledaal 2023-01-20 15:58:02 +01:00 committed by GitHub
parent 622a1552cd
commit d6a6a0d74f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 8 deletions

View File

@ -5,7 +5,7 @@ ext {
extName = 'Mangago'
pkgNameSuffix = 'en.mangago'
extClass = '.Mangago'
extVersionCode = 10
extVersionCode = 11
isNsfw = true
}

View File

@ -143,33 +143,33 @@ class Mangago : ParsedHttpSource() {
return GET(url, headers)
}
override fun searchMangaSelector() = "$genreListingSelector, .pic_list .box"
override fun searchMangaSelector() = "$genreListingSelector, .pic_list > li"
override fun searchMangaFromElement(element: Element) = mangaFromElement(element)
override fun searchMangaNextPageSelector() = genreListingNextPageSelector
override fun mangaDetailsParse(document: Document) = SManga.create().apply {
title = document.selectFirst(".w-title h1").text()
document.getElementById("information").let {
title = it.selectFirst(".w-title h1").text()
thumbnail_url = it.selectFirst("img").attr("abs:src")
description = it.selectFirst(".manga_summary").text()
it.select(".manga_info li").forEach { el ->
when (el.selectFirst("b").text().trim().lowercase()) {
it.select(".manga_info li, .manga_right tr").forEach { el ->
when (el.selectFirst("b, label").text().lowercase()) {
"alternative:" -> description += "\n\n${el.text()}"
"status:" -> when (el.selectFirst("span").text().trim().lowercase()) {
"status:" -> status = when (el.selectFirst("span").text().lowercase()) {
"ongoing" -> SManga.ONGOING
"completed" -> SManga.COMPLETED
else -> SManga.UNKNOWN
}
"author(s):" -> author = el.select("a").joinToString { it.text() }
"author(s):", "author:" -> author = el.select("a").joinToString { it.text() }
"genre(s):" -> genre = el.select("a").joinToString { it.text() }
}
}
}
}
override fun chapterListSelector() = "table > tbody > tr"
override fun chapterListSelector() = "table#chapter_table > tbody > tr, table.uk-table > tbody > tr"
override fun chapterFromElement(element: Element) = SChapter.create().apply {
val link = element.getElementsByTag("a")