|
|
|
@ -1,5 +1,6 @@
|
|
|
|
package org.koitharu.kotatsu.parsers.site.vi
|
|
|
|
package org.koitharu.kotatsu.parsers.site.vi
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import okhttp3.Headers
|
|
|
|
import org.jsoup.nodes.Document
|
|
|
|
import org.jsoup.nodes.Document
|
|
|
|
import org.koitharu.kotatsu.parsers.MangaLoaderContext
|
|
|
|
import org.koitharu.kotatsu.parsers.MangaLoaderContext
|
|
|
|
import org.koitharu.kotatsu.parsers.MangaSourceParser
|
|
|
|
import org.koitharu.kotatsu.parsers.MangaSourceParser
|
|
|
|
@ -17,7 +18,7 @@ import java.util.*
|
|
|
|
internal class DamCoNuong(context: MangaLoaderContext) :
|
|
|
|
internal class DamCoNuong(context: MangaLoaderContext) :
|
|
|
|
LegacyPagedMangaParser(context, MangaParserSource.DAMCONUONG, 30) {
|
|
|
|
LegacyPagedMangaParser(context, MangaParserSource.DAMCONUONG, 30) {
|
|
|
|
|
|
|
|
|
|
|
|
override val configKeyDomain = ConfigKey.Domain("damconuong.fit")
|
|
|
|
override val configKeyDomain = ConfigKey.Domain("damconuong.love", "damconuong.cc")
|
|
|
|
|
|
|
|
|
|
|
|
private val availableTags = suspendLazy(initializer = ::fetchTags)
|
|
|
|
private val availableTags = suspendLazy(initializer = ::fetchTags)
|
|
|
|
|
|
|
|
|
|
|
|
@ -26,6 +27,10 @@ internal class DamCoNuong(context: MangaLoaderContext) :
|
|
|
|
keys.add(userAgentKey)
|
|
|
|
keys.add(userAgentKey)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
override fun getRequestHeaders(): Headers = Headers.Builder()
|
|
|
|
|
|
|
|
.add("referer", "https://$domain")
|
|
|
|
|
|
|
|
.build()
|
|
|
|
|
|
|
|
|
|
|
|
override val availableSortOrders: Set<SortOrder> = EnumSet.of(
|
|
|
|
override val availableSortOrders: Set<SortOrder> = EnumSet.of(
|
|
|
|
SortOrder.ALPHABETICAL,
|
|
|
|
SortOrder.ALPHABETICAL,
|
|
|
|
SortOrder.ALPHABETICAL_DESC,
|
|
|
|
SortOrder.ALPHABETICAL_DESC,
|
|
|
|
@ -101,7 +106,9 @@ internal class DamCoNuong(context: MangaLoaderContext) :
|
|
|
|
val mainA = element.selectFirstOrThrow("div.relative a")
|
|
|
|
val mainA = element.selectFirstOrThrow("div.relative a")
|
|
|
|
val href = mainA.attrAsRelativeUrl("href")
|
|
|
|
val href = mainA.attrAsRelativeUrl("href")
|
|
|
|
val title = element.selectFirst("div.latest-chapter a.text-white.capitalize")?.textOrNull() ?: "No name"
|
|
|
|
val title = element.selectFirst("div.latest-chapter a.text-white.capitalize")?.textOrNull() ?: "No name"
|
|
|
|
val coverUrl = element.selectFirst("img.rounded-t-lg.cover.lazyload")?.src()
|
|
|
|
val coverUrl = element.selectFirst("img.rounded-t-lg.cover.lazyload")?.let { img ->
|
|
|
|
|
|
|
|
img.attr("data-src").takeUnless { it.isNullOrEmpty() } ?: img.requireSrc()
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Manga(
|
|
|
|
Manga(
|
|
|
|
id = generateUid(href),
|
|
|
|
id = generateUid(href),
|
|
|
|
@ -171,7 +178,8 @@ internal class DamCoNuong(context: MangaLoaderContext) :
|
|
|
|
override suspend fun getPages(chapter: MangaChapter): List<MangaPage> {
|
|
|
|
override suspend fun getPages(chapter: MangaChapter): List<MangaPage> {
|
|
|
|
val doc = webClient.httpGet(chapter.url.toAbsoluteUrl(domain)).parseHtml()
|
|
|
|
val doc = webClient.httpGet(chapter.url.toAbsoluteUrl(domain)).parseHtml()
|
|
|
|
return doc.select("div.text-center img.max-w-full.my-0.mx-auto").map { img ->
|
|
|
|
return doc.select("div.text-center img.max-w-full.my-0.mx-auto").map { img ->
|
|
|
|
val url = img.requireSrc()
|
|
|
|
val url = img.attr("src") ?: img.attr("data-src")
|
|
|
|
|
|
|
|
?: throw ParseException("Image src not found!", chapter.url)
|
|
|
|
MangaPage(
|
|
|
|
MangaPage(
|
|
|
|
id = generateUid(url),
|
|
|
|
id = generateUid(url),
|
|
|
|
url = url,
|
|
|
|
url = url,
|
|
|
|
|