MangaMx - fix pages (#3580)
This commit is contained in:
parent
afe8757638
commit
df765c453a
|
@ -2,10 +2,10 @@ apply plugin: 'com.android.application'
|
||||||
apply plugin: 'kotlin-android'
|
apply plugin: 'kotlin-android'
|
||||||
|
|
||||||
ext {
|
ext {
|
||||||
appName = 'Tachiyomi: MangaMx & Doujin-Yang'
|
appName = 'Tachiyomi: MangaMx'
|
||||||
pkgNameSuffix = 'es.mangamx'
|
pkgNameSuffix = 'es.mangamx'
|
||||||
extClass = '.MangaMx'
|
extClass = '.MangaMx'
|
||||||
extVersionCode = 7
|
extVersionCode = 8
|
||||||
libVersion = '1.2'
|
libVersion = '1.2'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
package eu.kanade.tachiyomi.extension.es.mangamx
|
package eu.kanade.tachiyomi.extension.es.mangamx
|
||||||
|
|
||||||
import android.net.Uri
|
import android.net.Uri
|
||||||
|
import android.util.Base64
|
||||||
import com.github.salomonbrys.kotson.get
|
import com.github.salomonbrys.kotson.get
|
||||||
import com.github.salomonbrys.kotson.string
|
import com.github.salomonbrys.kotson.string
|
||||||
import com.google.gson.JsonElement
|
import com.google.gson.JsonElement
|
||||||
|
@ -15,6 +16,7 @@ import eu.kanade.tachiyomi.source.model.SChapter
|
||||||
import eu.kanade.tachiyomi.source.model.SManga
|
import eu.kanade.tachiyomi.source.model.SManga
|
||||||
import eu.kanade.tachiyomi.source.online.ParsedHttpSource
|
import eu.kanade.tachiyomi.source.online.ParsedHttpSource
|
||||||
import eu.kanade.tachiyomi.util.asJsoup
|
import eu.kanade.tachiyomi.util.asJsoup
|
||||||
|
import java.nio.charset.Charset
|
||||||
import java.text.SimpleDateFormat
|
import java.text.SimpleDateFormat
|
||||||
import java.util.Locale
|
import java.util.Locale
|
||||||
import okhttp3.FormBody
|
import okhttp3.FormBody
|
||||||
|
@ -176,6 +178,7 @@ open class MangaMx : ParsedHttpSource() {
|
||||||
// Chapters
|
// Chapters
|
||||||
|
|
||||||
override fun chapterListSelector(): String = "div#c_list a"
|
override fun chapterListSelector(): String = "div#c_list a"
|
||||||
|
|
||||||
override fun chapterFromElement(element: Element): SChapter = SChapter.create().apply {
|
override fun chapterFromElement(element: Element): SChapter = SChapter.create().apply {
|
||||||
name = element.text().trim()
|
name = element.text().trim()
|
||||||
setUrlWithoutDomain(element.attr("href"))
|
setUrlWithoutDomain(element.attr("href"))
|
||||||
|
@ -189,13 +192,16 @@ open class MangaMx : ParsedHttpSource() {
|
||||||
|
|
||||||
// Pages
|
// Pages
|
||||||
|
|
||||||
override fun pageListParse(document: Document): List<Page> = mutableListOf<Page>().apply {
|
override fun pageListParse(document: Document): List<Page> {
|
||||||
val script = document.select("script:containsData(hojas)").html()
|
val encoded = document.select("script:containsData(unicap)").firstOrNull()
|
||||||
val dir = script.substringAfter("var dir = '").substringBefore("';")
|
?.data()?.substringAfter("'")?.substringBefore("'")?.reversed()
|
||||||
val imgList =
|
?: throw Exception("unicap not found")
|
||||||
script.substringAfter("var hojas = [\"").substringBefore("\"];").split("\",\"")
|
|
||||||
imgList.forEach {
|
val drop = encoded.length % 4
|
||||||
add(Page(size, "", dir + it))
|
val decoded = Base64.decode(encoded.dropLast(drop), Base64.DEFAULT).toString(Charset.defaultCharset())
|
||||||
|
val path = decoded.substringBefore("||")
|
||||||
|
return decoded.substringAfter("[").substringBefore("]").split(",").mapIndexed { i, file ->
|
||||||
|
Page(i, "", path + file.removeSurrounding("\""))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue