MangaKawaii: add scanlator (#6490)

This commit is contained in:
Julien Papasian 2021-04-10 12:49:12 +01:00 committed by GitHub
parent 0e39cec5b8
commit 726992ddfb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 4 deletions

View File

@ -5,7 +5,7 @@ ext {
extName = 'Mangakawaii' extName = 'Mangakawaii'
pkgNameSuffix = 'fr.mangakawaii' pkgNameSuffix = 'fr.mangakawaii'
extClass = '.MangaKawaii' extClass = '.MangaKawaii'
extVersionCode = 28 extVersionCode = 29
libVersion = '1.2' libVersion = '1.2'
} }

View File

@ -103,13 +103,14 @@ class MangaKawaii : ParsedHttpSource() {
override fun chapterListSelector() = throw Exception("Not used") override fun chapterListSelector() = throw Exception("Not used")
override fun chapterFromElement(element: Element): SChapter = throw Exception("Not used") override fun chapterFromElement(element: Element): SChapter = throw Exception("Not used")
override fun chapterListParse(response: Response): List<SChapter> { override fun chapterListParse(response: Response): List<SChapter> {
var document = response.asJsoup() val document = response.asJsoup()
var widgetDocument = document
val widgetPageListUrl = Regex("""['"](/arrilot/load-widget.*?)['"]""").find(document.toString())?.groupValues?.get(1) val widgetPageListUrl = Regex("""['"](/arrilot/load-widget.*?)['"]""").find(document.toString())?.groupValues?.get(1)
if (widgetPageListUrl != null) { if (widgetPageListUrl != null) {
document = client.newCall(GET("$baseUrl$widgetPageListUrl", headers)).execute().asJsoup() widgetDocument = client.newCall(GET("$baseUrl$widgetPageListUrl", headers)).execute().asJsoup()
} }
return document.select("tr[class*=volume-]:has(td)").map { return widgetDocument.select("tr[class*=volume-]:has(td)").map {
SChapter.create().apply { SChapter.create().apply {
url = it.select("td.table__chapter").select("a").attr("href") url = it.select("td.table__chapter").select("a").attr("href")
name = it.select("td.table__chapter").select("span").text().trim() name = it.select("td.table__chapter").select("span").text().trim()
@ -117,6 +118,7 @@ class MangaKawaii : ParsedHttpSource() {
?: -1F ?: -1F
date_upload = it.select("td.table__date").firstOrNull()?.text()?.let { parseDate(it) } date_upload = it.select("td.table__date").firstOrNull()?.text()?.let { parseDate(it) }
?: 0 ?: 0
scanlator = document.select("[itemprop=translator] a").joinToString { it.text().replace(Regex("""[\[\]]"""), "") }
} }
} }
} }