mirror of
https://github.com/hexated/cloudstream-extensions-hexated.git
synced 2024-08-15 00:03:22 +00:00
[Sora] removed Dub from Crunchy
This commit is contained in:
parent
64af3927d0
commit
afa6956717
3 changed files with 27 additions and 24 deletions
|
@ -1,5 +1,5 @@
|
|||
// use an integer for version numbers
|
||||
version = 61
|
||||
version = 62
|
||||
|
||||
|
||||
cloudstream {
|
||||
|
|
|
@ -1461,28 +1461,30 @@ object SoraExtractor : SoraStream() {
|
|||
suspend fun invokeCrunchyroll(
|
||||
title: String? = null,
|
||||
epsTitle: String? = null,
|
||||
season: Int? = null,
|
||||
episode: Int? = null,
|
||||
subtitleCallback: (SubtitleFile) -> Unit,
|
||||
callback: (ExtractorLink) -> Unit
|
||||
) {
|
||||
val id = app.get("$consumetCrunchyrollAPI/$title")
|
||||
.parsedSafe<ConsumetSearchResponse>()?.results?.find {
|
||||
it.title.equals(
|
||||
title, true
|
||||
title,
|
||||
true
|
||||
) && it.type.equals("series")
|
||||
} ?: return
|
||||
|
||||
val detail = app.get("$consumetCrunchyrollAPI/info?id=${id.id}&mediaType=series").text
|
||||
val episodeId = tryParseJson<ConsumetDetails>(detail)?.episodes?.filter {
|
||||
it.title.equals(epsTitle, true) && (it.type == "Subbed" || it.type == "English Dub")
|
||||
}?.map { it.id to it.type } ?: return
|
||||
(it.number == episode || it.title.equals(epsTitle, true)) && it.type == "Subbed"
|
||||
}?.map { it.id }?.getOrNull(season?.minus(1) ?: 0) ?: return
|
||||
|
||||
episodeId.apmap { (id, type) ->
|
||||
val json = app.get("$consumetCrunchyrollAPI/watch?episodeId=$id&format=srt")
|
||||
val json = app.get("$consumetCrunchyrollAPI/watch?episodeId=$episodeId&format=srt")
|
||||
.parsedSafe<ConsumetSourcesResponse>()
|
||||
|
||||
json?.sources?.map source@{ source ->
|
||||
M3u8Helper.generateM3u8(
|
||||
"Crunchyroll [$type]",
|
||||
"Crunchyroll",
|
||||
source.url ?: return@source null,
|
||||
"",
|
||||
).forEach(callback)
|
||||
|
@ -1497,7 +1499,6 @@ object SoraExtractor : SoraStream() {
|
|||
)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -351,6 +351,8 @@ open class SoraStream : TmdbProvider() {
|
|||
if (res.season != null && res.isAnime) invokeCrunchyroll(
|
||||
res.title,
|
||||
res.epsTitle,
|
||||
res.season,
|
||||
res.episode,
|
||||
subtitleCallback,
|
||||
callback
|
||||
)
|
||||
|
|
Loading…
Reference in a new issue