From 4c14b600e53e9f37587fd765fe83a719148b3d4e Mon Sep 17 00:00:00 2001 From: alex Date: Tue, 2 Jan 2024 01:07:49 +0700 Subject: [PATCH] update --- Anilibria/build.gradle.kts | 2 +- .../src/main/kotlin/com/hexated/Anilibria.kt | 52 ++----------------- .../src/main/kotlin/com/hexated/SoraStream.kt | 20 +++---- .../main/kotlin/com/hexated/SoraStreamLite.kt | 20 +++---- 4 files changed, 26 insertions(+), 68 deletions(-) diff --git a/Anilibria/build.gradle.kts b/Anilibria/build.gradle.kts index 061d5f393..f29ed62f8 100644 --- a/Anilibria/build.gradle.kts +++ b/Anilibria/build.gradle.kts @@ -1,5 +1,5 @@ // use an integer for version numbers -version = 2 +version = 3 cloudstream { diff --git a/Anilibria/src/main/kotlin/com/hexated/Anilibria.kt b/Anilibria/src/main/kotlin/com/hexated/Anilibria.kt index d4975a0be..254fdade4 100644 --- a/Anilibria/src/main/kotlin/com/hexated/Anilibria.kt +++ b/Anilibria/src/main/kotlin/com/hexated/Anilibria.kt @@ -84,17 +84,13 @@ class Anilibria : MainAPI() { val document = app.get(url).document val title = document.selectFirst("h1.release-title")?.text() ?: return null - val poster = fixUrlNull(document.selectFirst("img#adminPoster")?.attr("src")) - val trackTitle = (document.selectFirst("h1.release-title br")?.nextSibling() + val enTitle = (document.selectFirst("h1.release-title br")?.nextSibling() ?: document.selectFirst("h1.release-title")?.text()?.substringAfter("/")?.trim()).toString() + val poster = fixUrlNull(document.selectFirst("img#adminPoster")?.attr("src")) val type = document.selectFirst("div#xreleaseInfo b:contains(Тип:)")?.nextSibling() .toString().substringBefore(",").trim() - val trackType = type.let { - if(it.contains("Фильм", true)) "movie" else "tv" - } val year = document.selectFirst("div#xreleaseInfo b:contains(Сезон:)")?.nextElementSibling() ?.text()?.filter { it.isDigit() }?.toIntOrNull() - val (malId, anilistId, image, cover) = getTracker(trackTitle, trackType, year) val episodes = document.select("script").find { it.data().contains("var player =") }?.data() ?.substringAfter("file:[")?.substringBefore("],")?.let { data -> tryParseJson>("[$data]")?.mapNotNull { eps -> @@ -106,15 +102,14 @@ class Anilibria : MainAPI() { } } return newAnimeLoadResponse(title, url, getType(type)) { - posterUrl = image ?: poster - backgroundPosterUrl = cover ?: image ?: poster + japName = enTitle + posterUrl = poster + backgroundPosterUrl = poster this.year = year addEpisodes(DubStatus.Subbed, episodes) plot = document.select("p.detail-description").text().trim() this.tags = document.selectFirst("div#xreleaseInfo b:contains(Жанры:)")?.nextSibling() .toString().split(",").map { it.trim() } - addMalId(malId) - addAniListId(anilistId?.toIntOrNull()) } } @@ -143,43 +138,6 @@ class Anilibria : MainAPI() { return true } - private suspend fun getTracker(title: String?, type: String?, year: Int?): Tracker { - val res = app.get("https://consumet-instance.vercel.app/meta/anilist/$title") - .parsedSafe()?.results?.find { media -> - (media.title?.english.equals(title, true) || media.title?.romaji.equals( - title, - true - )) || (media.type.equals(type, true) && media.releaseDate == year) - } - return Tracker(res?.malId, res?.aniId, res?.image, res?.cover) - } - - data class Tracker( - val malId: Int? = null, - val aniId: String? = null, - val image: String? = null, - val cover: String? = null, - ) - - data class Title( - @JsonProperty("romaji") val romaji: String? = null, - @JsonProperty("english") val english: String? = null, - ) - - data class Results( - @JsonProperty("id") val aniId: String? = null, - @JsonProperty("malId") val malId: Int? = null, - @JsonProperty("title") val title: Title? = null, - @JsonProperty("releaseDate") val releaseDate: Int? = null, - @JsonProperty("type") val type: String? = null, - @JsonProperty("image") val image: String? = null, - @JsonProperty("cover") val cover: String? = null, - ) - - data class AniSearch( - @JsonProperty("results") val results: ArrayList? = arrayListOf(), - ) - private data class Episodes( @JsonProperty("file") val file: String? = null, @JsonProperty("title") val title: String? = null, diff --git a/SoraStream/src/main/kotlin/com/hexated/SoraStream.kt b/SoraStream/src/main/kotlin/com/hexated/SoraStream.kt index 7021b5726..141c58394 100644 --- a/SoraStream/src/main/kotlin/com/hexated/SoraStream.kt +++ b/SoraStream/src/main/kotlin/com/hexated/SoraStream.kt @@ -365,16 +365,16 @@ open class SoraStream : TmdbProvider() { val res = parseJson(data) argamap( - { - invokeFebbox( - res.title, - res.year, - res.season, - res.lastSeason, - res.episode, - callback - ) - }, +// { +// invokeFebbox( +// res.title, +// res.year, +// res.season, +// res.lastSeason, +// res.episode, +// callback +// ) +// }, { invokeDumpStream( res.title, diff --git a/SoraStream/src/main/kotlin/com/hexated/SoraStreamLite.kt b/SoraStream/src/main/kotlin/com/hexated/SoraStreamLite.kt index fb015f5d6..3b9e975fc 100644 --- a/SoraStream/src/main/kotlin/com/hexated/SoraStreamLite.kt +++ b/SoraStream/src/main/kotlin/com/hexated/SoraStreamLite.kt @@ -52,16 +52,16 @@ class SoraStreamLite : SoraStream() { val res = AppUtils.parseJson(data) argamap( - { - invokeFebbox( - res.title, - res.year, - res.season, - res.lastSeason, - res.episode, - callback - ) - }, +// { +// invokeFebbox( +// res.title, +// res.year, +// res.season, +// res.lastSeason, +// res.episode, +// callback +// ) +// }, { if (!res.isAnime) invokeWatchsomuch( res.imdbId,