|
|
|
|
@ -4,7 +4,6 @@ import org.jsoup.nodes.Element
|
|
|
|
|
import org.koitharu.kotatsu.parsers.MangaLoaderContext
|
|
|
|
|
import org.koitharu.kotatsu.parsers.MangaSourceParser
|
|
|
|
|
import org.koitharu.kotatsu.parsers.config.ConfigKey
|
|
|
|
|
import org.koitharu.kotatsu.parsers.exception.ParseException
|
|
|
|
|
import org.koitharu.kotatsu.parsers.model.MangaChapter
|
|
|
|
|
import org.koitharu.kotatsu.parsers.model.MangaPage
|
|
|
|
|
import org.koitharu.kotatsu.parsers.model.MangaSource
|
|
|
|
|
@ -13,6 +12,8 @@ import org.koitharu.kotatsu.parsers.util.domain
|
|
|
|
|
import org.koitharu.kotatsu.parsers.util.generateUid
|
|
|
|
|
import org.koitharu.kotatsu.parsers.util.parseFailed
|
|
|
|
|
import org.koitharu.kotatsu.parsers.util.parseHtml
|
|
|
|
|
import org.koitharu.kotatsu.parsers.util.requireElementById
|
|
|
|
|
import org.koitharu.kotatsu.parsers.util.selectFirstOrThrow
|
|
|
|
|
import org.koitharu.kotatsu.parsers.util.toAbsoluteUrl
|
|
|
|
|
import org.koitharu.kotatsu.parsers.util.toRelativeUrl
|
|
|
|
|
import java.text.SimpleDateFormat
|
|
|
|
|
@ -29,8 +30,7 @@ internal class LelManga(context: MangaLoaderContext) :
|
|
|
|
|
override suspend fun getPages(chapter: MangaChapter): List<MangaPage> {
|
|
|
|
|
val fullUrl = chapter.url.toAbsoluteUrl(domain)
|
|
|
|
|
val doc = webClient.httpGet(fullUrl).parseHtml()
|
|
|
|
|
val root = doc.body().selectFirst("div.maincontent")?.selectFirst("div#readerarea")
|
|
|
|
|
?: throw ParseException("Root not found", fullUrl)
|
|
|
|
|
val root = doc.body().selectFirstOrThrow("div.maincontent").requireElementById("readerarea")
|
|
|
|
|
return root.select("img").map { img ->
|
|
|
|
|
val url = img.src()?.toRelativeUrl(domain) ?: img.parseFailed("Image src not found")
|
|
|
|
|
MangaPage(
|
|
|
|
|
|