mirror of
https://github.com/hexated/cloudstream-extensions-hexated.git
synced 2024-08-15 00:03:22 +00:00
fixed sub again
This commit is contained in:
parent
cf25b6fd64
commit
593d9484c3
1 changed files with 1 additions and 23 deletions
|
@ -157,28 +157,6 @@ class Hdfilmcehennemi : MainAPI() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun fixSubUrl(url: String): String {
|
|
||||||
if (url.startsWith("http") ||
|
|
||||||
// Do not fix JSON objects when passed as urls.
|
|
||||||
url.startsWith("{\"")
|
|
||||||
) {
|
|
||||||
return url
|
|
||||||
}
|
|
||||||
if (url.isEmpty()) {
|
|
||||||
return ""
|
|
||||||
}
|
|
||||||
|
|
||||||
val startsWithNoHttp = url.startsWith("//")
|
|
||||||
if (startsWithNoHttp) {
|
|
||||||
return "https:$url"
|
|
||||||
} else {
|
|
||||||
if (url.startsWith('/')) {
|
|
||||||
return vidmolyServer + url
|
|
||||||
}
|
|
||||||
return "$vidmolyServer/$url"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private fun String.addMarks(str: String): String {
|
private fun String.addMarks(str: String): String {
|
||||||
return this.replace(Regex("\"?$str\"?"), "\"$str\"")
|
return this.replace(Regex("\"?$str\"?"), "\"$str\"")
|
||||||
}
|
}
|
||||||
|
@ -212,7 +190,7 @@ class Hdfilmcehennemi : MainAPI() {
|
||||||
subtitleCallback.invoke(
|
subtitleCallback.invoke(
|
||||||
SubtitleFile(
|
SubtitleFile(
|
||||||
it.label.toString(),
|
it.label.toString(),
|
||||||
fixSubUrl(it.file.toString())
|
"$vidmolyServer${it.file}"
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue