klontv: Added subs
All checks were successful
Build / build (push) Successful in 1m17s

This commit is contained in:
CakesTwix 2024-08-09 16:37:19 +03:00
parent de83a78845
commit b0c94febf5
Signed by: CakesTwix
GPG key ID: 7B11051D5CE19825
2 changed files with 20 additions and 1 deletions

View file

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

View file

@ -190,6 +190,17 @@ class KlonTVProvider : MainAPI() {
referer = "https://tortuga.wtf/"
).forEach(callback)
val subtitleUrl = app.get(dataList[1]).document.select("script").html()
.substringAfterLast("subtitle: \"")
.substringBefore("\",")
if(subtitleUrl.isNullOrBlank()) return true
subtitleCallback.invoke(
SubtitleFile(
subtitleUrl.substringAfterLast("[").substringBefore("]"),
subtitleUrl.substringAfter("]")
)
)
return true
}
@ -208,6 +219,14 @@ class KlonTVProvider : MainAPI() {
streamUrl = episode.file,
referer = "https://tortuga.wtf/"
).forEach(callback)
if(episode.subtitle.isBlank()) return true
subtitleCallback.invoke(
SubtitleFile(
episode.subtitle.substringAfterLast("[").substringBefore("]"),
episode.subtitle.substringAfter("]")
)
)
}
}
}