mirror of
https://github.com/hexated/cloudstream-extensions-hexated.git
synced 2024-08-15 00:03:22 +00:00
Anichi: removed dead source
This commit is contained in:
parent
25ab02c476
commit
2a24701ca1
4 changed files with 8 additions and 119 deletions
|
@ -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"
|
||||
}
|
|
@ -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<AnichiLoadData>(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"
|
||||
|
|
|
@ -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<MALSyncResponses>()?.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<MarinResponses>(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,
|
||||
|
|
|
@ -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(),
|
||||
|
@ -256,37 +255,3 @@ data class QueryPopular(
|
|||
data class DataPopular(
|
||||
@JsonProperty("queryPopular") val queryPopular: QueryPopular? = QueryPopular()
|
||||
)
|
||||
|
||||
data class MALSyncSites(
|
||||
@JsonProperty("Zoro") val zoro: HashMap<String?, HashMap<String, String?>>? = hashMapOf(),
|
||||
@JsonProperty("Marin") val marin: HashMap<String?, HashMap<String, String?>>? = 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<MarinMirror>? = 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,
|
||||
)
|
Loading…
Reference in a new issue