Update YM URL and fix some images not loading. (#15153)

This commit is contained in:
Alessandro Jean 2023-01-27 20:51:27 -03:00 committed by GitHub
parent 900a44839d
commit 85e28435b2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 16 additions and 3 deletions

View File

@ -5,7 +5,12 @@ import eu.kanade.tachiyomi.multisrc.heancms.HeanCms
import java.text.SimpleDateFormat import java.text.SimpleDateFormat
import java.util.TimeZone import java.util.TimeZone
class YugenMangas : HeanCms("YugenMangas", "https://yugenmangas.com", "es") { class YugenMangas : HeanCms(
"YugenMangas",
"https://yugenmangas.net",
"es",
"https://api.yugenmangas.com"
) {
// Site changed from Madara to HeanCms. // Site changed from Madara to HeanCms.
override val versionId = 2 override val versionId = 2

View File

@ -256,6 +256,14 @@ abstract class HeanCms(
override fun pageListParse(response: Response): List<Page> { override fun pageListParse(response: Response): List<Page> {
return response.parseAs<HeanCmsReaderDto>().content?.images.orEmpty() return response.parseAs<HeanCmsReaderDto>().content?.images.orEmpty()
.filterNot { imageUrl ->
// Their image server returns HTTP 403 for hidden files that starts
// with a dot in the file name. To avoid download errors, these are removed.
imageUrl
.removeSuffix("/")
.substringAfterLast("/")
.startsWith(".")
}
.mapIndexed { i, url -> .mapIndexed { i, url ->
Page(i, imageUrl = if (url.startsWith("http")) url else "$apiUrl/$url") Page(i, imageUrl = if (url.startsWith("http")) url else "$apiUrl/$url")
} }

View File

@ -9,11 +9,11 @@ class HeanCmsGenerator : ThemeSourceGenerator {
override val themeClass = "HeanCms" override val themeClass = "HeanCms"
override val baseVersionCode: Int = 9 override val baseVersionCode: Int = 10
override val sources = listOf( override val sources = listOf(
SingleLang("Reaper Scans", "https://reaperscans.net", "pt-BR", overrideVersionCode = 35), SingleLang("Reaper Scans", "https://reaperscans.net", "pt-BR", overrideVersionCode = 35),
SingleLang("YugenMangas", "https://yugenmangas.com", "es", isNsfw = true), SingleLang("YugenMangas", "https://yugenmangas.net", "es", isNsfw = true),
) )
companion object { companion object {