Comicaso: change domain and fix page list (#4473)
This commit is contained in:
parent
6711c29e74
commit
847f8d084f
@ -2,8 +2,8 @@ ext {
|
|||||||
extName = 'Comicaso'
|
extName = 'Comicaso'
|
||||||
extClass = '.Comicaso'
|
extClass = '.Comicaso'
|
||||||
themePkg = 'mangathemesia'
|
themePkg = 'mangathemesia'
|
||||||
baseUrl = 'https://comicaso.com'
|
baseUrl = 'https://comicaso.org'
|
||||||
overrideVersionCode = 0
|
overrideVersionCode = 1
|
||||||
}
|
}
|
||||||
|
|
||||||
apply from: "$rootDir/common.gradle"
|
apply from: "$rootDir/common.gradle"
|
||||||
|
@ -1,12 +1,41 @@
|
|||||||
package eu.kanade.tachiyomi.extension.id.comicaso
|
package eu.kanade.tachiyomi.extension.id.comicaso
|
||||||
|
|
||||||
|
import android.util.Base64
|
||||||
import eu.kanade.tachiyomi.multisrc.mangathemesia.MangaThemesia
|
import eu.kanade.tachiyomi.multisrc.mangathemesia.MangaThemesia
|
||||||
|
import eu.kanade.tachiyomi.source.model.Page
|
||||||
|
import kotlinx.serialization.json.jsonArray
|
||||||
|
import kotlinx.serialization.json.jsonPrimitive
|
||||||
|
import org.jsoup.nodes.Document
|
||||||
import java.text.SimpleDateFormat
|
import java.text.SimpleDateFormat
|
||||||
import java.util.Locale
|
import java.util.Locale
|
||||||
|
|
||||||
class Comicaso : MangaThemesia(
|
class Comicaso : MangaThemesia(
|
||||||
"Comicaso",
|
"Comicaso",
|
||||||
"https://comicaso.com",
|
"https://comicaso.org",
|
||||||
"id",
|
"id",
|
||||||
dateFormat = SimpleDateFormat("MMMM d, yyyy", Locale("id")),
|
dateFormat = SimpleDateFormat("MMMM d, yyyy", Locale("id")),
|
||||||
)
|
) {
|
||||||
|
override fun pageListParse(document: Document): List<Page> {
|
||||||
|
val script = document.select("script[src^=data:text/javascript;base64,]").map {
|
||||||
|
Base64.decode(
|
||||||
|
it.attr("src").substringAfter("base64,"),
|
||||||
|
Base64.DEFAULT,
|
||||||
|
).toString(Charsets.UTF_8)
|
||||||
|
}.firstOrNull { it.startsWith("ts_reader.run") }
|
||||||
|
?: throw Exception("Couldn't find page script")
|
||||||
|
|
||||||
|
countViews(document)
|
||||||
|
|
||||||
|
val imageListJson = JSON_IMAGE_LIST_REGEX.find(script)?.destructured?.toList()?.get(0).orEmpty()
|
||||||
|
val imageList = try {
|
||||||
|
json.parseToJsonElement(imageListJson).jsonArray
|
||||||
|
} catch (_: IllegalArgumentException) {
|
||||||
|
emptyList()
|
||||||
|
}
|
||||||
|
val scriptPages = imageList.mapIndexed { i, jsonEl ->
|
||||||
|
Page(i, document.location(), jsonEl.jsonPrimitive.content)
|
||||||
|
}
|
||||||
|
|
||||||
|
return scriptPages
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user