mirror of
https://github.com/keiyoushi/extensions-source.git
synced 2024-11-22 10:22:47 +01:00
GenzToons: Actually update domain and cdn url (#5603)
* update cdn * search cdn in page * bruh i dont update the domain * revert changes in keyoapp
This commit is contained in:
parent
9ce8d7b961
commit
24c4747541
@ -3,7 +3,7 @@ ext {
|
||||
extClass = '.GenzToons'
|
||||
themePkg = 'keyoapp'
|
||||
baseUrl = 'https://genzupdates.com'
|
||||
overrideVersionCode = 28
|
||||
overrideVersionCode = 29
|
||||
}
|
||||
|
||||
apply from: "$rootDir/common.gradle"
|
||||
|
@ -7,7 +7,9 @@ import androidx.preference.SwitchPreferenceCompat
|
||||
import eu.kanade.tachiyomi.multisrc.keyoapp.Keyoapp
|
||||
import eu.kanade.tachiyomi.network.interceptor.rateLimit
|
||||
import eu.kanade.tachiyomi.source.ConfigurableSource
|
||||
import eu.kanade.tachiyomi.source.model.Page
|
||||
import eu.kanade.tachiyomi.source.model.SChapter
|
||||
import org.jsoup.nodes.Document
|
||||
import org.jsoup.nodes.Element
|
||||
import uy.kohesive.injekt.Injekt
|
||||
import uy.kohesive.injekt.api.get
|
||||
@ -15,7 +17,7 @@ import uy.kohesive.injekt.api.get
|
||||
class GenzToons :
|
||||
Keyoapp(
|
||||
"Genz Toons",
|
||||
"https://genztoons.com",
|
||||
"https://genzupdates.com",
|
||||
"en",
|
||||
),
|
||||
ConfigurableSource {
|
||||
@ -42,6 +44,16 @@ class GenzToons :
|
||||
}
|
||||
}
|
||||
|
||||
override fun pageListParse(document: Document): List<Page> {
|
||||
val script = document.select("#pages > script").joinToString("\n") { it.data() }
|
||||
val realCdnUrl = CDN_URL_REGEX.find(script)?.groupValues?.get(1)?.takeIf { it.startsWith("http") }
|
||||
?: "$baseUrl/uploads/"
|
||||
return document.select("#pages > img")
|
||||
.mapIndexed { index, img ->
|
||||
Page(index, document.location(), realCdnUrl + img.attr("uid"))
|
||||
}
|
||||
}
|
||||
|
||||
override fun setupPreferenceScreen(screen: PreferenceScreen) {
|
||||
SwitchPreferenceCompat(screen.context).apply {
|
||||
key = SHOW_PAID_CHAPTERS_PREF
|
||||
@ -58,5 +70,6 @@ class GenzToons :
|
||||
companion object {
|
||||
private const val SHOW_PAID_CHAPTERS_PREF = "pref_show_paid_chap"
|
||||
private const val SHOW_PAID_CHAPTERS_DEFAULT = false
|
||||
private val CDN_URL_REGEX = """realUrl\s*=\s*`([^`]+)\$""".toRegex()
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user