mirror of
https://github.com/keiyoushi/extensions-source.git
synced 2024-11-22 10:22:47 +01:00
FRScan: Fix pages loading (#3230)
* Fix pages loading * Change group name * Remove variable * Remove parseAs function and add page url
This commit is contained in:
parent
de5d088129
commit
8dde53ea23
@ -3,7 +3,7 @@ ext {
|
||||
extClass = '.FRScan'
|
||||
themePkg = 'madara'
|
||||
baseUrl = 'https://fr-scan.com'
|
||||
overrideVersionCode = 5
|
||||
overrideVersionCode = 6
|
||||
}
|
||||
|
||||
apply from: "$rootDir/common.gradle"
|
||||
|
@ -2,7 +2,10 @@ package eu.kanade.tachiyomi.extension.fr.frdashscan
|
||||
|
||||
import eu.kanade.tachiyomi.multisrc.madara.Madara
|
||||
import eu.kanade.tachiyomi.network.interceptor.rateLimit
|
||||
import eu.kanade.tachiyomi.source.model.Page
|
||||
import kotlinx.serialization.decodeFromString
|
||||
import okhttp3.OkHttpClient
|
||||
import org.jsoup.nodes.Document
|
||||
import java.text.SimpleDateFormat
|
||||
import java.util.Locale
|
||||
import java.util.concurrent.TimeUnit
|
||||
@ -16,4 +19,20 @@ class FRScan : Madara("FR-Scan", "https://fr-scan.com", "fr", dateFormat = Simpl
|
||||
override val useNewChapterEndpoint = true
|
||||
|
||||
override val chapterUrlSuffix = ""
|
||||
|
||||
override fun pageListParse(document: Document): List<Page> {
|
||||
val chapterPreloaded = document.selectFirst("#chapter_preloaded_images")
|
||||
?: return super.pageListParse(document)
|
||||
|
||||
val content = CHAPTER_PAGES_REGEX.find(chapterPreloaded.data())?.groups?.get("pages")!!.value
|
||||
val pages = json.decodeFromString<List<String>>(content)
|
||||
|
||||
return pages.mapIndexed { index, imageUrl ->
|
||||
Page(index, document.location(), imageUrl)
|
||||
}
|
||||
}
|
||||
|
||||
companion object {
|
||||
val CHAPTER_PAGES_REGEX = """=\s+(?<pages>\[.+\])""".toRegex()
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user