mirror of
https://github.com/hexated/cloudstream-extensions-hexated.git
synced 2024-08-15 00:03:22 +00:00
sora: added timeout in index
This commit is contained in:
parent
2f2358d6c1
commit
f29605ec95
1 changed files with 9 additions and 6 deletions
|
@ -2000,7 +2000,8 @@ object SoraExtractor : SoraStream() {
|
||||||
"${apiUrl}search",
|
"${apiUrl}search",
|
||||||
data = data,
|
data = data,
|
||||||
headers = passHeaders,
|
headers = passHeaders,
|
||||||
referer = apiUrl
|
referer = apiUrl,
|
||||||
|
timeout = 120L
|
||||||
).text else app.post(
|
).text else app.post(
|
||||||
"${apiUrl}search",
|
"${apiUrl}search",
|
||||||
data = data,
|
data = data,
|
||||||
|
@ -2008,7 +2009,7 @@ object SoraExtractor : SoraStream() {
|
||||||
).text
|
).text
|
||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
app.post("${apiUrl}search", requestBody = body, referer = apiUrl).text
|
app.post("${apiUrl}search", requestBody = body, referer = apiUrl, timeout = 120L).text
|
||||||
}
|
}
|
||||||
val media = if (api in untrimmedIndex) searchIndex(
|
val media = if (api in untrimmedIndex) searchIndex(
|
||||||
title,
|
title,
|
||||||
|
@ -2031,20 +2032,22 @@ object SoraExtractor : SoraStream() {
|
||||||
"${apiUrl}id2path",
|
"${apiUrl}id2path",
|
||||||
data = pathData,
|
data = pathData,
|
||||||
headers = passHeaders,
|
headers = passHeaders,
|
||||||
referer = apiUrl
|
referer = apiUrl,
|
||||||
|
timeout = 120L
|
||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
app.post(
|
app.post(
|
||||||
"${apiUrl}id2path", data = pathData, referer = apiUrl
|
"${apiUrl}id2path", data = pathData, referer = apiUrl, timeout = 120L
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
app.post("${apiUrl}id2path", requestBody = pathBody, referer = apiUrl)
|
app.post("${apiUrl}id2path", requestBody = pathBody, referer = apiUrl, timeout = 120L)
|
||||||
}).text.let { path ->
|
}).text.let { path ->
|
||||||
if (api in ddomainIndex) {
|
if (api in ddomainIndex) {
|
||||||
val worker = app.get(
|
val worker = app.get(
|
||||||
"${fixUrl(path, apiUrl).encodeUrl()}?a=view",
|
"${fixUrl(path, apiUrl).encodeUrl()}?a=view",
|
||||||
referer = if (api in needRefererIndex) apiUrl else ""
|
referer = if (api in needRefererIndex) apiUrl else "",
|
||||||
|
timeout = 120L
|
||||||
).document.selectFirst("script:containsData(downloaddomain)")?.data()
|
).document.selectFirst("script:containsData(downloaddomain)")?.data()
|
||||||
?.substringAfter("\"downloaddomain\":\"")?.substringBefore("\",")?.let {
|
?.substringAfter("\"downloaddomain\":\"")?.substringBefore("\",")?.let {
|
||||||
"$it/0:"
|
"$it/0:"
|
||||||
|
|
Loading…
Reference in a new issue