diff --git a/multisrc/overrides/zeistmanga/mangaailand/res/mipmap-hdpi/ic_launcher.png b/multisrc/overrides/zeistmanga/mangaailand/res/mipmap-hdpi/ic_launcher.png new file mode 100644 index 000000000..ec8cdca87 Binary files /dev/null and b/multisrc/overrides/zeistmanga/mangaailand/res/mipmap-hdpi/ic_launcher.png differ diff --git a/multisrc/overrides/zeistmanga/mangaailand/res/mipmap-mdpi/ic_launcher.png b/multisrc/overrides/zeistmanga/mangaailand/res/mipmap-mdpi/ic_launcher.png new file mode 100644 index 000000000..8825b6af7 Binary files /dev/null and b/multisrc/overrides/zeistmanga/mangaailand/res/mipmap-mdpi/ic_launcher.png differ diff --git a/multisrc/overrides/zeistmanga/mangaailand/res/mipmap-xhdpi/ic_launcher.png b/multisrc/overrides/zeistmanga/mangaailand/res/mipmap-xhdpi/ic_launcher.png new file mode 100644 index 000000000..18d5982ed Binary files /dev/null and b/multisrc/overrides/zeistmanga/mangaailand/res/mipmap-xhdpi/ic_launcher.png differ diff --git a/multisrc/overrides/zeistmanga/mangaailand/res/mipmap-xxhdpi/ic_launcher.png b/multisrc/overrides/zeistmanga/mangaailand/res/mipmap-xxhdpi/ic_launcher.png new file mode 100644 index 000000000..7ee4dac4e Binary files /dev/null and b/multisrc/overrides/zeistmanga/mangaailand/res/mipmap-xxhdpi/ic_launcher.png differ diff --git a/multisrc/overrides/zeistmanga/mangaailand/res/mipmap-xxxhdpi/ic_launcher.png b/multisrc/overrides/zeistmanga/mangaailand/res/mipmap-xxxhdpi/ic_launcher.png new file mode 100644 index 000000000..273b22b5c Binary files /dev/null and b/multisrc/overrides/zeistmanga/mangaailand/res/mipmap-xxxhdpi/ic_launcher.png differ diff --git a/multisrc/overrides/zeistmanga/mangaailand/res/web_hi_res_512.png b/multisrc/overrides/zeistmanga/mangaailand/res/web_hi_res_512.png new file mode 100644 index 000000000..9263cc7ba Binary files /dev/null and b/multisrc/overrides/zeistmanga/mangaailand/res/web_hi_res_512.png differ diff --git a/multisrc/overrides/zeistmanga/mangaailand/src/MangaAiLand.kt b/multisrc/overrides/zeistmanga/mangaailand/src/MangaAiLand.kt new file mode 100644 index 000000000..7fe3192f6 --- /dev/null +++ b/multisrc/overrides/zeistmanga/mangaailand/src/MangaAiLand.kt @@ -0,0 +1,22 @@ +package eu.kanade.tachiyomi.extension.ar.mangaailand + +import eu.kanade.tachiyomi.multisrc.zeistmanga.ZeistManga +import org.jsoup.nodes.Document + +class MangaAiLand : ZeistManga("Manga Ai Land", "https://manga-ai-land.blogspot.com", "ar") { + + override val chapterFeedRegex = """([^']+)\?""".toRegex() + override val scriptSelector = "#myUL > script" + override val imgSelector = "a[href]" + override val imgSelectorAttr = "href" + + override fun getChaptersUrl(doc: Document): String { + val script = doc.selectFirst(scriptSelector).attr("src") + val feed = chapterFeedRegex + .find(script) + ?.groupValues?.get(1) + ?: throw Exception("Failed to find chapter feed") + + return "$baseUrl" + feed + "?alt=json&start-index=2&max-results=999999" + } +} diff --git a/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/zeistmanga/ZeistManga.kt b/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/zeistmanga/ZeistManga.kt index 8204f5b89..075806e26 100644 --- a/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/zeistmanga/ZeistManga.kt +++ b/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/zeistmanga/ZeistManga.kt @@ -25,13 +25,14 @@ abstract class ZeistManga( ) : ParsedHttpSource() { override val supportsLatest = false - private val json: Json by injectLazy() + val json: Json by injectLazy() + open val chapterFeedRegex = """clwd\.run\('([^']+)'""".toRegex() + open val scriptSelector = "#clwd > script" + open val imgSelector = "img[src]" + open val imgSelectorAttr = "src" - override fun chapterListParse(response: Response): List { - val document = response.asJsoup() - - // Find chapter feed name (ZeistManga v5) - val script = document.selectFirst("#clwd > script") + open fun getChaptersUrl(doc: Document): String { + val script = doc.selectFirst(scriptSelector) val feed = chapterFeedRegex .find(script.html()) ?.groupValues?.get(1) @@ -41,9 +42,16 @@ abstract class ZeistManga( .addQueryParameter("start-index", "2") // Only get chapters .addQueryParameter("max-results", "999999") // Get all chapters .build() + return url.toString() + } + + override fun chapterListParse(response: Response): List { + val document = response.asJsoup() + + val url = getChaptersUrl(document) // Call JSON API - val req = GET(url.toString(), headers) + val req = GET(url, headers) val res = client.newCall(req).execute() // Parse JSON API response @@ -104,15 +112,15 @@ abstract class ZeistManga( return SManga.create().apply { title = profileManga.selectFirst("h1.mt-0.mb-6.fs-20").text() thumbnail_url = profileManga.selectFirst("img").attr("src") - description = profileManga.selectFirst("#synopsis").text() + description = profileManga.select("#synopsis").text() status = SManga.UNKNOWN } } override fun pageListParse(document: Document): List { - val images = document.selectFirst(".check-box") - return images.select("img").mapIndexed { i, img -> - Page(i, "", img.attr("src")) + val images = document.selectFirst("div.check-box") + return images.select(imgSelector).mapIndexed { i, img -> + Page(i, "", img.attr(imgSelectorAttr)) } } @@ -167,6 +175,5 @@ abstract class ZeistManga( companion object { private const val maxResults = 20 - private val chapterFeedRegex = """clwd\.run\('([^']+)'""".toRegex() } } diff --git a/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/zeistmanga/ZeistMangaGenerator.kt b/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/zeistmanga/ZeistMangaGenerator.kt index 18dd162d7..c2846620f 100644 --- a/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/zeistmanga/ZeistMangaGenerator.kt +++ b/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/zeistmanga/ZeistMangaGenerator.kt @@ -9,10 +9,11 @@ class ZeistMangaGenerator : ThemeSourceGenerator { override val themeClass = "ZeistManga" - override val baseVersionCode: Int = 1 + override val baseVersionCode: Int = 2 override val sources = listOf( SingleLang("DatGarScanlation", "https://datgarscanlation.blogspot.com", "es"), + SingleLang("Manga Ai Land", "https://manga-ai-land.blogspot.com", "ar"), ) companion object {