Mihentai: remove custom page list parsing (#13678)
The URL modifications doesn't work after site changes, the default behavior works fine.
This commit is contained in:
parent
1d18a39a13
commit
1d0466670b
|
@ -2,44 +2,8 @@ package eu.kanade.tachiyomi.extension.all.mihentai
|
|||
|
||||
import eu.kanade.tachiyomi.multisrc.mangathemesia.MangaThemesia
|
||||
import eu.kanade.tachiyomi.source.model.FilterList
|
||||
import eu.kanade.tachiyomi.source.model.Page
|
||||
import kotlinx.serialization.json.jsonArray
|
||||
import kotlinx.serialization.json.jsonPrimitive
|
||||
import okhttp3.HttpUrl.Companion.toHttpUrl
|
||||
import org.jsoup.nodes.Document
|
||||
import java.lang.IllegalArgumentException
|
||||
|
||||
class Mihentai : MangaThemesia("Mihentai", "https://mihentai.com", "all") {
|
||||
override fun pageListParse(document: Document): List<Page> {
|
||||
val htmlPages = document.select(pageSelector)
|
||||
.filterNot { it.attr("abs:src").isNullOrEmpty() }
|
||||
.mapIndexed { i, img ->
|
||||
val pageUrl = img.attr("abs:src").substringAfter(baseUrl).prependIndent(baseUrl)
|
||||
Page(i, "", pageUrl)
|
||||
}
|
||||
.toMutableList()
|
||||
|
||||
countViews(document)
|
||||
|
||||
if (htmlPages.isNotEmpty()) { return htmlPages }
|
||||
|
||||
val docString = document.toString()
|
||||
val imageListJson = JSON_IMAGE_LIST_REGEX.find(docString)?.destructured?.toList()?.get(0).orEmpty()
|
||||
val imageList = try {
|
||||
json.parseToJsonElement(imageListJson).jsonArray
|
||||
} catch (_: IllegalArgumentException) {
|
||||
emptyList()
|
||||
}
|
||||
val baseResolver = baseUrl.toHttpUrl()
|
||||
|
||||
val scriptPages = imageList.mapIndexed { i, jsonEl ->
|
||||
val imageUrl = jsonEl.jsonPrimitive.content
|
||||
Page(i, "", baseResolver.resolve(imageUrl).toString())
|
||||
}
|
||||
|
||||
return scriptPages
|
||||
}
|
||||
|
||||
private class StatusFilter : SelectFilter(
|
||||
"Status",
|
||||
arrayOf(
|
||||
|
|
|
@ -75,7 +75,7 @@ class MangaThemesiaGenerator : ThemeSourceGenerator {
|
|||
SingleLang("Martial Manga", "https://martialmanga.com", "es"),
|
||||
SingleLang("MasterKomik", "https://masterkomik.com", "id", overrideVersionCode = 1),
|
||||
SingleLang("MELOKOMIK", "https://melokomik.xyz", "id"),
|
||||
SingleLang("Mihentai", "https://mihentai.com", "all", isNsfw = true, overrideVersionCode = 1),
|
||||
SingleLang("Mihentai", "https://mihentai.com", "all", isNsfw = true, overrideVersionCode = 2),
|
||||
SingleLang("Mode Scanlator", "https://modescanlator.com", "pt-BR", overrideVersionCode = 8),
|
||||
SingleLang("Nekomik", "https://nekomik.com", "id"),
|
||||
SingleLang("Ngomik", "https://ngomik.net", "id", overrideVersionCode = 1),
|
||||
|
|
Loading…
Reference in New Issue