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'
extClass = '.BirdToon'
themePkg = 'madara'
baseUrl = 'https://birdtoon.net'
overrideVersionCode = 0
baseUrl = 'https://birdtoon.org'
overrideVersionCode = 1
isNsfw = true
}

View File

@ -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
}

View File

@ -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"

View File

@ -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
}

View File

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

View File

@ -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

View File

@ -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
}

View File

@ -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<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 {
val charPool = ('a'..'z') + ('A'..'Z') + ('.')
return List(length) { charPool.random() }.joinToString("")

View File

@ -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"

View File

@ -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
}