Add GistamisHouse (#2195)

* Add GistamisHouse

* is NSFW

* Fix Yokai

* I need a linter

* amazing

* bump
This commit is contained in:
bapeey 2024-04-01 06:29:02 -05:00 committed by GitHub
parent a80db51115
commit f5d22d8d31
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
11 changed files with 191 additions and 33 deletions

View File

@ -2,4 +2,4 @@ plugins {
id("lib-multisrc") id("lib-multisrc")
} }
baseVersionCode = 8 baseVersionCode = 9

View File

@ -27,7 +27,7 @@ abstract class ZeistManga(
override val supportsLatest = true override val supportsLatest = true
private val json: Json by injectLazy() protected val json: Json by injectLazy()
private val intl by lazy { ZeistMangaIntl(lang) } private val intl by lazy { ZeistMangaIntl(lang) }
@ -63,23 +63,7 @@ abstract class ZeistManga(
return GET(url, headers) return GET(url, headers)
} }
override fun latestUpdatesParse(response: Response): MangasPage { override fun latestUpdatesParse(response: Response) = searchMangaParse(response)
val jsonString = response.body.string()
val result = json.decodeFromString<ZeistMangaDto>(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 searchMangaRequest(page: Int, query: String, filters: FilterList): Request { override fun searchMangaRequest(page: Int, query: String, filters: FilterList): Request {
val startIndex = maxMangaResults * (page - 1) + 1 val startIndex = maxMangaResults * (page - 1) + 1
@ -123,7 +107,25 @@ abstract class ZeistManga(
return GET(url.build(), headers) return GET(url.build(), headers)
} }
override fun searchMangaParse(response: Response) = latestUpdatesParse(response) protected open val excludedCategories: List<String> = listOf("Anime")
override fun searchMangaParse(response: Response): MangasPage {
val jsonString = response.body.string()
val result = json.decodeFromString<ZeistMangaDto>(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( protected open val statusSelectorList = listOf(
"Status", "Status",
@ -199,13 +201,9 @@ abstract class ZeistManga(
val document = response.asJsoup() val document = response.asJsoup()
val url = getChapterFeedUrl(document) val url = getChapterFeedUrl(document)
val res = client.newCall(GET(url, headers)).execute()
val req = GET(url, headers) val result = json.decodeFromString<ZeistMangaDto>(res.body.string())
val res = client.newCall(req).execute()
val jsonString = res.body.string()
val result = json.decodeFromString<ZeistMangaDto>(jsonString)
return result.feed?.entry?.filter { it.category.orEmpty().any { category -> category.term == chapterCategory } } return result.feed?.entry?.filter { it.category.orEmpty().any { category -> category.term == chapterCategory } }
?.map { it.toSChapter(baseUrl) } ?.map { it.toSChapter(baseUrl) }
?: throw Exception("Failed to parse from chapter API") ?: throw Exception("Failed to parse from chapter API")
@ -392,6 +390,7 @@ abstract class ZeistManga(
"ongoing", "ongoing",
"en curso", "en curso",
"en emisión", "en emisión",
"activo",
"ativo", "ativo",
"lançando", "lançando",
"مستمر", "مستمر",
@ -400,10 +399,12 @@ abstract class ZeistManga(
protected open val statusCompletedList = listOf( protected open val statusCompletedList = listOf(
"completed", "completed",
"completo", "completo",
"finalizado",
) )
protected open val statusHiatusList = listOf( protected open val statusHiatusList = listOf(
"hiatus", "hiatus",
"pausado",
) )
protected open val statusCancelledList = listOf( protected open val statusCancelledList = listOf(

View File

@ -5,13 +5,10 @@ import eu.kanade.tachiyomi.multisrc.zeistmanga.ZeistMangaDto
import eu.kanade.tachiyomi.network.GET import eu.kanade.tachiyomi.network.GET
import eu.kanade.tachiyomi.source.model.SChapter import eu.kanade.tachiyomi.source.model.SChapter
import eu.kanade.tachiyomi.util.asJsoup import eu.kanade.tachiyomi.util.asJsoup
import kotlinx.serialization.json.Json
import kotlinx.serialization.json.decodeFromStream import kotlinx.serialization.json.decodeFromStream
import okhttp3.Response import okhttp3.Response
import uy.kohesive.injekt.injectLazy
class Yokai : ZeistManga("Yokai", "https://yokai-team.blogspot.com", "ar") { class Yokai : ZeistManga("Yokai", "https://yokai-team.blogspot.com", "ar") {
private val json: Json by injectLazy()
// ============================== Chapters ============================== // ============================== Chapters ==============================
override fun chapterListParse(response: Response): List<SChapter> { override fun chapterListParse(response: Response): List<SChapter> {

View File

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

View File

@ -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<SChapter> {
val document = response.asJsoup()
val url = getChapterFeedUrl(document)
val res = client.newCall(GET(url, headers)).execute()
val result = json.decodeFromString<ZeistMangaDto>(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<Genre> = 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<Status> = listOf(
Status("Activo", "Activo"),
Status("Completo", "Completo"),
Status("Cancelado", "Cancelado"),
Status("Futuro", "Futuro"),
Status("Pausado", "Pausado"),
)
override fun getTypeList(): List<Type> = listOf(
Type("Manga", "Manga"),
Type("Manhua", "Manhua"),
Type("Manhwa", "Manhwa"),
)
}

View File

@ -13,19 +13,15 @@ import eu.kanade.tachiyomi.source.model.SChapter
import eu.kanade.tachiyomi.source.model.SManga import eu.kanade.tachiyomi.source.model.SManga
import eu.kanade.tachiyomi.util.asJsoup import eu.kanade.tachiyomi.util.asJsoup
import kotlinx.serialization.decodeFromString import kotlinx.serialization.decodeFromString
import kotlinx.serialization.json.Json
import okhttp3.Request import okhttp3.Request
import okhttp3.Response import okhttp3.Response
import org.jsoup.nodes.Document import org.jsoup.nodes.Document
import uy.kohesive.injekt.injectLazy
class KomikRealm : ZeistManga( class KomikRealm : ZeistManga(
"KomikRealm", "KomikRealm",
"https://www.komikrealm.my.id", "https://www.komikrealm.my.id",
"id", "id",
) { ) {
private val json: Json by injectLazy()
override val hasFilters = true override val hasFilters = true
override val hasLanguageFilter = false override val hasLanguageFilter = false