mirror of
https://github.com/hexated/cloudstream-extensions-hexated.git
synced 2024-08-15 00:03:22 +00:00
sora: using consumet again for crunchyroll
This commit is contained in:
parent
b2fa3608f3
commit
70b5e3a6d9
4 changed files with 12 additions and 11 deletions
|
@ -1524,7 +1524,7 @@ object SoraExtractor : SoraStream() {
|
||||||
callback: (ExtractorLink) -> Unit
|
callback: (ExtractorLink) -> Unit
|
||||||
) {
|
) {
|
||||||
val id = searchCrunchyrollAnimeId(title ?: return) ?: return
|
val id = searchCrunchyrollAnimeId(title ?: return) ?: return
|
||||||
val detail = app.get("$consumetCrunchyrollAPI/info?id=$id&mediaType=series").text
|
val detail = app.get("$consumetCrunchyrollAPI/info/$id?fetchAllSeasons=true").text
|
||||||
val epsId = tryParseJson<CrunchyrollDetails>(detail)?.findCrunchyrollId(
|
val epsId = tryParseJson<CrunchyrollDetails>(detail)?.findCrunchyrollId(
|
||||||
title,
|
title,
|
||||||
season,
|
season,
|
||||||
|
@ -1534,13 +1534,13 @@ object SoraExtractor : SoraStream() {
|
||||||
|
|
||||||
epsId.apmap {
|
epsId.apmap {
|
||||||
val json =
|
val json =
|
||||||
app.get("$consumetCrunchyrollAPI/watch?episodeId=${it?.first ?: return@apmap null}")
|
app.get("$consumetCrunchyrollAPI/watch/${it?.first ?: return@apmap null}")
|
||||||
.parsedSafe<ConsumetSourcesResponse>()
|
.parsedSafe<ConsumetSourcesResponse>()
|
||||||
|
|
||||||
json?.sources?.map source@{ source ->
|
json?.sources?.map source@{ source ->
|
||||||
callback.invoke(
|
callback.invoke(
|
||||||
ExtractorLink(
|
ExtractorLink(
|
||||||
"Crunchyroll [${it.second ?: ""}]",
|
"Crunchyroll",
|
||||||
"Crunchyroll [${it.second ?: ""}]",
|
"Crunchyroll [${it.second ?: ""}]",
|
||||||
source.url ?: return@source null,
|
source.url ?: return@source null,
|
||||||
"https://static.crunchyroll.com/",
|
"https://static.crunchyroll.com/",
|
||||||
|
@ -1553,7 +1553,7 @@ object SoraExtractor : SoraStream() {
|
||||||
json?.subtitles?.map subtitle@{ sub ->
|
json?.subtitles?.map subtitle@{ sub ->
|
||||||
subtitleCallback.invoke(
|
subtitleCallback.invoke(
|
||||||
SubtitleFile(
|
SubtitleFile(
|
||||||
sub.lang ?: "",
|
fixCrunchyrollLang(sub.lang ?: return@subtitle null) ?: sub.lang,
|
||||||
sub.url ?: return@subtitle null
|
sub.url ?: return@subtitle null
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
|
@ -6,6 +6,7 @@ import com.hexated.SoraExtractor.invokeAnimes
|
||||||
import com.hexated.SoraExtractor.invokeBlackmovies
|
import com.hexated.SoraExtractor.invokeBlackmovies
|
||||||
import com.hexated.SoraExtractor.invokeBollyMaza
|
import com.hexated.SoraExtractor.invokeBollyMaza
|
||||||
import com.hexated.SoraExtractor.invokeCodexmovies
|
import com.hexated.SoraExtractor.invokeCodexmovies
|
||||||
|
import com.hexated.SoraExtractor.invokeCrunchyroll
|
||||||
import com.hexated.SoraExtractor.invokeDbgo
|
import com.hexated.SoraExtractor.invokeDbgo
|
||||||
import com.hexated.SoraExtractor.invokeFilmxy
|
import com.hexated.SoraExtractor.invokeFilmxy
|
||||||
import com.hexated.SoraExtractor.invokeFlixhq
|
import com.hexated.SoraExtractor.invokeFlixhq
|
||||||
|
@ -98,8 +99,8 @@ open class SoraStream : TmdbProvider() {
|
||||||
const val xMovieAPI = "https://xemovies.to"
|
const val xMovieAPI = "https://xemovies.to"
|
||||||
const val haikeiFlixhqAPI = "https://api.haikei.xyz/movies/flixhq" // disabled
|
const val haikeiFlixhqAPI = "https://api.haikei.xyz/movies/flixhq" // disabled
|
||||||
const val consumetZoroAPI = "https://api.consumet.org/anime/zoro"
|
const val consumetZoroAPI = "https://api.consumet.org/anime/zoro"
|
||||||
const val consumetCrunchyrollAPI = "https://api.consumet.org/anime/crunchyroll" // dead
|
const val consumetCrunchyrollAPI = "https://cronchy.consumet.stream"
|
||||||
const val kickassanimeAPI = "https://www2.kickassanime.ro"
|
const val kickassanimeAPI = "https://www2.kickassanime.ro" // disabled due to consumet
|
||||||
const val kissKhAPI = "https://kisskh.me"
|
const val kissKhAPI = "https://kisskh.me"
|
||||||
const val lingAPI = "https://ling-online.net"
|
const val lingAPI = "https://ling-online.net"
|
||||||
const val uhdmoviesAPI = "https://uhdmovies.world"
|
const val uhdmoviesAPI = "https://uhdmovies.world"
|
||||||
|
@ -411,7 +412,7 @@ open class SoraStream : TmdbProvider() {
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
if (res.season != null && res.isAnime) invokeKickassanime(
|
if (res.season != null && res.isAnime) invokeCrunchyroll(
|
||||||
res.title,
|
res.title,
|
||||||
res.epsTitle,
|
res.epsTitle,
|
||||||
res.season,
|
res.season,
|
||||||
|
|
|
@ -108,7 +108,7 @@ class SoraStreamLite : SoraStream() {
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
if (res.season != null && res.isAnime) invokeKickassanime(
|
if (res.season != null && res.isAnime) invokeCrunchyroll(
|
||||||
res.title,
|
res.title,
|
||||||
res.epsTitle,
|
res.epsTitle,
|
||||||
res.season,
|
res.season,
|
||||||
|
|
|
@ -539,7 +539,7 @@ suspend fun invokeSapphire(
|
||||||
res?.subtitles?.map { sub ->
|
res?.subtitles?.map { sub ->
|
||||||
subtitleCallback.invoke(
|
subtitleCallback.invoke(
|
||||||
SubtitleFile(
|
SubtitleFile(
|
||||||
getKaaLanguage(sub.language ?: return@map null) ?: sub.language,
|
fixCrunchyrollLang(sub.language ?: return@map null) ?: sub.language,
|
||||||
sub.url ?: return@map null
|
sub.url ?: return@map null
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
@ -729,7 +729,7 @@ fun Document.findTvMoviesIframe(): String? {
|
||||||
}
|
}
|
||||||
|
|
||||||
suspend fun searchCrunchyrollAnimeId(title: String): String? {
|
suspend fun searchCrunchyrollAnimeId(title: String): String? {
|
||||||
val res = app.get("${consumetCrunchyrollAPI}/$title")
|
val res = app.get("${consumetCrunchyrollAPI}/search/$title")
|
||||||
.parsedSafe<ConsumetSearchResponse>()?.results
|
.parsedSafe<ConsumetSearchResponse>()?.results
|
||||||
return (if (res?.size == 1) {
|
return (if (res?.size == 1) {
|
||||||
res.firstOrNull()
|
res.firstOrNull()
|
||||||
|
@ -991,7 +991,7 @@ fun getDbgoLanguage(str: String): String {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fun getKaaLanguage(language: String?): String? {
|
fun fixCrunchyrollLang(language: String?): String? {
|
||||||
return SubtitleHelper.fromTwoLettersToLanguage(language ?: return null)
|
return SubtitleHelper.fromTwoLettersToLanguage(language ?: return null)
|
||||||
?: SubtitleHelper.fromTwoLettersToLanguage(language.substringBefore("-"))
|
?: SubtitleHelper.fromTwoLettersToLanguage(language.substringBefore("-"))
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue