|
|
|
@ -85,15 +85,26 @@ internal class ComXParser(context: MangaLoaderContext) :
|
|
|
|
val doc = webClient.httpGet(fullUrl).parseHtml()
|
|
|
|
val doc = webClient.httpGet(fullUrl).parseHtml()
|
|
|
|
return doc.select("div.readed.d-flex.short").map { item ->
|
|
|
|
return doc.select("div.readed.d-flex.short").map { item ->
|
|
|
|
val a = item.selectFirstOrThrow("a.readed__img.img-fit-cover.anim")
|
|
|
|
val a = item.selectFirstOrThrow("a.readed__img.img-fit-cover.anim")
|
|
|
|
val titleElement = item.selectFirstOrThrow("h3.readed__title a")
|
|
|
|
|
|
|
|
val img = item.selectFirst("img[data-src]")
|
|
|
|
val img = item.selectFirst("img[data-src]")
|
|
|
|
val href = a.attrAsRelativeUrl("href")
|
|
|
|
val href = a.attrAsRelativeUrl("href")
|
|
|
|
|
|
|
|
val titleElement = item.selectFirstOrThrow("h3.readed__title a")
|
|
|
|
|
|
|
|
val (mainTitle, altTitle) = titleElement.text()
|
|
|
|
|
|
|
|
.split("\\s*/\\s*".toRegex())
|
|
|
|
|
|
|
|
.map { it.trim() }
|
|
|
|
|
|
|
|
.let { parts ->
|
|
|
|
|
|
|
|
when {
|
|
|
|
|
|
|
|
parts.size >= 2 -> parts[1] to parts[0]
|
|
|
|
|
|
|
|
parts.isNotEmpty() -> parts[0] to ""
|
|
|
|
|
|
|
|
else -> "" to ""
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Manga(
|
|
|
|
Manga(
|
|
|
|
id = generateUid(href),
|
|
|
|
id = generateUid(href),
|
|
|
|
url = href,
|
|
|
|
url = href,
|
|
|
|
publicUrl = a.attrAsAbsoluteUrl("href"),
|
|
|
|
publicUrl = a.attrAsAbsoluteUrl("href"),
|
|
|
|
title = titleElement.text(),
|
|
|
|
title = mainTitle,
|
|
|
|
altTitles = emptySet(),
|
|
|
|
altTitles = if (altTitle.isNotEmpty()) setOf(altTitle) else emptySet(),
|
|
|
|
authors = emptySet(),
|
|
|
|
authors = emptySet(),
|
|
|
|
description = null,
|
|
|
|
description = null,
|
|
|
|
tags = emptySet(),
|
|
|
|
tags = emptySet(),
|
|
|
|
|