MangaRaw: fix page list (#14829)
This commit is contained in:
parent
b5b07b7a23
commit
7d7552af06
|
@ -1,9 +1,9 @@
|
||||||
package eu.kanade.tachiyomi.extension.ja.manga9co
|
package eu.kanade.tachiyomi.extension.ja.manga9co
|
||||||
|
|
||||||
import android.app.Application
|
import android.app.Application
|
||||||
import android.util.Base64
|
|
||||||
import androidx.preference.ListPreference
|
import androidx.preference.ListPreference
|
||||||
import androidx.preference.PreferenceScreen
|
import androidx.preference.PreferenceScreen
|
||||||
|
import eu.kanade.tachiyomi.multisrc.mangaraw.ImageListParser
|
||||||
import eu.kanade.tachiyomi.multisrc.mangaraw.MangaRawTheme
|
import eu.kanade.tachiyomi.multisrc.mangaraw.MangaRawTheme
|
||||||
import eu.kanade.tachiyomi.network.GET
|
import eu.kanade.tachiyomi.network.GET
|
||||||
import eu.kanade.tachiyomi.source.ConfigurableSource
|
import eu.kanade.tachiyomi.source.ConfigurableSource
|
||||||
|
@ -72,12 +72,8 @@ class MangaRaw : MangaRawTheme("MangaRaw", ""), ConfigurableSource {
|
||||||
override fun pageListParse(response: Response): List<Page> {
|
override fun pageListParse(response: Response): List<Page> {
|
||||||
if (!isPagesShuffled) return super.pageListParse(response)
|
if (!isPagesShuffled) return super.pageListParse(response)
|
||||||
val html = response.body!!.string()
|
val html = response.body!!.string()
|
||||||
val startText = "let ads = '"
|
val imageList = ImageListParser(html, 32).getImageList() ?: return emptyList()
|
||||||
val startIndex = html.indexOf(startText) + startText.length
|
return imageList.mapIndexed { index, imageUrl ->
|
||||||
val endIndex = html.indexOf('\'', startIndex)
|
|
||||||
val base64 = html.substring(startIndex, endIndex)
|
|
||||||
val decoded = String(Base64.decode(base64, Base64.DEFAULT))
|
|
||||||
return decoded.split(",").mapIndexed { index, imageUrl ->
|
|
||||||
Page(index, imageUrl = imageUrl)
|
Page(index, imageUrl = imageUrl)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,8 +27,8 @@ internal fun getSelectors(mirrorIndex: Int) = when (mirrorIndex) {
|
||||||
internal fun needUrlSanitize(mirrorIndex: Int) = mirrorIndex == 2
|
internal fun needUrlSanitize(mirrorIndex: Int) = mirrorIndex == 2
|
||||||
|
|
||||||
internal fun isPagesShuffled(mirrorIndex: Int) = when (mirrorIndex) {
|
internal fun isPagesShuffled(mirrorIndex: Int) = when (mirrorIndex) {
|
||||||
1, 3 -> true
|
0 -> false
|
||||||
else -> false
|
else -> true
|
||||||
}
|
}
|
||||||
|
|
||||||
internal val mangaSlugRegex = Regex("""^/mz[a-z]{4}-""")
|
internal val mangaSlugRegex = Regex("""^/mz[a-z]{4}-""")
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package eu.kanade.tachiyomi.extension.ja.mangarawru
|
package eu.kanade.tachiyomi.extension.ja.mangarawru
|
||||||
|
|
||||||
|
import eu.kanade.tachiyomi.multisrc.mangaraw.ImageListParser
|
||||||
import eu.kanade.tachiyomi.multisrc.mangaraw.MangaRawTheme
|
import eu.kanade.tachiyomi.multisrc.mangaraw.MangaRawTheme
|
||||||
import eu.kanade.tachiyomi.network.GET
|
import eu.kanade.tachiyomi.network.GET
|
||||||
import eu.kanade.tachiyomi.source.model.FilterList
|
import eu.kanade.tachiyomi.source.model.FilterList
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
package eu.kanade.tachiyomi.extension.ja.mangarawru
|
package eu.kanade.tachiyomi.multisrc.mangaraw
|
||||||
|
|
||||||
import kotlin.math.pow
|
import kotlin.math.pow
|
||||||
|
|
|
@ -12,7 +12,7 @@ class MangaRawGenerator : ThemeSourceGenerator {
|
||||||
|
|
||||||
override val sources = listOf(
|
override val sources = listOf(
|
||||||
SingleLang("SyoSetu", "https://syosetu.top", "ja"),
|
SingleLang("SyoSetu", "https://syosetu.top", "ja"),
|
||||||
SingleLang("MangaRaw", "https://manga1001.in", "ja", pkgName = "manga9co", overrideVersionCode = 1),
|
SingleLang("MangaRaw", "https://manga1001.in", "ja", pkgName = "manga9co", overrideVersionCode = 2),
|
||||||
SingleLang("MangaRawRU", "https://mangaraw.ru", "ja", overrideVersionCode = 1),
|
SingleLang("MangaRawRU", "https://mangaraw.ru", "ja", overrideVersionCode = 1),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue