correction

pull/252/head
devi 3 years ago
parent d805b49a4d
commit a24dfde1ba

@ -114,7 +114,7 @@ internal abstract class FoolSlideParser(
manga.copy( manga.copy(
tags = emptySet(), tags = emptySet(),
coverUrl = doc.selectFirst(".thumbnail img")?.src().orEmpty(),// for manga result on search coverUrl = doc.selectFirst(".thumbnail img")?.src() ?: manga.coverUrl,
description = desc, description = desc,
altTitle = null, altTitle = null,
author = author, author = author,

@ -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")
}
} }

@ -39,8 +39,7 @@ internal class Seinagi(context: MangaLoaderContext) :
} }
manga.copy( manga.copy(
tags = emptySet(), coverUrl = doc.selectFirst(".thumbnail img")?.src() ?: manga.coverUrl,
coverUrl = doc.selectFirst(".thumbnail img")?.src().orEmpty(),// for manga result on search
description = desc, description = desc,
altTitle = null, altTitle = null,
author = author, author = author,

@ -38,7 +38,7 @@ internal class Pzykosis666hFansub(context: MangaLoaderContext) :
manga.copy( manga.copy(
tags = emptySet(), tags = emptySet(),
coverUrl = doc.selectFirst(".thumbnail img")?.src().orEmpty(),// for manga result on search coverUrl = doc.selectFirst(".thumbnail img")?.src() ?: manga.coverUrl,
description = desc, description = desc,
altTitle = null, altTitle = null,
author = author, author = author,

@ -44,7 +44,6 @@ internal class SeinagiAdulto(context: MangaLoaderContext) :
} }
manga.copy( manga.copy(
tags = emptySet(),
coverUrl = doc.selectFirst(".thumbnail img")?.src().orEmpty(),// for manga result on search coverUrl = doc.selectFirst(".thumbnail img")?.src().orEmpty(),// for manga result on search
description = desc, description = desc,
altTitle = null, altTitle = null,

@ -117,7 +117,7 @@ internal class Manhwa18Cc(context: MangaLoaderContext) :
val doc = webClient.httpGet(fullUrl).parseHtml() val doc = webClient.httpGet(fullUrl).parseHtml()
val root = doc.body().selectFirstOrThrow(selectBodyPage) val root = doc.body().selectFirstOrThrow(selectBodyPage)
return root.select("img").map { img -> return root.select("img").map { img ->
val url = img.src().orEmpty() val url = img.src() ?: img.parseFailed("Image src not found")
MangaPage( MangaPage(
id = generateUid(url), id = generateUid(url),
url = url, url = url,

@ -90,8 +90,8 @@ internal class InstaManhwa(context: MangaLoaderContext) :
author = summary?.selectFirst(".mg_author")?.selectFirst("a")?.ownText(), author = summary?.selectFirst(".mg_author")?.selectFirst("a")?.ownText(),
state = when (summary?.selectFirst(".mg_status")?.selectFirst(".summary-content")?.ownText()?.trim() state = when (summary?.selectFirst(".mg_status")?.selectFirst(".summary-content")?.ownText()?.trim()
?.lowercase()) { ?.lowercase()) {
"Ongoing" -> MangaState.ONGOING "ongoing" -> MangaState.ONGOING
"Completed " -> MangaState.FINISHED "completed " -> MangaState.FINISHED
else -> null else -> null
}, },
source = source, source = source,

@ -65,7 +65,7 @@ internal class TmoManga(context: MangaLoaderContext) :
val doc = webClient.httpGet(url).parseHtml() val doc = webClient.httpGet(url).parseHtml()
return doc.select("div.page-item-detail").map { div -> return doc.select("div.page-item-detail").map { div ->
val href = div.selectFirst("a")?.attrAsRelativeUrlOrNull("href") ?: div.parseFailed("Link not found") val href = div.selectFirstOrThrow("a").attrAsRelativeUrl("href")
Manga( Manga(
id = generateUid(href), id = generateUid(href),
url = href, url = href,
@ -85,8 +85,8 @@ internal class TmoManga(context: MangaLoaderContext) :
override suspend fun getChapters(manga: Manga, doc: Document): List<MangaChapter> { override suspend fun getChapters(manga: Manga, doc: Document): List<MangaChapter> {
return doc.body().select(selectChapter).mapChapters(reversed = true) { i, li -> return doc.body().select(selectChapter).mapChapters(reversed = true) { i, li ->
val a = li.selectFirst("a") val a = li.selectFirstOrThrow("a")
val href = a?.attrAsRelativeUrlOrNull("href") ?: li.parseFailed("Link is missing") val href = a.attrAsRelativeUrl("href")
val link = href + stylepage val link = href + stylepage
val name = a.selectFirst("p")?.text() ?: a.ownText() val name = a.selectFirst("p")?.text() ?: a.ownText()
MangaChapter( MangaChapter(

@ -18,8 +18,8 @@ internal class TitanManga(context: MangaLoaderContext) :
val url = mangaUrl.toAbsoluteUrl(domain).removeSuffix('/') + "/ajax/chapters/" val url = mangaUrl.toAbsoluteUrl(domain).removeSuffix('/') + "/ajax/chapters/"
val doc = webClient.httpPost(url, emptyMap()).parseHtml() val doc = webClient.httpPost(url, emptyMap()).parseHtml()
return doc.select(selectChapter).mapChapters(reversed = true) { i, li -> return doc.select(selectChapter).mapChapters(reversed = true) { i, li ->
val a = li.selectFirst("a") val a = li.selectFirstOrThrow("a")
val href = a?.attrAsRelativeUrlOrNull("href") ?: li.parseFailed("Link is missing") val href = a.attrAsRelativeUrl("href")
val link = href + stylepage val link = href + stylepage
val name = a.selectFirst("p")?.text() ?: a.ownText() val name = a.selectFirst("p")?.text() ?: a.ownText()
MangaChapter( MangaChapter(

@ -23,7 +23,9 @@ internal class ManhuaScan(context: MangaLoaderContext) :
val url = buildString { val url = buildString {
append("https://") append("https://")
append(domain) append(domain)
append("/$listUrl?sort=") append('/')
append(listUrl)
append("?sort=")
when (sortOrder) { when (sortOrder) {
SortOrder.POPULARITY -> append("views") SortOrder.POPULARITY -> append("views")
SortOrder.UPDATED -> append("updated_at") SortOrder.UPDATED -> append("updated_at")
@ -84,19 +86,14 @@ internal class ManhuaScan(context: MangaLoaderContext) :
val script = docs.selectFirstOrThrow("script:containsData(var chapImages)") val script = docs.selectFirstOrThrow("script:containsData(var chapImages)")
val images = script.data().substringAfter("= \"").substringBefore("\";").split(",") val images = script.data().substringAfter("= \"").substringBefore("\";").split(",")
return images.map {
val pages = ArrayList<MangaPage>() MangaPage(
images.map { id = generateUid(it),
pages.add( url = it,
MangaPage( preview = null,
id = generateUid(it), source = source,
url = it,
preview = null,
source = source,
),
) )
} }
return pages
} }
} }

@ -18,7 +18,7 @@ internal class Constellarcomic(context: MangaLoaderContext) :
val url = element.selectFirst("a")?.attrAsRelativeUrl("href") ?: return@mapChapters null val url = element.selectFirst("a")?.attrAsRelativeUrl("href") ?: return@mapChapters null
MangaChapter( MangaChapter(
id = generateUid(url), id = generateUid(url),
name = element.selectFirst(".chapternum")?.text() ?: "Chapter ${index + 1}", name = element.selectFirst(".chapternum")?.textOrNull() ?: "Chapter ${index + 1}",
url = url, url = url,
number = index + 1, number = index + 1,
scanlator = null, scanlator = null,

@ -57,7 +57,7 @@ internal class TuManhwas(context: MangaLoaderContext) :
val url = element.selectFirst("a")?.attrAsRelativeUrl("href") ?: return@mapChapters null val url = element.selectFirst("a")?.attrAsRelativeUrl("href") ?: return@mapChapters null
MangaChapter( MangaChapter(
id = generateUid(url), id = generateUid(url),
name = element.selectFirst(".chapternum")?.text() ?: "Chapter ${index + 1}", name = element.selectFirst(".chapternum")?.textOrNull() ?: "Chapter ${index + 1}",
url = url, url = url,
number = index + 1, number = index + 1,
scanlator = null, scanlator = null,
@ -77,9 +77,9 @@ internal class TuManhwas(context: MangaLoaderContext) :
val stateSelect = docs.selectFirst(".tsinfo div:contains(Estado)") val stateSelect = docs.selectFirst(".tsinfo div:contains(Estado)")
val state = stateSelect?.lastElementChild() val state = stateSelect?.lastElementChild()
val mangaState = state?.let { val mangaState = state?.let {
when (it.text()) { when (it.text().lowercase()) {
"publishing" -> MangaState.ONGOING "publishing" -> MangaState.ONGOING
"Terminado" -> MangaState.FINISHED "terminado" -> MangaState.FINISHED
else -> null else -> null
} }
} }

@ -72,7 +72,7 @@ internal class Onma(context: MangaLoaderContext) :
return doc.select("div.manga-item").map { div -> return doc.select("div.manga-item").map { div ->
val href = div.selectFirstOrThrow("a").attrAsRelativeUrl("href") val href = div.selectFirstOrThrow("a").attrAsRelativeUrl("href")
val deeplink = href.substringAfterLast("/") val deeplink = href.substringAfterLast('/')
Manga( Manga(
id = generateUid(href), id = generateUid(href),
url = href, url = href,

Loading…
Cancel
Save