|
|
|
@ -8,7 +8,6 @@ import org.koitharu.kotatsu.parsers.MangaSourceParser
|
|
|
|
import org.koitharu.kotatsu.parsers.model.*
|
|
|
|
import org.koitharu.kotatsu.parsers.model.*
|
|
|
|
import org.koitharu.kotatsu.parsers.site.foolslide.FoolSlideParser
|
|
|
|
import org.koitharu.kotatsu.parsers.site.foolslide.FoolSlideParser
|
|
|
|
import org.koitharu.kotatsu.parsers.util.*
|
|
|
|
import org.koitharu.kotatsu.parsers.util.*
|
|
|
|
import java.util.ArrayList
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@MangaSourceParser("ASSORTEDSCANS", "AssortedScans", "en")
|
|
|
|
@MangaSourceParser("ASSORTEDSCANS", "AssortedScans", "en")
|
|
|
|
@ -28,13 +27,17 @@ internal class AssortedScans(context: MangaLoaderContext) :
|
|
|
|
|
|
|
|
|
|
|
|
val doc = if (!query.isNullOrEmpty()) {
|
|
|
|
val doc = if (!query.isNullOrEmpty()) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (page > 1) {
|
|
|
|
|
|
|
|
return emptyList()
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
val url = buildString {
|
|
|
|
val url = buildString {
|
|
|
|
append("https://$domain/$searchUrl")
|
|
|
|
append("https://")
|
|
|
|
|
|
|
|
append(domain)
|
|
|
|
|
|
|
|
append('/')
|
|
|
|
|
|
|
|
append(searchUrl)
|
|
|
|
append("?q=")
|
|
|
|
append("?q=")
|
|
|
|
append(query.urlEncoded())
|
|
|
|
append(query.urlEncoded())
|
|
|
|
if (page > 1) {
|
|
|
|
|
|
|
|
return emptyList()
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
webClient.httpGet(url).parseHtml()
|
|
|
|
webClient.httpGet(url).parseHtml()
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
@ -87,8 +90,7 @@ internal class AssortedScans(context: MangaLoaderContext) :
|
|
|
|
val author = doc.getElementById("series-authors")?.selectFirst("div.author")?.text()
|
|
|
|
val author = doc.getElementById("series-authors")?.selectFirst("div.author")?.text()
|
|
|
|
val state = doc.getElementById("series-status")?.selectFirst("span")?.text()
|
|
|
|
val state = doc.getElementById("series-status")?.selectFirst("span")?.text()
|
|
|
|
manga.copy(
|
|
|
|
manga.copy(
|
|
|
|
tags = emptySet(),
|
|
|
|
coverUrl = doc.selectFirst(".cover")?.src() ?: manga.coverUrl,
|
|
|
|
coverUrl = doc.selectFirst(".cover")?.src().orEmpty(),// for manga result on search
|
|
|
|
|
|
|
|
description = desc,
|
|
|
|
description = desc,
|
|
|
|
altTitle = alt,
|
|
|
|
altTitle = alt,
|
|
|
|
author = author,
|
|
|
|
author = author,
|
|
|
|
@ -120,22 +122,23 @@ internal class AssortedScans(context: MangaLoaderContext) :
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
override suspend fun getPages(chapter: MangaChapter): List<MangaPage> {
|
|
|
|
override suspend fun getPages(chapter: MangaChapter): List<MangaPage> {
|
|
|
|
val chapterUrl = chapter.url.toAbsoluteUrl(domain)
|
|
|
|
val doc = webClient.httpGet(chapter.url.toAbsoluteUrl(domain)).parseHtml()
|
|
|
|
val docs = webClient.httpGet(chapterUrl).parseHtml()
|
|
|
|
return doc.body().select(".page-list .dropdown-list li a").map { a ->
|
|
|
|
val max = docs.selectFirstOrThrow(".curr-page input").attr("data-max").toInt() + 1
|
|
|
|
val url = a.attr("href").toRelativeUrl(domain)
|
|
|
|
val pages = ArrayList<MangaPage>(max)
|
|
|
|
MangaPage(
|
|
|
|
for (i in 1 until max) {
|
|
|
|
id = generateUid(url),
|
|
|
|
val pagesUrl = chapterUrl + i
|
|
|
|
url = url,
|
|
|
|
val page = webClient.httpGet(pagesUrl).parseHtml().requireElementById("page-image").attr("src")
|
|
|
|
preview = null,
|
|
|
|
pages.add(
|
|
|
|
source = source,
|
|
|
|
MangaPage(
|
|
|
|
|
|
|
|
id = generateUid(page),
|
|
|
|
|
|
|
|
url = page,
|
|
|
|
|
|
|
|
preview = null,
|
|
|
|
|
|
|
|
source = source,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
)
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return pages
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
override suspend fun getPageUrl(page: MangaPage): String {
|
|
|
|
|
|
|
|
val doc = webClient.httpGet(page.url.toAbsoluteUrl(domain)).parseHtml()
|
|
|
|
|
|
|
|
val root = doc.body()
|
|
|
|
|
|
|
|
return root.requireElementById("page-image").attr("src") ?: doc.parseFailed("Page image not found")
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|