small fix

This commit is contained in:
hexated 2023-03-06 09:04:52 +07:00
parent 70b5e3a6d9
commit 88c52c4eca
2 changed files with 5 additions and 5 deletions

View File

@ -1524,7 +1524,7 @@ object SoraExtractor : SoraStream() {
callback: (ExtractorLink) -> Unit
) {
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(
title,
season,
@ -1534,7 +1534,7 @@ object SoraExtractor : SoraStream() {
epsId.apmap {
val json =
app.get("$consumetCrunchyrollAPI/watch/${it?.first ?: return@apmap null}")
app.get("$consumetCrunchyrollAPI/watch/${it?.first ?: return@apmap null}",timeout = 600L)
.parsedSafe<ConsumetSourcesResponse>()
json?.sources?.map source@{ source ->

View File

@ -729,7 +729,7 @@ fun Document.findTvMoviesIframe(): 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
return (if (res?.size == 1) {
res.firstOrNull()
@ -901,8 +901,8 @@ fun Headers.getGomoviesCookies(cookieKey: String = "set-cookie"): Map<String, St
}
fun String?.createSlug(): String? {
return this?.replace(Regex("[!%:'?,]|( &)"), "")?.replace(" ", "-")?.lowercase()
?.replace("--", "-")
return this?.replace(Regex("[!%:'?,]|( &)"), "")?.replace(Regex("( )|( -)|(- )"), "-")
?.replace(" ", "-")?.lowercase()
}
fun getLanguage(str: String): String {