Fix RealmScans (#14344)
This commit is contained in:
parent
70b3cca0b1
commit
394a2be3b0
|
@ -3,11 +3,8 @@ package eu.kanade.tachiyomi.extension.en.realmscans
|
|||
import eu.kanade.tachiyomi.multisrc.mangathemesia.MangaThemesia
|
||||
import eu.kanade.tachiyomi.network.interceptor.rateLimit
|
||||
import eu.kanade.tachiyomi.source.model.Page
|
||||
import kotlinx.serialization.json.jsonArray
|
||||
import kotlinx.serialization.json.jsonPrimitive
|
||||
import okhttp3.OkHttpClient
|
||||
import org.jsoup.nodes.Document
|
||||
import java.lang.IllegalArgumentException
|
||||
import java.util.concurrent.TimeUnit
|
||||
|
||||
class RealmScans : MangaThemesia(
|
||||
|
@ -22,30 +19,8 @@ class RealmScans : MangaThemesia(
|
|||
.build()
|
||||
|
||||
override fun pageListParse(document: Document): List<Page> {
|
||||
val htmlPages = document.select(pageSelector)
|
||||
.mapIndexed { i, img ->
|
||||
val url = img.attr("data-wpfc-original-src")
|
||||
.ifEmpty { img.attr("abs:src") }
|
||||
|
||||
Page(i, "", url)
|
||||
}
|
||||
|
||||
countViews(document)
|
||||
|
||||
// Some sites also loads pages via javascript
|
||||
if (htmlPages.isNotEmpty()) { return htmlPages }
|
||||
|
||||
val docString = document.toString()
|
||||
val imageListJson = JSON_IMAGE_LIST_REGEX.find(docString)?.destructured?.toList()?.get(0).orEmpty()
|
||||
val imageList = try {
|
||||
json.parseToJsonElement(imageListJson).jsonArray
|
||||
} catch (_: IllegalArgumentException) {
|
||||
emptyList()
|
||||
}
|
||||
val scriptPages = imageList.mapIndexed { i, jsonEl ->
|
||||
Page(i, "", jsonEl.jsonPrimitive.content)
|
||||
}
|
||||
|
||||
return scriptPages
|
||||
return super.pageListParse(document)
|
||||
.distinctBy { it.imageUrl }
|
||||
.mapIndexed { i, page -> Page(i, imageUrl = page.imageUrl) }
|
||||
}
|
||||
}
|
||||
|
|
|
@ -91,7 +91,7 @@ class MangaThemesiaGenerator : ThemeSourceGenerator {
|
|||
SingleLang("Raiki Scan", "https://raikiscan.com", "es"),
|
||||
SingleLang("Rawkuma", "https://rawkuma.com/", "ja"),
|
||||
SingleLang("Readkomik", "https://readkomik.com", "en", className = "ReadKomik", overrideVersionCode = 1),
|
||||
SingleLang("Realm Scans", "https://realmscans.com", "en", overrideVersionCode = 3),
|
||||
SingleLang("Realm Scans", "https://realmscans.com", "en", overrideVersionCode = 4),
|
||||
SingleLang("Ryukonesia", "https://ryukonesia.net", "id"),
|
||||
SingleLang("Sekaikomik", "https://www.sekaikomik.live", "id", isNsfw = true, overrideVersionCode = 9),
|
||||
SingleLang("Sekaikomik", "https://www.sekaikomik.site", "id", isNsfw = true, overrideVersionCode = 8),
|
||||
|
|
Loading…
Reference in New Issue