|
|
|
|
@ -125,9 +125,8 @@ internal class viHentai(context: MangaLoaderContext) : PagedMangaParser(context,
|
|
|
|
|
return doc.select("div.grid div.relative").map { div ->
|
|
|
|
|
val href = div.selectFirst("a[href^=/truyen/]")?.attrOrNull("href")
|
|
|
|
|
?: div.parseFailed("Không thể tìm thấy nguồn ảnh của Manga này!")
|
|
|
|
|
val coverUrl = div.selectFirstOrThrow("div.cover").let {
|
|
|
|
|
it.attrOrNull("data-bg") ?: it.attr("style").cssUrl()?.replace("s3.lxmanga.top", domain)
|
|
|
|
|
}.orEmpty()
|
|
|
|
|
val coverUrl = div.selectFirst("div.cover")?.attr("style")
|
|
|
|
|
?.substringAfter("url('")?.substringBefore("')")
|
|
|
|
|
|
|
|
|
|
Manga(
|
|
|
|
|
id = generateUid(href),
|
|
|
|
|
@ -137,7 +136,7 @@ internal class viHentai(context: MangaLoaderContext) : PagedMangaParser(context,
|
|
|
|
|
publicUrl = href.toAbsoluteUrl(domain),
|
|
|
|
|
rating = RATING_UNKNOWN,
|
|
|
|
|
isNsfw = true,
|
|
|
|
|
coverUrl = coverUrl,
|
|
|
|
|
coverUrl = coverUrl.orEmpty(),
|
|
|
|
|
tags = setOf(),
|
|
|
|
|
state = null,
|
|
|
|
|
author = null,
|
|
|
|
|
@ -190,22 +189,15 @@ internal class viHentai(context: MangaLoaderContext) : PagedMangaParser(context,
|
|
|
|
|
override suspend fun getPages(chapter: MangaChapter): List<MangaPage> {
|
|
|
|
|
val fullUrl = chapter.url.toAbsoluteUrl(domain)
|
|
|
|
|
val doc = webClient.httpGet(fullUrl).parseHtml()
|
|
|
|
|
return doc.select("div.text-center div.lazy")
|
|
|
|
|
.mapNotNull { div ->
|
|
|
|
|
val url = div.attr("data-src")
|
|
|
|
|
if (url.endsWith(".jpg", ignoreCase = true) ||
|
|
|
|
|
url.endsWith(".png", ignoreCase = true)
|
|
|
|
|
) {
|
|
|
|
|
MangaPage(
|
|
|
|
|
id = generateUid(url),
|
|
|
|
|
url = url,
|
|
|
|
|
preview = null,
|
|
|
|
|
source = source,
|
|
|
|
|
)
|
|
|
|
|
} else {
|
|
|
|
|
null
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return doc.select("div.text-center img.lazy").mapNotNull { img ->
|
|
|
|
|
val url = img.attr("data-src")
|
|
|
|
|
MangaPage(
|
|
|
|
|
id = generateUid(url),
|
|
|
|
|
url = url,
|
|
|
|
|
preview = null,
|
|
|
|
|
source = source,
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private fun parseDateTime(dateStr: String): Long = runCatching {
|
|
|
|
|
|