[Patch] MangaBox - Change CDN (#1846)

* Update build.gradle

* Bypass convert_image_digi
This commit is contained in:
happywillow0 2019-12-01 11:18:29 -05:00 committed by arkon
parent 1e041cd669
commit c0dd822261
2 changed files with 11 additions and 2 deletions

View File

@ -5,7 +5,7 @@ ext {
appName = 'Tachiyomi: MangaBox (Mangakakalot and others)'
pkgNameSuffix = 'all.mangabox'
extClass = '.MangaBoxFactory'
extVersionCode = 4
extVersionCode = 5
libVersion = '1.2'
}

View File

@ -218,11 +218,20 @@ abstract class MangaBox (
val pages = mutableListOf<Page>()
document.select(pageListSelector).forEach {
pages.add(Page(pages.size, "", it.attr("abs:src")))
pages.add(Page(pages.size, "", changecdn(it.attr("abs:src"))))
}
return pages
}
private fun changecdn(url: String): String {
if (url.startsWith("https://convert_image_digi.mgicdn.com")) {
val newurl = "https://images.weserv.nl/?url=" + url.removePrefix("https://")
return newurl
} else {
return url
}
}
override fun imageUrlParse(document: Document): String = throw UnsupportedOperationException("No used")