Fix chapter images not loading at OPEX. (#7652)

This commit is contained in:
Alessandro Jean 2021-06-14 12:35:40 -03:00 committed by GitHub
parent b49b58613f
commit 69d6b63496
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 6 deletions

View File

@ -6,7 +6,7 @@ ext {
extName = 'One Piece Ex' extName = 'One Piece Ex'
pkgNameSuffix = 'pt.opex' pkgNameSuffix = 'pt.opex'
extClass = '.OnePieceEx' extClass = '.OnePieceEx'
extVersionCode = 2 extVersionCode = 3
libVersion = '1.2' libVersion = '1.2'
} }

View File

@ -193,11 +193,9 @@ class OnePieceEx : ParsedHttpSource() {
override fun pageListParse(document: Document): List<Page> { override fun pageListParse(document: Document): List<Page> {
return document.select("script:containsData(paginasLista)").first()!! return document.select("script:containsData(paginasLista)").first()!!
.data() .data()
.substringAfter("paginasLista = \"") .substringAfter("paginasLista = ")
.substringBefore("\";") .substringBefore(";")
.replace("\\\"", "\"") .let { json.parseToJsonElement(it).jsonPrimitive.content }
.replace("\\\\\\/", "/")
.replace("//", "/")
.let { json.parseToJsonElement(it).jsonObject.entries } .let { json.parseToJsonElement(it).jsonObject.entries }
.mapIndexed { i, entry -> .mapIndexed { i, entry ->
Page(i, document.location(), "$baseUrl/${entry.value.jsonPrimitive.content}") Page(i, document.location(), "$baseUrl/${entry.value.jsonPrimitive.content}")