RawLH: Update page list parse (#1504)

RawLH: Update page list parse
This commit is contained in:
Rama Bondan Prakoso 2019-09-15 10:18:54 +07:00 committed by arkon
parent 2bf823b012
commit 7203688476
2 changed files with 10 additions and 3 deletions

View File

@ -5,7 +5,7 @@ ext {
appName = 'Tachiyomi: RawLH' appName = 'Tachiyomi: RawLH'
pkgNameSuffix = 'ja.rawlh' pkgNameSuffix = 'ja.rawlh'
extClass = '.Rawlh' extClass = '.Rawlh'
extVersionCode = 9 extVersionCode = 10
libVersion = '1.2' libVersion = '1.2'
} }

View File

@ -9,6 +9,7 @@ import okhttp3.Request
import org.jsoup.nodes.Document import org.jsoup.nodes.Document
import org.jsoup.nodes.Element import org.jsoup.nodes.Element
import java.util.* import java.util.*
import android.util.Base64
class Rawlh : ParsedHttpSource() { class Rawlh : ParsedHttpSource() {
@ -149,10 +150,16 @@ class Rawlh : ParsedHttpSource() {
} }
override fun pageListParse(document: Document): List<Page> { override fun pageListParse(document: Document): List<Page> {
val key = document.select("script:containsData(atob)").html().
substringAfter("var imgSrc = $(this).attr('").substringBefore("');")
val pages = mutableListOf<Page>() val pages = mutableListOf<Page>()
document.select("img.chapter-img").forEach { document.select("img.chapter-img").forEach {
val url = it.attr("src") val encodedUrl = it.attr(key)
if (url != "") { if (encodedUrl != "") {
val decodedUrl = Base64.decode(encodedUrl,Base64.DEFAULT)
pages.add(Page(pages.size, "", String(decodedUrl)))
}else{
val url = it.attr("src")
pages.add(Page(pages.size, "", url)) pages.add(Page(pages.size, "", url))
} }
} }