diff --git a/src/id/birdtoon/build.gradle b/src/id/birdtoon/build.gradle index 9f2394eb6af..628925baa83 100644 --- a/src/id/birdtoon/build.gradle +++ b/src/id/birdtoon/build.gradle @@ -2,8 +2,8 @@ ext { extName = 'BirdToon' extClass = '.BirdToon' themePkg = 'madara' - baseUrl = 'https://birdtoon.net' - overrideVersionCode = 0 + baseUrl = 'https://birdtoon.org' + overrideVersionCode = 1 isNsfw = true } diff --git a/src/id/birdtoon/src/eu/kanade/tachiyomi/extension/id/birdtoon/BirdToon.kt b/src/id/birdtoon/src/eu/kanade/tachiyomi/extension/id/birdtoon/BirdToon.kt index e4f9afe765e..a3b21800fe9 100644 --- a/src/id/birdtoon/src/eu/kanade/tachiyomi/extension/id/birdtoon/BirdToon.kt +++ b/src/id/birdtoon/src/eu/kanade/tachiyomi/extension/id/birdtoon/BirdToon.kt @@ -2,6 +2,12 @@ package eu.kanade.tachiyomi.extension.id.birdtoon import eu.kanade.tachiyomi.multisrc.madara.Madara -class BirdToon : Madara("BirdToon", "https://birdtoon.net", "id") { +class BirdToon : Madara( + "BirdToon", + "https://birdtoon.org", + "id", +) { override val mangaSubString = "komik" + + override val useLoadMoreRequest = LoadMoreStrategy.Never } diff --git a/src/id/klikmanga/build.gradle b/src/id/klikmanga/build.gradle index c358a9c9508..89709002c78 100644 --- a/src/id/klikmanga/build.gradle +++ b/src/id/klikmanga/build.gradle @@ -2,8 +2,8 @@ ext { extName = 'KlikManga' extClass = '.KlikManga' themePkg = 'madara' - baseUrl = 'https://klikmanga.id' - overrideVersionCode = 2 + baseUrl = 'https://klikmanga.com' + overrideVersionCode = 3 } apply from: "$rootDir/common.gradle" diff --git a/src/id/klikmanga/src/eu/kanade/tachiyomi/extension/id/klikmanga/KlikManga.kt b/src/id/klikmanga/src/eu/kanade/tachiyomi/extension/id/klikmanga/KlikManga.kt index f5d70cbfb36..492af278cbd 100644 --- a/src/id/klikmanga/src/eu/kanade/tachiyomi/extension/id/klikmanga/KlikManga.kt +++ b/src/id/klikmanga/src/eu/kanade/tachiyomi/extension/id/klikmanga/KlikManga.kt @@ -4,4 +4,13 @@ import eu.kanade.tachiyomi.multisrc.madara.Madara import java.text.SimpleDateFormat import java.util.Locale -class KlikManga : Madara("KlikManga", "https://klikmanga.id", "id", SimpleDateFormat("MMMM dd, yyyy", Locale("id"))) +class KlikManga : Madara( + "KlikManga", + "https://klikmanga.com", + "id", + SimpleDateFormat("MMMM dd, yyyy", Locale("id")), +) { + override val mangaSubString = "daftar-komik" + + override val useLoadMoreRequest = LoadMoreStrategy.Always +} diff --git a/src/id/komikindoid/build.gradle b/src/id/komikindoid/build.gradle index 34bb443ecee..1ebb6c29868 100644 --- a/src/id/komikindoid/build.gradle +++ b/src/id/komikindoid/build.gradle @@ -1,7 +1,7 @@ ext { extName = 'KomikIndoID' extClass = '.KomikIndoID' - extVersionCode = 14 + extVersionCode = 15 } apply from: "$rootDir/common.gradle" diff --git a/src/id/komikindoid/src/eu/kanade/tachiyomi/extension/id/komikindoid/KomikIndoID.kt b/src/id/komikindoid/src/eu/kanade/tachiyomi/extension/id/komikindoid/KomikIndoID.kt index 72ab153ae53..175412e16da 100644 --- a/src/id/komikindoid/src/eu/kanade/tachiyomi/extension/id/komikindoid/KomikIndoID.kt +++ b/src/id/komikindoid/src/eu/kanade/tachiyomi/extension/id/komikindoid/KomikIndoID.kt @@ -18,7 +18,7 @@ import java.util.Locale class KomikIndoID : ParsedHttpSource() { override val name = "KomikIndoID" - override val baseUrl = "https://komikindo.lol" + override val baseUrl = "https://komikindo.pw" override val lang = "id" override val supportsLatest = true override val client: OkHttpClient = network.cloudflareClient diff --git a/src/id/mgkomik/build.gradle b/src/id/mgkomik/build.gradle index 86d009fb990..b0e7240a29d 100644 --- a/src/id/mgkomik/build.gradle +++ b/src/id/mgkomik/build.gradle @@ -2,8 +2,8 @@ ext { extName = 'MG Komik' extClass = '.MGKomik' themePkg = 'madara' - baseUrl = 'https://mgkomik.id' - overrideVersionCode = 14 + baseUrl = 'https://mgkomik.org' + overrideVersionCode = 15 isNsfw = false } diff --git a/src/id/mgkomik/src/eu/kanade/tachiyomi/extension/id/mgkomik/MGKomik.kt b/src/id/mgkomik/src/eu/kanade/tachiyomi/extension/id/mgkomik/MGKomik.kt index 5ae926e412c..48923d00130 100644 --- a/src/id/mgkomik/src/eu/kanade/tachiyomi/extension/id/mgkomik/MGKomik.kt +++ b/src/id/mgkomik/src/eu/kanade/tachiyomi/extension/id/mgkomik/MGKomik.kt @@ -3,17 +3,22 @@ package eu.kanade.tachiyomi.extension.id.mgkomik import eu.kanade.tachiyomi.multisrc.madara.Madara import eu.kanade.tachiyomi.network.GET import eu.kanade.tachiyomi.network.interceptor.rateLimit +import eu.kanade.tachiyomi.source.model.Filter +import eu.kanade.tachiyomi.source.model.FilterList +import eu.kanade.tachiyomi.util.asJsoup import okhttp3.Request +import org.jsoup.nodes.Document import java.text.SimpleDateFormat import java.util.Locale class MGKomik : Madara( "MG Komik", - "https://mgkomik.id", + "https://mgkomik.org", "id", SimpleDateFormat("dd MMM yy", Locale.US), ) { override val useLoadMoreRequest = LoadMoreStrategy.Never + override val useNewChapterEndpoint = false override val mangaSubString = "komik" @@ -38,9 +43,11 @@ class MGKomik : Madara( .rateLimit(9, 2) .build() + // ================================== Popular ====================================== + override fun popularMangaNextPageSelector() = ".wp-pagenavi span.current + a" - override fun searchMangaNextPageSelector() = "a.page.larger" + // ================================== Latest ======================================= override fun latestUpdatesRequest(page: Int): Request = if (useLoadMoreRequest()) { @@ -49,8 +56,94 @@ class MGKomik : Madara( GET("$baseUrl/$mangaSubString/${searchPage(page)}", headers) } + // ================================== Search ======================================= + + override fun searchRequest(page: Int, query: String, filters: FilterList): Request { + filters.forEach { filter -> + when (filter) { + is GenreContentFilter -> { + val url = filter.toUriPart() + if (url.isBlank()) { + return@forEach + } + return GET(filter.toUriPart(), headers) + } + else -> {} + } + } + return super.searchRequest(page, query, filters) + } + + override fun searchMangaSelector() = "${super.searchMangaSelector()}, .page-listing-item .page-item-detail" + + override fun searchMangaNextPageSelector() = "a.page.larger" + + // ================================ Chapters ================================ + override val chapterUrlSuffix = "" + // ================================ Filters ================================ + + private var genresList: List = emptyList() + + override val fetchGenres = false + + override fun getFilterList(): FilterList { + launchIO { fetchGenresOption() } + + val filters = super.getFilterList().list.toMutableList() + + if (genresList.isNotEmpty()) { + filters += listOf( + Filter.Separator(), + Filter.Header(intl["genre_filter_header"]), + GenreContentFilter( + title = intl["genre_filter_title"], + options = genresList.map { it.name to it.id }, + ), + ) + } else if (fetchGenres) { + filters += listOf( + Filter.Separator(), + Filter.Header(intl["genre_missing_warning"]), + ) + } + + return FilterList(filters) + } + + private class GenreContentFilter(title: String, options: List>) : UriPartFilter( + title, + options.toTypedArray(), + ) + + override fun genresRequest() = GET("$baseUrl/$mangaSubString", headers) + + private var fetchGenresAttempts: Int = 0 + + fun fetchGenresOption() { + if (fetchGenresAttempts < 3 && genresList.isEmpty()) { + try { + genresList = client.newCall(genresRequest()).execute() + .use { parseGenres(it.asJsoup()) } + } catch (_: Exception) { + } finally { + fetchGenresAttempts++ + } + } + } + + override fun parseGenres(document: Document): List { + val genres = mutableListOf() + genres += Genre("All", "") + genres += document.select(".row.genres li a").map { a -> + Genre(a.text(), a.absUrl("href")) + } + return genres + } + + // =============================== Utilities ============================== + private fun randomString(length: Int): String { val charPool = ('a'..'z') + ('A'..'Z') + ('.') return List(length) { charPool.random() }.joinToString("") diff --git a/src/tr/mangawt/build.gradle b/src/tr/mangawt/build.gradle index 63d0d899aaf..aa6252788ae 100644 --- a/src/tr/mangawt/build.gradle +++ b/src/tr/mangawt/build.gradle @@ -2,8 +2,8 @@ ext { extName = 'MangaWT' extClass = '.MangaWT' themePkg = 'madara' - baseUrl = 'https://mangawt.net' - overrideVersionCode = 2 + baseUrl = 'https://mangawt.com' + overrideVersionCode = 3 } apply from: "$rootDir/common.gradle" diff --git a/src/tr/mangawt/src/eu/kanade/tachiyomi/extension/tr/mangawt/MangaWT.kt b/src/tr/mangawt/src/eu/kanade/tachiyomi/extension/tr/mangawt/MangaWT.kt index 4a116696015..cc35774d06a 100644 --- a/src/tr/mangawt/src/eu/kanade/tachiyomi/extension/tr/mangawt/MangaWT.kt +++ b/src/tr/mangawt/src/eu/kanade/tachiyomi/extension/tr/mangawt/MangaWT.kt @@ -1,11 +1,16 @@ package eu.kanade.tachiyomi.extension.tr.mangawt import eu.kanade.tachiyomi.multisrc.madara.Madara +import java.text.SimpleDateFormat +import java.util.Locale class MangaWT : Madara( "MangaWT", - "https://mangawt.net", + "https://mangawt.com", "tr", + dateFormat = SimpleDateFormat("MMMM dd, yyyy", Locale("tr")), ) { override val useNewChapterEndpoint = true + + override val useLoadMoreRequest = LoadMoreStrategy.Always }