parent
990ea76c28
commit
e81fe09571
|
@ -1,9 +1,9 @@
|
||||||
ext {
|
ext {
|
||||||
extName = 'NekoScans'
|
extName = 'NekoScans'
|
||||||
extClass = '.NekoScans'
|
extClass = '.NekoScans'
|
||||||
themePkg = 'mangathemesia'
|
themePkg = 'zeistmanga'
|
||||||
baseUrl = 'https://nekoscans.com'
|
baseUrl = 'https://nekoscanlationlector.blogspot.com'
|
||||||
overrideVersionCode = 0
|
overrideVersionCode = 22
|
||||||
isNsfw = true
|
isNsfw = true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,57 +1,44 @@
|
||||||
package eu.kanade.tachiyomi.extension.es.nekoscans
|
package eu.kanade.tachiyomi.extension.es.nekoscans
|
||||||
|
|
||||||
import android.util.Base64
|
import eu.kanade.tachiyomi.multisrc.zeistmanga.ZeistManga
|
||||||
import eu.kanade.tachiyomi.multisrc.mangathemesia.MangaThemesia
|
|
||||||
import eu.kanade.tachiyomi.network.interceptor.rateLimit
|
import eu.kanade.tachiyomi.network.interceptor.rateLimit
|
||||||
import eu.kanade.tachiyomi.source.model.Page
|
import eu.kanade.tachiyomi.source.model.SManga
|
||||||
import kotlinx.serialization.json.jsonArray
|
import eu.kanade.tachiyomi.util.asJsoup
|
||||||
import kotlinx.serialization.json.jsonPrimitive
|
import okhttp3.Response
|
||||||
import org.jsoup.nodes.Document
|
|
||||||
import java.text.SimpleDateFormat
|
|
||||||
import java.util.Locale
|
|
||||||
import java.util.concurrent.TimeUnit
|
import java.util.concurrent.TimeUnit
|
||||||
|
|
||||||
class NekoScans : MangaThemesia(
|
class NekoScans : ZeistManga(
|
||||||
"NekoScans",
|
"NekoScans",
|
||||||
"https://nekoscans.com",
|
"https://nekoscanlationlector.blogspot.com",
|
||||||
"es",
|
"es",
|
||||||
mangaUrlDirectory = "/proyecto",
|
|
||||||
dateFormat = SimpleDateFormat("MMMM dd, yyyy", Locale("es")),
|
|
||||||
) {
|
) {
|
||||||
|
// Theme changed from MangaThemesia to ZeistManga
|
||||||
|
override val versionId = 2
|
||||||
|
|
||||||
override val client = super.client.newBuilder()
|
override val client = super.client.newBuilder()
|
||||||
.rateLimit(2, 1, TimeUnit.SECONDS)
|
.rateLimit(2, 1, TimeUnit.SECONDS)
|
||||||
.build()
|
.build()
|
||||||
|
|
||||||
override val seriesStatusSelector = ".tsinfo .imptdt:contains(estado) i"
|
override val excludedCategories = listOf("Anime", "Novel")
|
||||||
|
|
||||||
override fun pageListParse(document: Document): List<Page> {
|
override fun popularMangaRequest(page: Int) = latestUpdatesRequest(page)
|
||||||
countViews(document)
|
override fun popularMangaParse(response: Response) = latestUpdatesParse(response)
|
||||||
|
override val supportsLatest = false
|
||||||
|
|
||||||
val chapterUrl = document.location()
|
override fun mangaDetailsParse(response: Response) = SManga.create().apply {
|
||||||
val htmlPages = document.select(pageSelector)
|
val document = response.asJsoup()
|
||||||
.filterNot { it.imgAttr().isEmpty() }
|
document.selectFirst("header[itemprop=mainEntity]")!!.let { element ->
|
||||||
.mapIndexed { i, img -> Page(i, chapterUrl, img.imgAttr()) }
|
title = element.selectFirst("h1[itemprop=name]")!!.text()
|
||||||
|
thumbnail_url = element.selectFirst("img[itemprop=image]")!!.attr("src")
|
||||||
// Some sites also loads pages via javascript
|
status = parseStatus(element.selectFirst("span[data-status]")!!.text())
|
||||||
if (htmlPages.isNotEmpty()) { return htmlPages }
|
genre = element.select("dl:has(dt:contains(Genre)) > dd > a[rel=tag]").joinToString { it.text() }
|
||||||
|
}
|
||||||
var docString = document.toString()
|
description = document.selectFirst("#synopsis, #sinop")!!.text()
|
||||||
|
document.selectFirst("div#extra-info")?.let { element ->
|
||||||
document.select("div#content > div.wrapper > script[src^=data:text/javascript;base64,]").forEach { script ->
|
author = element.selectFirst("dl:has(dt:contains(Autor)) > dd")!!.text()
|
||||||
val scriptText = String(Base64.decode(script.attr("src").substringAfter("base64,"), Base64.DEFAULT))
|
artist = element.selectFirst("dl:has(dt:contains(Artista)) > dd")!!.text()
|
||||||
docString += scriptText
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
val imageListJson = JSON_IMAGE_LIST_REGEX.find(docString)?.destructured?.toList()?.get(0).orEmpty()
|
override val pageListSelector = "div#readarea img"
|
||||||
val imageList = try {
|
|
||||||
json.parseToJsonElement(imageListJson).jsonArray
|
|
||||||
} catch (_: IllegalArgumentException) {
|
|
||||||
emptyList()
|
|
||||||
}
|
|
||||||
val scriptPages = imageList.mapIndexed { i, jsonEl ->
|
|
||||||
Page(i, chapterUrl, jsonEl.jsonPrimitive.content)
|
|
||||||
}
|
|
||||||
|
|
||||||
return scriptPages
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue