fixed Loklok sub

This commit is contained in:
hexated 2022-09-16 17:23:45 +07:00
parent 4f2c622f82
commit fe9be46b10
2 changed files with 3 additions and 1 deletions

View file

@ -1,5 +1,5 @@
// use an integer for version numbers // use an integer for version numbers
version = 2 version = 3
cloudstream { cloudstream {

View file

@ -149,6 +149,7 @@ class Loklok : MainAPI() {
private fun getLanguage(str: String): String { private fun getLanguage(str: String): String {
return when (str) { return when (str) {
"in_ID" -> "Indonesian" "in_ID" -> "Indonesian"
"pt" -> "Portuguese"
else -> str.split("_").first().let { else -> str.split("_").first().let {
SubtitleHelper.fromTwoLettersToLanguage(it).toString() SubtitleHelper.fromTwoLettersToLanguage(it).toString()
} }
@ -166,6 +167,7 @@ class Loklok : MainAPI() {
res.definitionList?.apmap { video -> res.definitionList?.apmap { video ->
safeApiCall { safeApiCall {
delay(500)
app.get( app.get(
"$apiUrl/media/previewInfo?category=${res.category}&contentId=${res.id}&episodeId=${res.epId}&definition=${video.code}", "$apiUrl/media/previewInfo?category=${res.category}&contentId=${res.id}&episodeId=${res.epId}&definition=${video.code}",
headers = headers headers = headers