mirror of
https://github.com/hexated/cloudstream-extensions-hexated.git
synced 2024-08-15 00:03:22 +00:00
fixed Hdfilmcehennemi & OtakudesuProvider also added Paradisehill
This commit is contained in:
parent
2dfba40296
commit
df8099cc8c
8 changed files with 192 additions and 17 deletions
|
@ -1,5 +1,5 @@
|
|||
// use an integer for version numbers
|
||||
version = 1
|
||||
version = 2
|
||||
|
||||
|
||||
cloudstream {
|
||||
|
|
|
@ -155,21 +155,32 @@ class Hdfilmcehennemi : MainAPI() {
|
|||
private suspend fun invokeLocalSource(
|
||||
source: String,
|
||||
url: String,
|
||||
sourceCallback: (ExtractorLink) -> Unit
|
||||
subtitleCallback: (SubtitleFile) -> Unit,
|
||||
callback: (ExtractorLink) -> Unit
|
||||
) {
|
||||
val m3uLink =
|
||||
app.get(url, referer = "$mainUrl/").document.select("script")
|
||||
.find {
|
||||
it.data().contains("var sources = [];") || it.data()
|
||||
.contains("playerInstance =")
|
||||
}?.data()
|
||||
?.substringAfter("[{file:\"")?.substringBefore("\"}]") ?: return
|
||||
val res = app.get(url, referer = "$mainUrl/")
|
||||
val m3uLink = res.document.select("script")
|
||||
.find {
|
||||
it.data().contains("var sources = [];") || it.data()
|
||||
.contains("playerInstance =")
|
||||
}?.data()
|
||||
?.substringAfter("[{file:\"")?.substringBefore("\"}]") ?: return
|
||||
|
||||
M3u8Helper.generateM3u8(
|
||||
source,
|
||||
m3uLink,
|
||||
if (url.startsWith(mainUrl)) "$mainUrl/" else "https://vidmoly.to/"
|
||||
).forEach(sourceCallback)
|
||||
).forEach(callback)
|
||||
|
||||
Regex("\"(/srt\\S*?)\",\\slabel:\\s\"(\\S*?)\"").findAll(res.text)
|
||||
.map { it.groupValues[1] to it.groupValues[2] }.toList().map { (url, lang) ->
|
||||
subtitleCallback.invoke(
|
||||
SubtitleFile(
|
||||
lang,
|
||||
fixUrl(url)
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -185,7 +196,7 @@ class Hdfilmcehennemi : MainAPI() {
|
|||
safeApiCall {
|
||||
app.get(url).document.select("div.card-video > iframe").attr("data-src")
|
||||
.let { link ->
|
||||
invokeLocalSource(source, link, callback)
|
||||
invokeLocalSource(source, link,subtitleCallback, callback)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue