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'
pkgNameSuffix = 'pt.opex'
extClass = '.OnePieceEx'
extVersionCode = 2
extVersionCode = 3
libVersion = '1.2'
}

View File

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