From 2a24701ca1162fe41c546883bf89e558f4cf057c Mon Sep 17 00:00:00 2001 From: Olivia Date: Fri, 26 Jan 2024 19:03:51 +0700 Subject: [PATCH] Anichi: removed dead source --- Anichi/build.gradle.kts | 4 +- Anichi/src/main/kotlin/com/hexated/Anichi.kt | 27 ++------ .../kotlin/com/hexated/AnichiExtractors.kt | 61 ------------------- .../main/kotlin/com/hexated/AnichiParser.kt | 35 ----------- 4 files changed, 8 insertions(+), 119 deletions(-) diff --git a/Anichi/build.gradle.kts b/Anichi/build.gradle.kts index 643809b04..8d4ce77f3 100644 --- a/Anichi/build.gradle.kts +++ b/Anichi/build.gradle.kts @@ -1,7 +1,7 @@ import org.jetbrains.kotlin.konan.properties.Properties // use an integer for version numbers -version = 9 +version = 10 android { defaultConfig { @@ -38,5 +38,5 @@ cloudstream { "OVA", ) - iconUrl = "https://media.discordapp.net/attachments/1059306855865782282/1123970193274712096/Anichi.png" + iconUrl = "https://cdn.discordapp.com/attachments/1109266606292488297/1200409381813100554/Untitled-removebg-preview.png" } \ No newline at end of file diff --git a/Anichi/src/main/kotlin/com/hexated/Anichi.kt b/Anichi/src/main/kotlin/com/hexated/Anichi.kt index bbad3ae75..0ddfae483 100644 --- a/Anichi/src/main/kotlin/com/hexated/Anichi.kt +++ b/Anichi/src/main/kotlin/com/hexated/Anichi.kt @@ -1,6 +1,5 @@ package com.hexated -import com.hexated.AnichiExtractors.invokeExternalSources import com.hexated.AnichiExtractors.invokeInternalSources import com.lagradost.cloudstream3.* import com.lagradost.cloudstream3.LoadResponse.Companion.addActors @@ -214,25 +213,12 @@ open class Anichi : MainAPI() { val loadData = parseJson(data) - argamap( - { - invokeInternalSources( - loadData.hash, - loadData.dubStatus, - loadData.episode, - subtitleCallback, - callback - ) - }, - { - invokeExternalSources( - loadData.idMal, - loadData.dubStatus, - loadData.episode, - subtitleCallback, - callback - ) - } + invokeInternalSources( + loadData.hash, + loadData.dubStatus, + loadData.episode, + subtitleCallback, + callback ) return true @@ -245,7 +231,6 @@ open class Anichi : MainAPI() { const val anilistApi = "https://graphql.anilist.co" const val jikanApi = "https://api.jikan.moe/v4" - const val marinHost = "https://marin.moe" private const val mainHash = "e42a4466d984b2c0a2cecae5dd13aa68867f634b16ee0f17b380047d14482406" private const val popularHash = "31a117653812a2547fd981632e8c99fa8bf8a75c4ef1a77a1567ef1741a7ab9c" diff --git a/Anichi/src/main/kotlin/com/hexated/AnichiExtractors.kt b/Anichi/src/main/kotlin/com/hexated/AnichiExtractors.kt index 86d452ed4..a41b2c54b 100644 --- a/Anichi/src/main/kotlin/com/hexated/AnichiExtractors.kt +++ b/Anichi/src/main/kotlin/com/hexated/AnichiExtractors.kt @@ -121,67 +121,6 @@ object AnichiExtractors : Anichi() { } } - suspend fun invokeExternalSources( - idMal: Int? = null, - dubStatus: String, - episode: String, - subtitleCallback: (SubtitleFile) -> Unit, - callback: (ExtractorLink) -> Unit, - ) { - val ids = app.get("https://api.malsync.moe/mal/anime/${idMal ?: return}") - .parsedSafe()?.sites - - if (dubStatus == "sub") invokeMarin(ids?.marin?.keys?.firstOrNull(), episode, callback) - - } - - private suspend fun invokeMarin( - id: String? = null, - episode: String, - callback: (ExtractorLink) -> Unit - ) { - val url = "$marinHost/anime/${id ?: return}/$episode" - val cookies = app.get( - "$marinHost/anime", - headers = mapOf( - "Cookie" to "__ddg1_=;__ddg2_=;" - ), - referer = "$marinHost/anime", - ).cookies.let { - decode(it["XSRF-TOKEN"].toString()) to decode(it["marin_session"].toString()) - } - - val json = app.get( - url, - headers = mapOf( - "Accept" to "text/html, application/xhtml+xml", - "Cookie" to "__ddg1=;__ddg2_=;XSRF-TOKEN=${cookies.first};marin_session=${cookies.second};", - "X-XSRF-TOKEN" to cookies.first - ), - referer = "$marinHost/anime/$id" - ).document.selectFirst("div#app")?.attr("data-page") - tryParseJson(json)?.props?.video?.data?.mirror?.map { video -> - callback.invoke( - ExtractorLink( - "Marin", - "Marin", - video.code?.file ?: return@map, - url, - video.code.height ?: Qualities.Unknown.value, - headers = mapOf( - "Accept" to "video/webm,video/ogg,video/*;q=0.9,application/ogg;q=0.7,audio/*;q=0.6,*/*;q=0.5", - "Accept-Language" to "en-US,en;q=0.5", - "Cookie" to "__ddg1=;__ddg2_=; XSRF-TOKEN=${cookies.first}; marin_session=${cookies.second};", - "Connection" to "keep-alive", - "Sec-Fetch-Dest" to "video", - "Sec-Fetch-Mode" to "cors", - "Sec-Fetch-Site" to "cross-site", - ) - ) - ) - } - } - private suspend fun invokeGogo( link: String, subtitleCallback: (SubtitleFile) -> Unit, diff --git a/Anichi/src/main/kotlin/com/hexated/AnichiParser.kt b/Anichi/src/main/kotlin/com/hexated/AnichiParser.kt index 6cbe56ecf..8b9165eba 100644 --- a/Anichi/src/main/kotlin/com/hexated/AnichiParser.kt +++ b/Anichi/src/main/kotlin/com/hexated/AnichiParser.kt @@ -240,7 +240,6 @@ data class PageStatus( @JsonProperty("__typename") val _typename: String? = null ) - data class Recommendations( @JsonProperty("anyCard") val anyCard: AnyCard? = null, @JsonProperty("pageStatus") val pageStatus: PageStatus? = PageStatus(), @@ -255,38 +254,4 @@ data class QueryPopular( data class DataPopular( @JsonProperty("queryPopular") val queryPopular: QueryPopular? = QueryPopular() -) - -data class MALSyncSites( - @JsonProperty("Zoro") val zoro: HashMap>? = hashMapOf(), - @JsonProperty("Marin") val marin: HashMap>? = hashMapOf(), -) - -data class MALSyncResponses( - @JsonProperty("Sites") val sites: MALSyncSites? = null, -) - -data class MarinCode( - @JsonProperty("file") val file: String? = null, - @JsonProperty("height") val height: Int? = null, -) - -data class MarinMirror( - @JsonProperty("code") val code: MarinCode? = null, -) - -data class MarinData( - @JsonProperty("mirror") val mirror: ArrayList? = arrayListOf(), -) - -data class MarinVideos( - @JsonProperty("data") val data: MarinData? = null, -) - -data class MarinProps( - @JsonProperty("video") val video: MarinVideos? = null, -) - -data class MarinResponses( - @JsonProperty("props") val props: MarinProps? = null, ) \ No newline at end of file