2022-08-19 02:16:05 +00:00
|
|
|
package eu.kanade.tachiyomi.extension.ja.manga9co
|
|
|
|
|
2022-10-07 13:33:09 +00:00
|
|
|
/**
|
|
|
|
* https://syosetu.me/ is not added because of different HTML structure
|
|
|
|
*/
|
|
|
|
|
2022-08-19 02:16:05 +00:00
|
|
|
internal const val MIRROR_PREF = "MIRROR"
|
2022-12-16 01:37:35 +00:00
|
|
|
internal val MIRRORS get() = arrayOf("manga1001.in", "mangaraw.to", "mangaraw.io", "mangarawjp.io")
|
|
|
|
internal val PROMPT get() = "Note: 'manga1001.in' is not recommended because it might contain shuffled/unordered pages."
|
|
|
|
|
|
|
|
internal const val RANDOM_MIRROR_FROM = 1
|
|
|
|
internal const val RANDOM_MIRROR_UNTIL = 4
|
2022-08-19 02:16:05 +00:00
|
|
|
|
|
|
|
internal fun getSelectors(mirrorIndex: Int) = when (mirrorIndex) {
|
|
|
|
0, 1, 2 -> Selectors(
|
|
|
|
listMangaSelector = ".card",
|
|
|
|
detailsSelector = "div:has(> main)",
|
|
|
|
recommendClass = "container"
|
|
|
|
)
|
|
|
|
else -> Selectors(
|
|
|
|
listMangaSelector = ".post-list:not(.last-hidden) > .item",
|
|
|
|
detailsSelector = "#post-data",
|
|
|
|
recommendClass = "post-list"
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
2022-10-07 13:33:09 +00:00
|
|
|
internal fun needUrlSanitize(mirrorIndex: Int) = mirrorIndex == 2
|
|
|
|
|
2022-12-16 01:37:35 +00:00
|
|
|
internal fun isPagesShuffled(mirrorIndex: Int) = when (mirrorIndex) {
|
|
|
|
1, 3 -> true
|
|
|
|
else -> false
|
|
|
|
}
|
|
|
|
|
2022-10-07 13:33:09 +00:00
|
|
|
internal val mangaSlugRegex = Regex("""^/mz[a-z]{4}-""")
|
|
|
|
|
2022-08-19 02:16:05 +00:00
|
|
|
internal class Selectors(
|
|
|
|
val listMangaSelector: String,
|
|
|
|
val detailsSelector: String,
|
|
|
|
val recommendClass: String,
|
|
|
|
)
|