weebcentral: fix manga list & link resolving

master
AwkwardPeak7 1 year ago
parent 52b6f75dd0
commit b9fe35b8c3
No known key found for this signature in database

@ -1,6 +1,7 @@
package org.koitharu.kotatsu.parsers.site.en package org.koitharu.kotatsu.parsers.site.en
import kotlinx.coroutines.* import kotlinx.coroutines.*
import okhttp3.HttpUrl
import okhttp3.HttpUrl.Companion.toHttpUrl import okhttp3.HttpUrl.Companion.toHttpUrl
import org.jsoup.nodes.* import org.jsoup.nodes.*
import org.koitharu.kotatsu.parsers.* import org.koitharu.kotatsu.parsers.*
@ -169,7 +170,7 @@ internal class WeebCentral(context: MangaLoaderContext) : MangaParser(context, M
val document = webClient.httpGet(url).parseHtml() val document = webClient.httpGet(url).parseHtml()
return document.select("article:has(section)").map { element -> return document.select("article:has(section)").map { element ->
val mangaId = element.selectFirstOrThrow("div > a") val mangaId = element.selectFirstOrThrow("a")
.attrAsAbsoluteUrl("href") .attrAsAbsoluteUrl("href")
.toHttpUrl() .toHttpUrl()
.pathSegments[1] .pathSegments[1]
@ -177,7 +178,7 @@ internal class WeebCentral(context: MangaLoaderContext) : MangaParser(context, M
id = generateUid(mangaId), id = generateUid(mangaId),
url = mangaId, url = mangaId,
publicUrl = "https://$domain/series/$mangaId", publicUrl = "https://$domain/series/$mangaId",
title = element.selectFirstOrThrow("div > a").text(), title = element.selectFirstOrThrow("abbr[title] > a").text(),
altTitle = null, altTitle = null,
rating = RATING_UNKNOWN, rating = RATING_UNKNOWN,
contentRating = if (element.selectFirst("svg:has(style:containsData(ff0000))") == null) { contentRating = if (element.selectFirst("svg:has(style:containsData(ff0000))") == null) {
@ -273,7 +274,6 @@ internal class WeebCentral(context: MangaLoaderContext) : MangaParser(context, M
desc.append("<br><strong>Links:</strong>") desc.append("<br><strong>Links:</strong>")
desc.appendChild(ul) desc.appendChild(ul)
} }
}.outerHtml(), }.outerHtml(),
chapters = chapters.await(), chapters = chapters.await(),
source = source source = source
@ -340,4 +340,10 @@ internal class WeebCentral(context: MangaLoaderContext) : MangaParser(context, M
) )
} }
} }
override suspend fun resolveLink(resolver: LinkResolver, link: HttpUrl): Manga? {
val mangaId = link.pathSegments[1]
return resolver.resolveManga(this, mangaId)
}
} }

Loading…
Cancel
Save