Fix Mangapark page list empty error (#818)

Fix Mangapark page list empty error
This commit is contained in:
Logan B 2019-02-15 23:39:31 +13:00 committed by Carlos
parent b85ea810c1
commit 3a3436b3c1
8 changed files with 17 additions and 5 deletions

View File

@ -5,7 +5,7 @@ ext {
appName = 'Tachiyomi: MangaPark'
pkgNameSuffix = 'en.mangapark'
extClass = '.MangaPark'
extVersionCode = 5
extVersionCode = 6
libVersion = '1.2'
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.8 KiB

After

Width:  |  Height:  |  Size: 5.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.9 KiB

After

Width:  |  Height:  |  Size: 9.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 52 KiB

After

Width:  |  Height:  |  Size: 17 KiB

View File

@ -5,6 +5,7 @@ import eu.kanade.tachiyomi.network.GET
import eu.kanade.tachiyomi.source.model.*
import eu.kanade.tachiyomi.source.online.ParsedHttpSource
import okhttp3.Request
import org.json.JSONObject
import org.jsoup.nodes.Document
import org.jsoup.nodes.Element
import java.text.SimpleDateFormat
@ -16,7 +17,7 @@ class MangaPark : ParsedHttpSource() {
override val supportsLatest = true
override val name = "MangaPark"
override val baseUrl = "https://mangapark.me"
override val baseUrl = "https://mangapark.net"
private val directorySelector = ".ls1 .item"
private val directoryUrl = "/genre"
@ -175,9 +176,20 @@ class MangaPark : ParsedHttpSource() {
return now.timeInMillis
}
override fun pageListParse(document: Document)
= document.getElementsByClass("img").map {
Page(it.attr("i").toInt() - 1, "", cleanUrl(it.attr("src")))
override fun pageListParse(document: Document): List<Page> {
val doc = document.toString()
val obj = doc.substringAfter("var _load_pages = ").substringBefore(";")
val pages = mutableListOf<Page>()
var imglist = JSONObject("""{"data": $obj}""").getJSONArray("data")
for (i in 0 until imglist.length()) {
var item = imglist.getJSONObject(i)
var page = item.getString("u")
if (page.startsWith("//")) {
page = "https:$page"
}
pages.add(Page(i, "", page))
}
return pages
}
//Unused, we can get image urls directly from the chapter page