Sushi-Scan chapter loading fix + new icon (#16328)

New icon + fixing some chapters not loading because using HTTP instead of HTTPS

Co-authored-by: Saïd Boudjenane <said.boudjenane@protonmail.ch>
This commit is contained in:
Sapphire 2023-05-06 16:17:37 +02:00 committed by GitHub
parent 2ce3cb6483
commit 66f2736378
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 30 additions and 1 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.8 KiB

After

Width:  |  Height:  |  Size: 6.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.9 KiB

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 9.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 32 KiB

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 162 KiB

After

Width:  |  Height:  |  Size: 170 KiB

View File

@ -1,7 +1,11 @@
package eu.kanade.tachiyomi.extension.fr.sushiscan
import eu.kanade.tachiyomi.multisrc.mangathemesia.MangaThemesia
import eu.kanade.tachiyomi.source.model.Page
import eu.kanade.tachiyomi.source.model.SManga
import kotlinx.serialization.json.jsonArray
import kotlinx.serialization.json.jsonPrimitive
import org.jsoup.nodes.Document
import java.text.SimpleDateFormat
import java.util.Locale
@ -15,4 +19,29 @@ class SushiScan : MangaThemesia("Sushi-Scan", "https://sushiscan.net", "fr", dat
this.contains("Terminé", ignoreCase = true) -> SManga.COMPLETED
else -> SManga.UNKNOWN
}
// Overriding to fix http -> https when needed
override fun pageListParse(document: Document): List<Page> {
val htmlPages = document.select(pageSelector)
.filterNot { it.imgAttr().isEmpty() }
.mapIndexed { i, img -> Page(i, "", if (img.imgAttr().contains("https")) img.imgAttr() else img.imgAttr().replace("http", "https")) }
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
}
}

View File

@ -111,7 +111,7 @@ class MangaThemesiaGenerator : ThemeSourceGenerator {
SingleLang("Snudae Scans", "https://snudaescans.com", "en", isNsfw = true, className = "BatotoScans", overrideVersionCode = 1),
SingleLang("Summer Fansub", "https://smmr.in", "pt-BR", isNsfw = true),
SingleLang("Surya Scans", "https://suryascans.com", "en"),
SingleLang("Sushi-Scan", "https://sushiscan.net", "fr", className = "SushiScan", overrideVersionCode = 3),
SingleLang("Sushi-Scan", "https://sushiscan.net", "fr", className = "SushiScan", overrideVersionCode = 4),
SingleLang("Tarot Scans", "https://www.tarotscans.com", "tr"),
SingleLang("The Apollo Team", "https://theapollo.team", "en"),
SingleLang("Tsundoku Traduções", "https://tsundoku.com.br", "pt-BR", className = "TsundokuTraducoes", overrideVersionCode = 9),