Mangago: support external chapters (#2171)

This commit is contained in:
Vetle Ledaal 2024-03-30 11:58:12 +00:00 committed by Draff
parent ec8c080c75
commit 57e3fdfe6a
2 changed files with 10 additions and 2 deletions

View File

@ -1,7 +1,7 @@
ext { ext {
extName = 'Mangago' extName = 'Mangago'
extClass = '.Mangago' extClass = '.Mangago'
extVersionCode = 13 extVersionCode = 14
isNsfw = true isNsfw = true
} }

View File

@ -175,7 +175,8 @@ class Mangago : ParsedHttpSource() {
override fun chapterFromElement(element: Element) = SChapter.create().apply { override fun chapterFromElement(element: Element) = SChapter.create().apply {
val link = element.select("a.chico") val link = element.select("a.chico")
setUrlWithoutDomain(link.attr("href")) val urlOriginal = link.attr("href")
if (urlOriginal.startsWith("http")) url = urlOriginal else setUrlWithoutDomain(urlOriginal)
name = link.text().trim() name = link.text().trim()
date_upload = runCatching { date_upload = runCatching {
dateFormat.parse(element.select("td:last-child").text().trim())?.time dateFormat.parse(element.select("td:last-child").text().trim())?.time
@ -242,6 +243,13 @@ class Mangago : ParsedHttpSource() {
} }
} }
override fun pageListRequest(chapter: SChapter): Request {
if (chapter.url.startsWith("http")) {
return GET(chapter.url, headers)
}
return super.pageListRequest(chapter)
}
override fun imageUrlParse(document: Document): String = override fun imageUrlParse(document: Document): String =
throw UnsupportedOperationException() throw UnsupportedOperationException()