Update domains (#6521)

* Update domains

* Update domain and enable genre filters
This commit is contained in:
Chopper 2024-12-07 18:02:04 -03:00 committed by Draff
parent b4f081e28b
commit 9ae0fcfc3e
No known key found for this signature in database
GPG Key ID: E8A89F3211677653
10 changed files with 128 additions and 15 deletions

View File

@ -2,8 +2,8 @@ ext {
extName = 'BirdToon' extName = 'BirdToon'
extClass = '.BirdToon' extClass = '.BirdToon'
themePkg = 'madara' themePkg = 'madara'
baseUrl = 'https://birdtoon.net' baseUrl = 'https://birdtoon.org'
overrideVersionCode = 0 overrideVersionCode = 1
isNsfw = true isNsfw = true
} }

View File

@ -2,6 +2,12 @@ package eu.kanade.tachiyomi.extension.id.birdtoon
import eu.kanade.tachiyomi.multisrc.madara.Madara 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 mangaSubString = "komik"
override val useLoadMoreRequest = LoadMoreStrategy.Never
} }

View File

@ -2,8 +2,8 @@ ext {
extName = 'KlikManga' extName = 'KlikManga'
extClass = '.KlikManga' extClass = '.KlikManga'
themePkg = 'madara' themePkg = 'madara'
baseUrl = 'https://klikmanga.id' baseUrl = 'https://klikmanga.com'
overrideVersionCode = 2 overrideVersionCode = 3
} }
apply from: "$rootDir/common.gradle" apply from: "$rootDir/common.gradle"

View File

@ -4,4 +4,13 @@ import eu.kanade.tachiyomi.multisrc.madara.Madara
import java.text.SimpleDateFormat import java.text.SimpleDateFormat
import java.util.Locale 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
}

View File

@ -1,7 +1,7 @@
ext { ext {
extName = 'KomikIndoID' extName = 'KomikIndoID'
extClass = '.KomikIndoID' extClass = '.KomikIndoID'
extVersionCode = 14 extVersionCode = 15
} }
apply from: "$rootDir/common.gradle" apply from: "$rootDir/common.gradle"

View File

@ -18,7 +18,7 @@ import java.util.Locale
class KomikIndoID : ParsedHttpSource() { class KomikIndoID : ParsedHttpSource() {
override val name = "KomikIndoID" override val name = "KomikIndoID"
override val baseUrl = "https://komikindo.lol" override val baseUrl = "https://komikindo.pw"
override val lang = "id" override val lang = "id"
override val supportsLatest = true override val supportsLatest = true
override val client: OkHttpClient = network.cloudflareClient override val client: OkHttpClient = network.cloudflareClient

View File

@ -2,8 +2,8 @@ ext {
extName = 'MG Komik' extName = 'MG Komik'
extClass = '.MGKomik' extClass = '.MGKomik'
themePkg = 'madara' themePkg = 'madara'
baseUrl = 'https://mgkomik.id' baseUrl = 'https://mgkomik.org'
overrideVersionCode = 14 overrideVersionCode = 15
isNsfw = false isNsfw = false
} }

View File

@ -3,17 +3,22 @@ package eu.kanade.tachiyomi.extension.id.mgkomik
import eu.kanade.tachiyomi.multisrc.madara.Madara import eu.kanade.tachiyomi.multisrc.madara.Madara
import eu.kanade.tachiyomi.network.GET import eu.kanade.tachiyomi.network.GET
import eu.kanade.tachiyomi.network.interceptor.rateLimit 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 okhttp3.Request
import org.jsoup.nodes.Document
import java.text.SimpleDateFormat import java.text.SimpleDateFormat
import java.util.Locale import java.util.Locale
class MGKomik : Madara( class MGKomik : Madara(
"MG Komik", "MG Komik",
"https://mgkomik.id", "https://mgkomik.org",
"id", "id",
SimpleDateFormat("dd MMM yy", Locale.US), SimpleDateFormat("dd MMM yy", Locale.US),
) { ) {
override val useLoadMoreRequest = LoadMoreStrategy.Never override val useLoadMoreRequest = LoadMoreStrategy.Never
override val useNewChapterEndpoint = false override val useNewChapterEndpoint = false
override val mangaSubString = "komik" override val mangaSubString = "komik"
@ -38,9 +43,11 @@ class MGKomik : Madara(
.rateLimit(9, 2) .rateLimit(9, 2)
.build() .build()
// ================================== Popular ======================================
override fun popularMangaNextPageSelector() = ".wp-pagenavi span.current + a" override fun popularMangaNextPageSelector() = ".wp-pagenavi span.current + a"
override fun searchMangaNextPageSelector() = "a.page.larger" // ================================== Latest =======================================
override fun latestUpdatesRequest(page: Int): Request = override fun latestUpdatesRequest(page: Int): Request =
if (useLoadMoreRequest()) { if (useLoadMoreRequest()) {
@ -49,8 +56,94 @@ class MGKomik : Madara(
GET("$baseUrl/$mangaSubString/${searchPage(page)}", headers) 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 = "" override val chapterUrlSuffix = ""
// ================================ Filters ================================
private var genresList: List<Genre> = 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<Pair<String, String>>) : 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<Genre> {
val genres = mutableListOf<Genre>()
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 { private fun randomString(length: Int): String {
val charPool = ('a'..'z') + ('A'..'Z') + ('.') val charPool = ('a'..'z') + ('A'..'Z') + ('.')
return List(length) { charPool.random() }.joinToString("") return List(length) { charPool.random() }.joinToString("")

View File

@ -2,8 +2,8 @@ ext {
extName = 'MangaWT' extName = 'MangaWT'
extClass = '.MangaWT' extClass = '.MangaWT'
themePkg = 'madara' themePkg = 'madara'
baseUrl = 'https://mangawt.net' baseUrl = 'https://mangawt.com'
overrideVersionCode = 2 overrideVersionCode = 3
} }
apply from: "$rootDir/common.gradle" apply from: "$rootDir/common.gradle"

View File

@ -1,11 +1,16 @@
package eu.kanade.tachiyomi.extension.tr.mangawt package eu.kanade.tachiyomi.extension.tr.mangawt
import eu.kanade.tachiyomi.multisrc.madara.Madara import eu.kanade.tachiyomi.multisrc.madara.Madara
import java.text.SimpleDateFormat
import java.util.Locale
class MangaWT : Madara( class MangaWT : Madara(
"MangaWT", "MangaWT",
"https://mangawt.net", "https://mangawt.com",
"tr", "tr",
dateFormat = SimpleDateFormat("MMMM dd, yyyy", Locale("tr")),
) { ) {
override val useNewChapterEndpoint = true override val useNewChapterEndpoint = true
override val useLoadMoreRequest = LoadMoreStrategy.Always
} }