MangaBox - fix Mangakakalots pages (#3657)

This commit is contained in:
Mike 2020-07-01 03:16:32 -04:00 committed by GitHub
parent 38ea4926c8
commit e64df144a5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 9 deletions

View File

@ -5,7 +5,7 @@ ext {
extName = 'MangaBox (Mangakakalot and others)' extName = 'MangaBox (Mangakakalot and others)'
pkgNameSuffix = 'all.mangabox' pkgNameSuffix = 'all.mangabox'
extClass = '.MangaBoxFactory' extClass = '.MangaBoxFactory'
extVersionCode = 23 extVersionCode = 24
libVersion = '1.2' libVersion = '1.2'
} }

View File

@ -234,16 +234,19 @@ abstract class MangaBox(
open val pageListSelector = "div#vungdoc img, div.container-chapter-reader img" open val pageListSelector = "div#vungdoc img, div.container-chapter-reader img"
override fun pageListParse(document: Document): List<Page> { override fun pageListParse(document: Document): List<Page> {
return document.select(pageListSelector).mapIndexed { i, element -> return document.select(pageListSelector)
val url = element.attr("abs:src").let { src -> // filter out bad elements for mangakakalots
if (src.startsWith("https://convert_image_digi.mgicdn.com")) { .filterNot { it.attr("src").endsWith("log") }
"https://images.weserv.nl/?url=" + src.substringAfter("//") .mapIndexed { i, element ->
} else { val url = element.attr("abs:src").let { src ->
src if (src.startsWith("https://convert_image_digi.mgicdn.com")) {
"https://images.weserv.nl/?url=" + src.substringAfter("//")
} else {
src
}
} }
Page(i, document.location(), url)
} }
Page(i, document.location(), url)
}
} }
override fun imageRequest(page: Page): Request { override fun imageRequest(page: Page): Request {