From bf539439848b1849f8f8842c18c982f62a8e7882 Mon Sep 17 00:00:00 2001 From: beerpsi <92439990+beerpiss@users.noreply.github.com> Date: Sat, 17 Feb 2024 15:55:11 +0700 Subject: [PATCH] Add Manga Planet (#1319) --- src/en/mangaplanet/build.gradle | 12 ++ .../res/mipmap-hdpi/ic_launcher.png | Bin 0 -> 2618 bytes .../res/mipmap-mdpi/ic_launcher.png | Bin 0 -> 1338 bytes .../res/mipmap-xhdpi/ic_launcher.png | Bin 0 -> 3423 bytes .../res/mipmap-xxhdpi/ic_launcher.png | Bin 0 -> 6629 bytes .../res/mipmap-xxxhdpi/ic_launcher.png | Bin 0 -> 9380 bytes .../en/mangaplanet/CookieInterceptor.kt | 46 +++++ .../extension/en/mangaplanet/Filters.kt | 133 ++++++++++++ .../extension/en/mangaplanet/MangaPlanet.kt | 194 ++++++++++++++++++ 9 files changed, 385 insertions(+) create mode 100644 src/en/mangaplanet/build.gradle create mode 100644 src/en/mangaplanet/res/mipmap-hdpi/ic_launcher.png create mode 100644 src/en/mangaplanet/res/mipmap-mdpi/ic_launcher.png create mode 100644 src/en/mangaplanet/res/mipmap-xhdpi/ic_launcher.png create mode 100644 src/en/mangaplanet/res/mipmap-xxhdpi/ic_launcher.png create mode 100644 src/en/mangaplanet/res/mipmap-xxxhdpi/ic_launcher.png create mode 100644 src/en/mangaplanet/src/eu/kanade/tachiyomi/extension/en/mangaplanet/CookieInterceptor.kt create mode 100644 src/en/mangaplanet/src/eu/kanade/tachiyomi/extension/en/mangaplanet/Filters.kt create mode 100644 src/en/mangaplanet/src/eu/kanade/tachiyomi/extension/en/mangaplanet/MangaPlanet.kt diff --git a/src/en/mangaplanet/build.gradle b/src/en/mangaplanet/build.gradle new file mode 100644 index 000000000..6a8362cfe --- /dev/null +++ b/src/en/mangaplanet/build.gradle @@ -0,0 +1,12 @@ +ext { + extName = "Manga Planet" + extClass = ".MangaPlanet" + extVersionCode = 1 + isNsfw = true +} + +apply from: "$rootDir/common.gradle" + +dependencies { + implementation(project(":lib:speedbinb")) +} diff --git a/src/en/mangaplanet/res/mipmap-hdpi/ic_launcher.png b/src/en/mangaplanet/res/mipmap-hdpi/ic_launcher.png new file mode 100644 index 0000000000000000000000000000000000000000..815193d287930214beca629d8324bafbf7d0d619 GIT binary patch literal 2618 zcmV-A3dQw_P)bWXvnrf=4rkZMM)=JFa>qO{!HcN#@^`8Kw{pnAC${caT5eLQN@egX6 zmSPr5N?ESeYOi&4bUb+c@yAa9^4|fZ-+c4U3y(hf=pX93zON7>0~pM1IY7~M-Dfs$ z-h9Dnr=2zkxc>?u?b>Uv&41wwU-)$_7CV+XDBHI0`N0o-^2sM33g`ec1!N?X$qx%5vdmFUmJH7w9|8+gKTDn)Hxa?9T-Ie843I7a7p%x~)S@IQL*wt= zMK<@AsW^TCo`NI+6iN{Q3*giNDwwcb3SOWIl+KhQG0-$Bmcyo(y4m#Bu>Ui+lV7Co z?l1F^T+Fvwg8_o2NrMk&V|12ne$`p<@1`!O+b0A^`623X;JqwT;jhsIzBC=BX#fnD zs{HKPF5VnB3EOJ0=6Y5xanjNZtx>(P`XB`a^Yk-iQ+J8i3Z}n0ZOlZ_0TdxPU7rh=6i^2ez7C@Y6=YFertNa?TLW|zr!#>qwW#%vTd z0VzWO@NUWG^$8n*p_;>J%|(Xl4NTV@8wEZ*Ri_;$ANrQ*Y^sBNccj2=-39hplwt4o z6wHriw0#g#@|14OMPqLvs z%|c!IEk)IlY^gY`O-G1o4Q4Sycg>ObPw$R9Z7E&AvV?(-LdluIQLdWi<4QCk*lTGE z%W`p^?i=Uj!6L3wK9q%V9Ycu5wAl8~M=}IK0H!Mu3LyM(MMQulgUn((cv4ZPC4hVs zKDDHcg6Z(^)-fVNP_b;J^1F6_<(d@_t6B&G3T!DEs07(TFa}nMY8sZ3JHk=ZH7KSF zKIG9!SP5PoD$!l6QKzN>Vm57eXaX`34Gqxz3{jwVghMd@lI`vUj)EZC;s$4|ZDFib z;qmTKA5M4znV8|*&Z~QV=Wa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v`ULuH`V#sY`Ud(Y`sP0Bn*;-u#ifFc%E-gI`W+R5 z8+{CYGJU3+_WAS$ebncx49-%S980@9`d*UO?MScw6EFH``q(~h!N5ypqPN|49DhII zffn}^*7tGiR2BnOHvRt>ch#1bl9G~=l9K9O`WFmyFLaBzvM>Mu002ovPDHLkV1m(u BzE%JL literal 0 HcmV?d00001 diff --git a/src/en/mangaplanet/res/mipmap-xxhdpi/ic_launcher.png b/src/en/mangaplanet/res/mipmap-xxhdpi/ic_launcher.png new file mode 100644 index 0000000000000000000000000000000000000000..5ee8a6a3fab44e4688b6b21f15b27e4522ab5002 GIT binary patch literal 6629 zcmXw81yCG7ug3M@aCdk2;!xaOiyp4U4vHLJpa&ER#f!TgZUuU1fdVa3yc~8#ic_H2 z)Bm+Hl0z4W#6ciK!O$}9}XP*9_g@g4>k!o9AC@9qRnyN}B z;FY6%@pCdmD(t7@UlC-d{jgo&ytz6C zlRn${e+)k9imKTg5CKNz3MgP#z*Qk5>!;?I-l?8q-j2OX%)vG5QA@GWs}E_m9#uYN zh9j)y3fucqZ~h+L)R{Lef{QwP&Fa=gN5f%6+&-~tW&WQ{c<3V@{$2IpQwr!fi{$DN zaQ}FlH)7V%bNIbX-IF(KBGhS065qdqi`F*$@%~n#GuP)QO|a^>r{TGW$A>#xqgzqR zzIe8K-iXM*N6UJhwiv|w4%*w@!GBi5px7jFUVm?=3tz0dy10bF-;JkL=^jnEw9XYF z3%5UUzRz)lfkS7CBYK2GjR&^q;7X&jW)hwn~g(feq_hMp+#wtrPw z(}i6hucP88?QM^xRjp-56#&~Y=nWE=cvC6x;;|`6bZbn)1gul{E9sT6=XrvY(YKr% z%6ZN2TXXD09B51M0mQk5CcPn6rL?sEH&WaN7@+JUaF;(tICp{R}Vzes}oA8`H; zEb-5R(y_PVL*{A<%P;VoC0e-fnl`OEgF^m`)}CIY5Ye^eY@=EYe|?-rLp}^%*OLgM zl_NGHF5ANE2<%*HubY75&oiUb9O(0lggO4wYlPJY*6HPuC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^3^ZcI^N1u5da)T7ZO0q)gKQ5TT&w6t znOir3=M`%5F?`$y0CRX&P-}ob*5v&r@K-IWjs3xrx={~SK(pN zis1Fc=w(UKn&DAm*RR~NJ`cVsI$gg@WDivSMfx>-`pNm, +) : Filter.Group(name, options), UrlFilter { + override fun addToUrl(builder: HttpUrl.Builder) { + val enabled = state.filter { it.state } + + if (enabled.isEmpty() || enabled.size == state.size) { + return + } + + builder.addQueryParameter( + queryParameter, + enabled.joinToString(",") { it.value }, + ) + } +} + +class MultiSelectOption(name: String, val value: String, state: Boolean = false) : Filter.CheckBox(name, state) + +open class SelectFilter( + name: String, + val queryParameter: String, + val vals: Array>, + state: Int = 0, +) : Filter.Select(name, vals.map { it.first }.toTypedArray(), state), UrlFilter { + override fun addToUrl(builder: HttpUrl.Builder) { + if (state == 0) { + return + } + + builder.addQueryParameter(queryParameter, vals[state].second) + } +} diff --git a/src/en/mangaplanet/src/eu/kanade/tachiyomi/extension/en/mangaplanet/MangaPlanet.kt b/src/en/mangaplanet/src/eu/kanade/tachiyomi/extension/en/mangaplanet/MangaPlanet.kt new file mode 100644 index 000000000..27be22be6 --- /dev/null +++ b/src/en/mangaplanet/src/eu/kanade/tachiyomi/extension/en/mangaplanet/MangaPlanet.kt @@ -0,0 +1,194 @@ +package eu.kanade.tachiyomi.extension.en.mangaplanet + +import eu.kanade.tachiyomi.lib.speedbinb.SpeedBinbInterceptor +import eu.kanade.tachiyomi.lib.speedbinb.SpeedBinbReader +import eu.kanade.tachiyomi.network.GET +import eu.kanade.tachiyomi.source.model.FilterList +import eu.kanade.tachiyomi.source.model.Page +import eu.kanade.tachiyomi.source.model.SChapter +import eu.kanade.tachiyomi.source.model.SManga +import eu.kanade.tachiyomi.source.online.ParsedHttpSource +import eu.kanade.tachiyomi.util.asJsoup +import kotlinx.serialization.json.Json +import okhttp3.HttpUrl.Companion.toHttpUrl +import okhttp3.Request +import okhttp3.Response +import org.jsoup.nodes.Document +import org.jsoup.nodes.Element +import uy.kohesive.injekt.Injekt +import uy.kohesive.injekt.api.get +import java.text.SimpleDateFormat +import java.util.Locale + +class MangaPlanet : ParsedHttpSource() { + + override val name = "Manga Planet" + + override val baseUrl = "https://mangaplanet.com" + + override val lang = "en" + + override val supportsLatest = false + + // No need to be lazy if you're going to use it immediately below. + private val json = Injekt.get() + + override val client = network.client.newBuilder() + .addInterceptor(SpeedBinbInterceptor(json)) + .addInterceptor(CookieInterceptor(baseUrl.toHttpUrl().host, "mpaconf", "18")) + .build() + + override fun headersBuilder() = super.headersBuilder() + .add("Referer", "$baseUrl/") + + override fun popularMangaRequest(page: Int) = GET("$baseUrl/browse/title?ttlpage=$page", headers) + + override fun popularMangaSelector() = ".book-list" + + override fun popularMangaFromElement(element: Element) = SManga.create().apply { + setUrlWithoutDomain(element.selectFirst("a")!!.attr("href")) + title = element.selectFirst("h3")!!.text() + author = element.selectFirst("p:has(.fa-pen-nib)")?.text() + description = element.selectFirst("h3 + p")?.text() + thumbnail_url = element.selectFirst("img")?.absUrl("data-src") + status = when { + element.selectFirst(".fa-flag-alt") != null -> SManga.COMPLETED + element.selectFirst(".fa-arrow-right") != null -> SManga.ONGOING + else -> SManga.UNKNOWN + } + } + + override fun popularMangaNextPageSelector() = "ul.pagination a.page-link[rel=next]" + + override fun latestUpdatesRequest(page: Int) = throw UnsupportedOperationException() + + override fun latestUpdatesSelector() = throw UnsupportedOperationException() + + override fun latestUpdatesFromElement(element: Element) = throw UnsupportedOperationException() + + override fun latestUpdatesNextPageSelector() = throw UnsupportedOperationException() + + override fun searchMangaRequest(page: Int, query: String, filters: FilterList): Request { + val url = baseUrl.toHttpUrl().newBuilder().apply { + if (query.isNotEmpty()) { + addPathSegment("search") + addQueryParameter("keyword", query) + } else { + addPathSegments("browse/title") + } + + filters.ifEmpty { getFilterList() } + .filterIsInstance() + .forEach { it.addToUrl(this) } + + if (page > 1) { + addQueryParameter("ttlpage", page.toString()) + } + }.build() + + return GET(url, headers) + } + + override fun searchMangaSelector() = popularMangaSelector() + + override fun searchMangaFromElement(element: Element) = popularMangaFromElement(element) + + override fun searchMangaNextPageSelector() = popularMangaNextPageSelector() + + override fun mangaDetailsParse(document: Document): SManga { + val alternativeTitles = document.selectFirst("h3#manga_title + p")!! + .textNodes() + .filterNot { it.text().isBlank() } + .joinToString { it.text() } + + return SManga.create().apply { + title = document.selectFirst("h3#manga_title")!!.text() + author = document.select("h3:has(.fa-pen-nib) a").joinToString { it.text() } + description = buildString { + append("Alternative Titles: ") + appendLine(alternativeTitles) + appendLine() + appendLine(document.selectFirst("h3#manga_title ~ p:eq(2)")!!.text()) + } + genre = buildList { + document.select("h3:has(.fa-layer-group) a") + .map { it.text() } + .let { addAll(it) } + document.select(".fa-pepper-hot").size + .takeIf { it > 0 } + ?.let { add("🌶️".repeat(it)) } + document.select(".tags-btn button") + .map { it.text() } + .let { addAll(it) } + document.selectFirst("span:has(.fa-book-spells, .fa-book)")?.let { add(it.text()) } + document.selectFirst("span:has(.fa-user-friends)")?.let { add(it.text()) } + } + .joinToString() + status = when { + document.selectFirst(".fa-flag-alt") != null -> SManga.COMPLETED + document.selectFirst(".fa-arrow-right") != null -> SManga.ONGOING + else -> SManga.UNKNOWN + } + thumbnail_url = document.selectFirst("img.img-thumbnail")?.absUrl("data-src") + } + } + + override fun chapterListSelector() = "ul.ep_ul li.list-group-item" + + override fun chapterFromElement(element: Element) = SChapter.create().apply { + element.selectFirst("h3 p")!!.let { + val id = it.id().substringAfter("epi_title_") + + url = "/reader?cid=$id" + name = it.text() + } + + date_upload = try { + val date = element.selectFirst("p")!!.ownText() + + dateFormat.parse(date)!!.time + } catch (_: Exception) { + 0L + } + } + + override fun chapterListParse(response: Response): List { + val document = response.asJsoup() + + return document.select(chapterListSelector()) + .filter { e -> + e.selectFirst("p")?.ownText()?.contains("Arrives on") != true + } + .map { chapterFromElement(it) } + .reversed() + } + + private val reader by lazy { SpeedBinbReader(client, headers, json) } + + override fun pageListParse(document: Document): List { + if (document.selectFirst("a[href\$=account/sign-up]") != null) { + throw Exception("Sign up in WebView to read this chapter") + } + + if (document.selectFirst("a:contains(UNLOCK NOW)") != null) { + throw Exception("Purchase this chapter in WebView") + } + + return reader.pageListParse(document) + } + + override fun imageUrlParse(document: Document) = throw UnsupportedOperationException() + + override fun getFilterList() = FilterList( + SortFilter(), + AccessTypeFilter(), + ReleaseStatusFilter(), + LetterFilter(), + CategoryFilter(), + SpicyLevelFilter(), + FormatFilter(), + RatingFilter(), + ) +} + +private val dateFormat = SimpleDateFormat("MMMM d, yyyy", Locale.ENGLISH)