mirror of
https://github.com/hexated/cloudstream-extensions-hexated.git
synced 2024-08-15 00:03:22 +00:00
fixed subtitle in Kickassanime
This commit is contained in:
parent
e1ad8d7bf6
commit
ef7314139a
1 changed files with 6 additions and 1 deletions
|
@ -285,7 +285,7 @@ class Kickassanime : MainAPI() {
|
|||
res?.subtitles?.map { sub ->
|
||||
subtitleCallback.invoke(
|
||||
SubtitleFile(
|
||||
sub.language ?: "",
|
||||
getLanguage(sub.language ?: return@map null) ?: sub.language,
|
||||
sub.url ?: return@map null
|
||||
)
|
||||
)
|
||||
|
@ -371,6 +371,11 @@ class Kickassanime : MainAPI() {
|
|||
}
|
||||
}
|
||||
|
||||
private fun getLanguage(language: String?): String? {
|
||||
return SubtitleHelper.fromTwoLettersToLanguage(language ?: return null)
|
||||
?: SubtitleHelper.fromTwoLettersToLanguage(language.substringBefore("-"))
|
||||
}
|
||||
|
||||
private fun fixUrl(url: String, domain: String): String {
|
||||
if (url.startsWith("http")) {
|
||||
return url
|
||||
|
|
Loading…
Reference in a new issue