Fix GabutScans Broken Images (#12279)
* fix broken image * refactor and fix chapter image broken * Apply suggestions Co-authored-by: stevenyomi <95685115+stevenyomi@users.noreply.github.com> * remove `pages` Co-authored-by: stevenyomi <95685115+stevenyomi@users.noreply.github.com>
This commit is contained in:
parent
281fc6123c
commit
1e13faa490
|
@ -1,6 +1,11 @@
|
|||
package eu.kanade.tachiyomi.extension.id.gabutscans
|
||||
|
||||
import eu.kanade.tachiyomi.multisrc.wpmangareader.WPMangaReader
|
||||
import eu.kanade.tachiyomi.source.model.Page
|
||||
import kotlinx.serialization.json.jsonArray
|
||||
import kotlinx.serialization.json.jsonPrimitive
|
||||
import org.jsoup.nodes.Document
|
||||
import org.jsoup.nodes.Element
|
||||
import java.text.SimpleDateFormat
|
||||
import java.util.Locale
|
||||
|
||||
|
@ -10,4 +15,29 @@ class GabutScans : WPMangaReader(
|
|||
) {
|
||||
|
||||
override val hasProjectPage = true
|
||||
|
||||
override fun searchMangaFromElement(element: Element) =
|
||||
super.searchMangaFromElement(element).apply {
|
||||
thumbnail_url = element.select("img").attr("abs:data-src")
|
||||
}
|
||||
|
||||
override fun mangaDetailsParse(document: Document) = super.mangaDetailsParse(document).apply {
|
||||
thumbnail_url = document.select(seriesThumbnailSelector).attr("abs:data-src")
|
||||
}
|
||||
|
||||
override fun pageListParse(document: Document): List<Page> {
|
||||
// Prefer using sources loaded from javascript
|
||||
// because current CDN (Statically) can't load old images.
|
||||
// Example: https://gabutscans.com/cinderella-wa-sagasanai-chapter-41-end-bahasa-indonesia/
|
||||
|
||||
val docString = document.toString()
|
||||
val imageListRegex = Regex("""\"images.*?:.*?(\[.*?])""")
|
||||
val (imageListJson) = imageListRegex.find(docString)!!.destructured
|
||||
|
||||
val imageList = json.parseToJsonElement(imageListJson).jsonArray
|
||||
|
||||
return imageList.mapIndexed { i, jsonEl ->
|
||||
Page(i, "", jsonEl.jsonPrimitive.content)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -22,7 +22,7 @@ class WPMangaReaderGenerator : ThemeSourceGenerator {
|
|||
SingleLang("BeastScans", "https://beastscans.com", "en"),
|
||||
SingleLang("Franxx Mangás", "https://franxxmangas.net", "pt-BR", className = "FranxxMangas", isNsfw = true),
|
||||
SingleLang("Fusion Scanlation", "https://fusionscanlation.com", "es", className = "FusionScanlation", overrideVersionCode = 2),
|
||||
SingleLang("Gabut Scans", "https://gabutscans.com", "id"),
|
||||
SingleLang("Gabut Scans", "https://gabutscans.com", "id", overrideVersionCode = 1),
|
||||
SingleLang("Gecenin Lordu", "https://geceninlordu.com", "tr", overrideVersionCode = 1),
|
||||
SingleLang("InariManga", "https://inarimanga.com", "es"),
|
||||
SingleLang("Kiryuu", "https://kiryuu.id", "id", overrideVersionCode = 6),
|
||||
|
|
Loading…
Reference in New Issue