diff --git a/lib-multisrc/zeistmanga/build.gradle.kts b/lib-multisrc/zeistmanga/build.gradle.kts index 6b8a110f9..d1d9afd6e 100644 --- a/lib-multisrc/zeistmanga/build.gradle.kts +++ b/lib-multisrc/zeistmanga/build.gradle.kts @@ -2,4 +2,4 @@ plugins { id("lib-multisrc") } -baseVersionCode = 8 +baseVersionCode = 9 diff --git a/lib-multisrc/zeistmanga/src/eu/kanade/tachiyomi/multisrc/zeistmanga/ZeistManga.kt b/lib-multisrc/zeistmanga/src/eu/kanade/tachiyomi/multisrc/zeistmanga/ZeistManga.kt index ca757bdb2..49e69121a 100644 --- a/lib-multisrc/zeistmanga/src/eu/kanade/tachiyomi/multisrc/zeistmanga/ZeistManga.kt +++ b/lib-multisrc/zeistmanga/src/eu/kanade/tachiyomi/multisrc/zeistmanga/ZeistManga.kt @@ -27,7 +27,7 @@ abstract class ZeistManga( override val supportsLatest = true - private val json: Json by injectLazy() + protected val json: Json by injectLazy() private val intl by lazy { ZeistMangaIntl(lang) } @@ -63,23 +63,7 @@ abstract class ZeistManga( return GET(url, headers) } - override fun latestUpdatesParse(response: Response): MangasPage { - val jsonString = response.body.string() - val result = json.decodeFromString(jsonString) - - val mangas = result.feed?.entry.orEmpty() - .filter { it.category.orEmpty().any { category -> category.term == "Series" } } - .filter { !it.category.orEmpty().any { category -> category.term == "Anime" } } - .map { it.toSManga(baseUrl) } - - val mangalist = mangas.toMutableList() - if (mangas.size == maxMangaResults + 1) { - mangalist.removeLast() - return MangasPage(mangalist, true) - } - - return MangasPage(mangalist, false) - } + override fun latestUpdatesParse(response: Response) = searchMangaParse(response) override fun searchMangaRequest(page: Int, query: String, filters: FilterList): Request { val startIndex = maxMangaResults * (page - 1) + 1 @@ -123,7 +107,25 @@ abstract class ZeistManga( return GET(url.build(), headers) } - override fun searchMangaParse(response: Response) = latestUpdatesParse(response) + protected open val excludedCategories: List = listOf("Anime") + + override fun searchMangaParse(response: Response): MangasPage { + val jsonString = response.body.string() + val result = json.decodeFromString(jsonString) + + val mangas = result.feed?.entry.orEmpty() + .filter { it.category.orEmpty().any { category -> category.term == "Series" } } // Default category for all series + .filterNot { it.category.orEmpty().any { category -> excludedCategories.contains(category.term) } } + .map { it.toSManga(baseUrl) } + + val mangalist = mangas.toMutableList() + if (mangas.size == maxMangaResults + 1) { + mangalist.removeLast() + return MangasPage(mangalist, true) + } + + return MangasPage(mangalist, false) + } protected open val statusSelectorList = listOf( "Status", @@ -199,13 +201,9 @@ abstract class ZeistManga( val document = response.asJsoup() val url = getChapterFeedUrl(document) + val res = client.newCall(GET(url, headers)).execute() - val req = GET(url, headers) - val res = client.newCall(req).execute() - - val jsonString = res.body.string() - val result = json.decodeFromString(jsonString) - + val result = json.decodeFromString(res.body.string()) return result.feed?.entry?.filter { it.category.orEmpty().any { category -> category.term == chapterCategory } } ?.map { it.toSChapter(baseUrl) } ?: throw Exception("Failed to parse from chapter API") @@ -392,6 +390,7 @@ abstract class ZeistManga( "ongoing", "en curso", "en emisión", + "activo", "ativo", "lançando", "مستمر", @@ -400,10 +399,12 @@ abstract class ZeistManga( protected open val statusCompletedList = listOf( "completed", "completo", + "finalizado", ) protected open val statusHiatusList = listOf( "hiatus", + "pausado", ) protected open val statusCancelledList = listOf( diff --git a/src/ar/yokai/src/eu/kanade/tachiyomi/extension/ar/yokai/Yokai.kt b/src/ar/yokai/src/eu/kanade/tachiyomi/extension/ar/yokai/Yokai.kt index adf341392..644c4a0cd 100644 --- a/src/ar/yokai/src/eu/kanade/tachiyomi/extension/ar/yokai/Yokai.kt +++ b/src/ar/yokai/src/eu/kanade/tachiyomi/extension/ar/yokai/Yokai.kt @@ -5,13 +5,10 @@ import eu.kanade.tachiyomi.multisrc.zeistmanga.ZeistMangaDto import eu.kanade.tachiyomi.network.GET import eu.kanade.tachiyomi.source.model.SChapter import eu.kanade.tachiyomi.util.asJsoup -import kotlinx.serialization.json.Json import kotlinx.serialization.json.decodeFromStream import okhttp3.Response -import uy.kohesive.injekt.injectLazy class Yokai : ZeistManga("Yokai", "https://yokai-team.blogspot.com", "ar") { - private val json: Json by injectLazy() // ============================== Chapters ============================== override fun chapterListParse(response: Response): List { diff --git a/src/es/gistamishouse/build.gradle b/src/es/gistamishouse/build.gradle new file mode 100644 index 000000000..cb1bdb500 --- /dev/null +++ b/src/es/gistamishouse/build.gradle @@ -0,0 +1,10 @@ +ext { + extName = 'Gistamis House' + extClass = '.GistamisHouse' + themePkg = 'zeistmanga' + baseUrl = 'https://gistamishousefansub.blogspot.com' + overrideVersionCode = 0 + isNsfw = true +} + +apply from: "$rootDir/common.gradle" diff --git a/src/es/gistamishouse/res/mipmap-hdpi/ic_launcher.png b/src/es/gistamishouse/res/mipmap-hdpi/ic_launcher.png new file mode 100644 index 000000000..0eb497e49 Binary files /dev/null and b/src/es/gistamishouse/res/mipmap-hdpi/ic_launcher.png differ diff --git a/src/es/gistamishouse/res/mipmap-mdpi/ic_launcher.png b/src/es/gistamishouse/res/mipmap-mdpi/ic_launcher.png new file mode 100644 index 000000000..e6e74a6cb Binary files /dev/null and b/src/es/gistamishouse/res/mipmap-mdpi/ic_launcher.png differ diff --git a/src/es/gistamishouse/res/mipmap-xhdpi/ic_launcher.png b/src/es/gistamishouse/res/mipmap-xhdpi/ic_launcher.png new file mode 100644 index 000000000..3cf6f8682 Binary files /dev/null and b/src/es/gistamishouse/res/mipmap-xhdpi/ic_launcher.png differ diff --git a/src/es/gistamishouse/res/mipmap-xxhdpi/ic_launcher.png b/src/es/gistamishouse/res/mipmap-xxhdpi/ic_launcher.png new file mode 100644 index 000000000..8c76775bc Binary files /dev/null and b/src/es/gistamishouse/res/mipmap-xxhdpi/ic_launcher.png differ diff --git a/src/es/gistamishouse/res/mipmap-xxxhdpi/ic_launcher.png b/src/es/gistamishouse/res/mipmap-xxxhdpi/ic_launcher.png new file mode 100644 index 000000000..436769cde Binary files /dev/null and b/src/es/gistamishouse/res/mipmap-xxxhdpi/ic_launcher.png differ diff --git a/src/es/gistamishouse/src/eu/kanade/tachiyomi/extension/es/gistamishouse/GistamisHouse.kt b/src/es/gistamishouse/src/eu/kanade/tachiyomi/extension/es/gistamishouse/GistamisHouse.kt new file mode 100644 index 000000000..66fda25be --- /dev/null +++ b/src/es/gistamishouse/src/eu/kanade/tachiyomi/extension/es/gistamishouse/GistamisHouse.kt @@ -0,0 +1,154 @@ +package eu.kanade.tachiyomi.extension.es.gistamishouse + +import eu.kanade.tachiyomi.multisrc.zeistmanga.Genre +import eu.kanade.tachiyomi.multisrc.zeistmanga.Status +import eu.kanade.tachiyomi.multisrc.zeistmanga.Type +import eu.kanade.tachiyomi.multisrc.zeistmanga.ZeistManga +import eu.kanade.tachiyomi.multisrc.zeistmanga.ZeistMangaDto +import eu.kanade.tachiyomi.network.GET +import eu.kanade.tachiyomi.network.interceptor.rateLimit +import eu.kanade.tachiyomi.source.model.SChapter +import eu.kanade.tachiyomi.source.model.SManga +import eu.kanade.tachiyomi.util.asJsoup +import kotlinx.serialization.decodeFromString +import okhttp3.Response + +class GistamisHouse : ZeistManga( + "Gistamis House", + "https://gistamishousefansub.blogspot.com", + "es", +) { + override val useNewChapterFeed = true + override val hasFilters = true + override val hasLanguageFilter = false + + override val client = super.client.newBuilder() + .rateLimit(2) + .build() + + override val excludedCategories = listOf("Anime", "Novela") + + override val popularMangaSelector = "div.PopularPosts div.grid > figure:not(:has(span[data=Capitulo]))" + + override val authorSelectorList = listOf( + "Author", + "Autor", + "Mangaka", + ) + + override val mangaDetailsSelectorAltName = "div.y6x11p:contains(Otros Nombres) > span.dt" + override val mangaDetailsSelectorInfoTitle = "" + + override fun mangaDetailsParse(response: Response): SManga { + val document = response.asJsoup() + val profileManga = document.selectFirst(mangaDetailsSelector)!! + return SManga.create().apply { + thumbnail_url = profileManga.selectFirst("img")!!.attr("abs:src") + description = buildString { + append(profileManga.select(mangaDetailsSelectorDescription).text()) + append("\n\n") + profileManga.selectFirst(mangaDetailsSelectorAltName)?.text()?.takeIf { it.isNotBlank() }?.let { + append("Otros Nombres: ") + append(it) + } + }.trim() + genre = profileManga.select(mangaDetailsSelectorGenres) + .joinToString { it.text() } + + val infoElement = profileManga.select(mangaDetailsSelectorInfo) + var statusFound = false + infoElement.forEach { element -> + val infoText = element.ownText().trim().ifEmpty { element.selectFirst(mangaDetailsSelectorInfoTitle)?.text()?.trim() ?: "" } + val descText = element.select(mangaDetailsSelectorInfoDescription).text().trim() + when { + statusSelectorList.any { infoText.contains(it) } -> { + if (!statusFound) status = parseStatus(descText) + statusFound = true + } + + authorSelectorList.any { infoText.contains(it) } -> { + author = descText + } + + artisSelectorList.any { infoText.contains(it) } -> { + artist = descText + } + } + } + } + } + + override val chapterCategory = "" + private val chapterCategories = listOf("Capitulo", "Cap") + + override fun chapterListParse(response: Response): List { + val document = response.asJsoup() + + val url = getChapterFeedUrl(document) + val res = client.newCall(GET(url, headers)).execute() + + val result = json.decodeFromString(res.body.string()) + return result.feed?.entry?.filter { it.category.orEmpty().any { category -> chapterCategories.contains(category.term) } } + ?.map { it.toSChapter(baseUrl) } + ?: throw Exception("Failed to parse from chapter API") + } + + override val pageListSelector = "article.oh div.post p" + + override fun getGenreList(): List = listOf( + Genre("Acción", "Acción"), + Genre("Aventura", "Aventura"), + Genre("Comedia", "Comedia"), + Genre("Dementia", "Dementia"), + Genre("Demonios", "Demonios"), + Genre("Drama", "Drama"), + Genre("Ecchi", "Ecchi"), + Genre("Fantasía", "Fantasía"), + Genre("Videojuegos", "Videojuegos"), + Genre("Harem", "Harem"), + Genre("Histórico", "Histórico"), + Genre("Horror", "Horror"), + Genre("Josei", "Josei"), + Genre("Magia", "Magia"), + Genre("Arte marcial", "Arte marcial"), + Genre("Mecha", "Mecha"), + Genre("Militar", "Militar"), + Genre("Música", "Música"), + Genre("Misterio", "Misterio"), + Genre("Parody", "Parody"), + Genre("Policia", "Policia"), + Genre("Filosófico", "Filosófico"), + Genre("Romance", "Romance"), + Genre("Samurai", "Samurai"), + Genre("Escolar", "Escolar"), + Genre("Sci-Fi", "Sci-Fi"), + Genre("Seinen", "Seinen"), + Genre("Shoujo", "Shoujo"), + Genre("GL", "GL"), + Genre("BL", "BL"), + Genre("HET", "HET"), + Genre("Shounen", "Shounen"), + Genre("Vida cotidiana", "Vida cotidiana"), + Genre("Espacio", "Espacio"), + Genre("Deportes", "Deportes"), + Genre("Super poderes", "Super poderes"), + Genre("Sobrenatural", "Sobrenatural"), + Genre("Thriller", "Thriller"), + Genre("Vampiro", "Vampiro"), + Genre("Vida laboral", "Vida laboral"), + ) + + override fun getStatusList(): List = listOf( + Status("Activo", "Activo"), + Status("Completo", "Completo"), + Status("Cancelado", "Cancelado"), + Status("Futuro", "Futuro"), + Status("Pausado", "Pausado"), + ) + + override fun getTypeList(): List = listOf( + Type("Manga", "Manga"), + Type("Manhua", "Manhua"), + Type("Manhwa", "Manhwa"), + ) +} diff --git a/src/id/komikrealm/src/eu/kanade/tachiyomi/extension/id/komikrealm/KomikRealm.kt b/src/id/komikrealm/src/eu/kanade/tachiyomi/extension/id/komikrealm/KomikRealm.kt index bef6676cf..84f3021c1 100644 --- a/src/id/komikrealm/src/eu/kanade/tachiyomi/extension/id/komikrealm/KomikRealm.kt +++ b/src/id/komikrealm/src/eu/kanade/tachiyomi/extension/id/komikrealm/KomikRealm.kt @@ -13,19 +13,15 @@ import eu.kanade.tachiyomi.source.model.SChapter import eu.kanade.tachiyomi.source.model.SManga import eu.kanade.tachiyomi.util.asJsoup import kotlinx.serialization.decodeFromString -import kotlinx.serialization.json.Json import okhttp3.Request import okhttp3.Response import org.jsoup.nodes.Document -import uy.kohesive.injekt.injectLazy class KomikRealm : ZeistManga( "KomikRealm", "https://www.komikrealm.my.id", "id", ) { - private val json: Json by injectLazy() - override val hasFilters = true override val hasLanguageFilter = false