Tachiyomi-Extensions/multisrc/overrides/mangathemesia/mangkomik/src/MangKomik.kt

30 lines
958 B
Kotlin
Raw Normal View History

package eu.kanade.tachiyomi.extension.id.mangkomik
import eu.kanade.tachiyomi.multisrc.mangathemesia.MangaThemesia
import eu.kanade.tachiyomi.network.GET
import eu.kanade.tachiyomi.source.model.Page
import org.jsoup.nodes.Document
class MangKomik : MangaThemesia("Siren Komik", "https://sirenkomik.my.id", "id") {
override val id = 8457447675410081142
override val hasProjectPage = true
override fun pageListParse(document: Document): List<Page> {
// Get external JS for image urls
Random User-Agent Refactor (#17059) * lib-randomua * NHentai: Random mobile ua * Madara random UA overhaul * MangaThemesia random UA overhaul * MangaHub random UA overhaul * build errors and warnings * remove preference from Constellar * change to singleton object * network.client * fix copy paste and chapter deep link * exit early * use data class and enum options * missing import * suggested changes Co-authored-by: AntsyLich <59261191+AntsyLich@users.noreply.github.com> * re-add empty check to filters * convert to interceptor * update comment Co-authored-by: Alessandro Jean <14254807+alessandrojean@users.noreply.github.com> * update error message * initialize client by lazy * dont check on excluded Filters Co-authored-by: AntsyLich <59261191+AntsyLich@users.noreply.github.com> * newlines * move preference helper function into lib * move preference helper function into lib x2 * move check to lib too * move defaultRandomUserAgentType to constructor * rename the interceptor * organize the interceptor and preference stuff in different files * hide custom ua setting when random ua is enabled * English Co-authored-by: AntsyLich <59261191+AntsyLich@users.noreply.github.com> * catch specific exception Co-authored-by: AntsyLich <59261191+AntsyLich@users.noreply.github.com> * setVisible() fresh stuff * setVisible() fresh stuff * change summary * workaround * Update error message Co-authored-by: Alessandro Jean <14254807+alessandrojean@users.noreply.github.com> * Update comment Co-authored-by: Alessandro Jean <14254807+alessandrojean@users.noreply.github.com> --------- Co-authored-by: AntsyLich <59261191+AntsyLich@users.noreply.github.com> Co-authored-by: Alessandro Jean <14254807+alessandrojean@users.noreply.github.com>
2023-07-15 22:52:35 +00:00
val scriptEl = document.selectFirst("script[data-minify]")
val scriptUrl = scriptEl?.attr("src")
if (scriptUrl.isNullOrEmpty()) {
return super.pageListParse(document)
}
val scriptResponse = client.newCall(
2023-02-11 19:21:03 +00:00
GET(scriptUrl, headers),
).execute()
// Inject external JS
2023-02-11 22:30:31 +00:00
scriptEl.text(scriptResponse.body.string())
return super.pageListParse(document)
}
}