mirror of
https://github.com/hexated/cloudstream-extensions-hexated.git
synced 2024-08-15 00:03:22 +00:00
small fix
This commit is contained in:
parent
70b5e3a6d9
commit
88c52c4eca
2 changed files with 5 additions and 5 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?fetchAllSeasons=true").text
|
val detail = app.get("$consumetCrunchyrollAPI/info/$id?fetchAllSeasons=true",timeout = 600L).text
|
||||||
val epsId = tryParseJson<CrunchyrollDetails>(detail)?.findCrunchyrollId(
|
val epsId = tryParseJson<CrunchyrollDetails>(detail)?.findCrunchyrollId(
|
||||||
title,
|
title,
|
||||||
season,
|
season,
|
||||||
|
@ -1534,7 +1534,7 @@ object SoraExtractor : SoraStream() {
|
||||||
|
|
||||||
epsId.apmap {
|
epsId.apmap {
|
||||||
val json =
|
val json =
|
||||||
app.get("$consumetCrunchyrollAPI/watch/${it?.first ?: return@apmap null}")
|
app.get("$consumetCrunchyrollAPI/watch/${it?.first ?: return@apmap null}",timeout = 600L)
|
||||||
.parsedSafe<ConsumetSourcesResponse>()
|
.parsedSafe<ConsumetSourcesResponse>()
|
||||||
|
|
||||||
json?.sources?.map source@{ source ->
|
json?.sources?.map source@{ source ->
|
||||||
|
|
|
@ -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}/search/$title")
|
val res = app.get("${consumetCrunchyrollAPI}/search/$title",timeout = 600L)
|
||||||
.parsedSafe<ConsumetSearchResponse>()?.results
|
.parsedSafe<ConsumetSearchResponse>()?.results
|
||||||
return (if (res?.size == 1) {
|
return (if (res?.size == 1) {
|
||||||
res.firstOrNull()
|
res.firstOrNull()
|
||||||
|
@ -901,8 +901,8 @@ fun Headers.getGomoviesCookies(cookieKey: String = "set-cookie"): Map<String, St
|
||||||
}
|
}
|
||||||
|
|
||||||
fun String?.createSlug(): String? {
|
fun String?.createSlug(): String? {
|
||||||
return this?.replace(Regex("[!%:'?,]|( &)"), "")?.replace(" ", "-")?.lowercase()
|
return this?.replace(Regex("[!%:'?,]|( &)"), "")?.replace(Regex("( – )|( -)|(- )"), "-")
|
||||||
?.replace("-–-", "-")
|
?.replace(" ", "-")?.lowercase()
|
||||||
}
|
}
|
||||||
|
|
||||||
fun getLanguage(str: String): String {
|
fun getLanguage(str: String): String {
|
||||||
|
|
Loading…
Reference in a new issue