Minor daily update

pull/388/head^2
devi 2 years ago
parent 41eea1c420
commit 3ea088371b

@ -3,6 +3,7 @@ package org.koitharu.kotatsu.parsers.site.likemanga
import kotlinx.coroutines.async import kotlinx.coroutines.async
import kotlinx.coroutines.awaitAll import kotlinx.coroutines.awaitAll
import kotlinx.coroutines.coroutineScope import kotlinx.coroutines.coroutineScope
import org.json.JSONObject
import org.jsoup.nodes.Element import org.jsoup.nodes.Element
import org.koitharu.kotatsu.parsers.MangaLoaderContext import org.koitharu.kotatsu.parsers.MangaLoaderContext
import org.koitharu.kotatsu.parsers.PagedMangaParser import org.koitharu.kotatsu.parsers.PagedMangaParser
@ -199,15 +200,36 @@ internal abstract class LikeMangaParser(
override suspend fun getPages(chapter: MangaChapter): List<MangaPage> { override suspend fun getPages(chapter: MangaChapter): List<MangaPage> {
val fullUrl = chapter.url.toAbsoluteUrl(domain) val fullUrl = chapter.url.toAbsoluteUrl(domain)
val doc = webClient.httpGet(fullUrl).parseHtml() val doc = webClient.httpGet(fullUrl).parseHtml()
return doc.select(".reading-detail img").map { img -> val testJson = doc.selectFirst("div.reading input#next_img_token")
val url = img.src() ?: img.parseFailed("Image src not found") if (testJson != null) {
MangaPage( val jsonRaw = testJson.attr("value").split(".")[1]
id = generateUid(url), val jsonData = JSONObject(context.decodeBase64(jsonRaw).toString(Charsets.UTF_8))
url = url, val jsonImg = context.decodeBase64(jsonData.getString("data")).toString(Charsets.UTF_8)
preview = null, val images = jsonImg.replace("\\", "").replace("[", "").replace("]", "").replace("\"", "").split(",")
source = source, val cdn = doc.selectFirstOrThrow(".reading-detail img").src()?.substringBefore("manga/")
) return images.map { img ->
val url = cdn + img
MangaPage(
id = generateUid(url),
url = url,
preview = null,
source = source,
)
}
} else {
return doc.select(".reading-detail img").map { img ->
val url = img.src() ?: img.parseFailed("Image src not found")
MangaPage(
id = generateUid(url),
url = url,
preview = null,
source = source,
)
}
} }
} }
private fun parseChapterDate(dateFormat: DateFormat, date: String?): Long { private fun parseChapterDate(dateFormat: DateFormat, date: String?): Long {

@ -0,0 +1,10 @@
package org.koitharu.kotatsu.parsers.site.madara.es
import org.koitharu.kotatsu.parsers.MangaLoaderContext
import org.koitharu.kotatsu.parsers.MangaSourceParser
import org.koitharu.kotatsu.parsers.model.MangaSource
import org.koitharu.kotatsu.parsers.site.madara.MadaraParser
@MangaSourceParser("CONSEJODEMATONES", "ConsejoDeMatones", "es")
internal class ConsejoDeMatones(context: MangaLoaderContext) :
MadaraParser(context, MangaSource.CONSEJODEMATONES, "www.consejodematones.xyz")
Loading…
Cancel
Save