mirror of
https://github.com/hexated/cloudstream-extensions-hexated.git
synced 2024-08-15 00:03:22 +00:00
sora: small fix
This commit is contained in:
parent
ac2b8b9824
commit
0e746f4aff
1 changed files with 17 additions and 9 deletions
|
@ -982,15 +982,13 @@ object SoraExtractor : SoraStream() {
|
||||||
invokeBiliBili(aniId, episode, subtitleCallback, callback)
|
invokeBiliBili(aniId, episode, subtitleCallback, callback)
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
if(season != null) invokeAllanime(aniId, title, year, episode, callback)
|
if(season != null) invokeAllanime(aniId, episode, callback)
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
private suspend fun invokeAllanime(
|
private suspend fun invokeAllanime(
|
||||||
aniId: String? = null,
|
aniId: String? = null,
|
||||||
title: String? = null,
|
|
||||||
year: Int? = null,
|
|
||||||
episode: Int? = null,
|
episode: Int? = null,
|
||||||
callback: (ExtractorLink) -> Unit
|
callback: (ExtractorLink) -> Unit
|
||||||
) {
|
) {
|
||||||
|
@ -1000,15 +998,18 @@ object SoraExtractor : SoraStream() {
|
||||||
val aniDetail = app.get("$consumetAnilistAPI/info/$aniId").parsedSafe<ConsumetDetails>()
|
val aniDetail = app.get("$consumetAnilistAPI/info/$aniId").parsedSafe<ConsumetDetails>()
|
||||||
|
|
||||||
val searchQuaery =
|
val searchQuaery =
|
||||||
"""$allanimeAPI/allanimeapi?variables={"search":{"query":"$title","allowAdult":false,"allowUnknown":false},"limit":26,"page":1,"translationType":"sub","countryOrigin":"ALL"}&extensions={"persistedQuery":{"version":1,"sha256Hash":"$searchHash"}}"""
|
"""$allanimeAPI/allanimeapi?variables={"search":{"query":"${aniDetail?.title?.romaji ?: return}","allowAdult":false,"allowUnknown":false},"limit":26,"page":1,"translationType":"sub","countryOrigin":"ALL"}&extensions={"persistedQuery":{"version":1,"sha256Hash":"$searchHash"}}"""
|
||||||
val id = app.get(searchQuaery)
|
val id = app.get(searchQuaery)
|
||||||
.parsedSafe<AllanimeResponses>()?.data?.shows?.edges?.let { media ->
|
.parsedSafe<AllanimeResponses>()?.data?.shows?.edges?.let { media ->
|
||||||
media.find { it.thumbnail == aniDetail?.cover || it.thumbnail == aniDetail?.image }
|
media.find { it.thumbnail == aniDetail.cover || it.thumbnail == aniDetail.image }
|
||||||
?: media.find {
|
?: media.find {
|
||||||
(it.name?.contains(
|
(it.name?.equals(
|
||||||
"$title",
|
aniDetail.title.romaji,
|
||||||
true
|
true
|
||||||
) == true || it.englishName?.contains("$title", true) == true) && it.airedStart?.year == year
|
) == true || it.englishName?.equals(
|
||||||
|
aniDetail.title.romaji,
|
||||||
|
true
|
||||||
|
) == true) && it.airedStart?.year == aniDetail.releaseDate
|
||||||
}
|
}
|
||||||
}?._id
|
}?._id
|
||||||
|
|
||||||
|
@ -3106,10 +3107,17 @@ data class ConsumetEpisodes(
|
||||||
@JsonProperty("season") val season: Int? = null,
|
@JsonProperty("season") val season: Int? = null,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
data class ConsumetTitle(
|
||||||
|
@JsonProperty("romaji") val romaji: String? = null,
|
||||||
|
@JsonProperty("english") val english: String? = null
|
||||||
|
)
|
||||||
|
|
||||||
data class ConsumetDetails(
|
data class ConsumetDetails(
|
||||||
@JsonProperty("episodes") val episodes: ArrayList<ConsumetEpisodes>? = arrayListOf(),
|
@JsonProperty("episodes") val episodes: ArrayList<ConsumetEpisodes>? = arrayListOf(),
|
||||||
@JsonProperty("image") val image: String? = null,
|
@JsonProperty("image") val image: String? = null,
|
||||||
@JsonProperty("cover") val cover: String? = null
|
@JsonProperty("cover") val cover: String? = null,
|
||||||
|
@JsonProperty("title") val title: ConsumetTitle? = null,
|
||||||
|
@JsonProperty("releaseDate") val releaseDate: Int? = null
|
||||||
)
|
)
|
||||||
|
|
||||||
data class CrunchyrollEpisodes(
|
data class CrunchyrollEpisodes(
|
||||||
|
|
Loading…
Reference in a new issue