added fallback in Shivamhw and fixed hdfilmcehennemi

This commit is contained in:
hexated 2023-04-30 00:58:58 +07:00
parent db046fe123
commit fb566a6796
4 changed files with 17 additions and 20 deletions

View file

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

View file

@ -168,25 +168,20 @@ class Hdfilmcehennemi : MainAPI() {
url, url,
referer = "${mainUrl}/" referer = "${mainUrl}/"
).document.select("script") ).document.select("script")
.find { it.data().contains("sources:") }?.data() .find { it.data().contains("sources:") }?.data() ?: return
val videoData = script?.substringAfter("sources: [") val videoData = getAndUnpack(script).substringAfter("file_link=\"").substringBefore("\";")
?.substringBefore("],")?.addMarks("file") val subData = script.substringAfter("tracks: [").substringBefore("]")
val subData = script?.substringAfter("tracks: [")?.substringBefore("]")?.addMarks("file")
?.addMarks("label")?.addMarks("kind")
tryParseJson<Source>(videoData)?.file?.let { m3uLink ->
callback.invoke(
ExtractorLink(
source,
source,
m3uLink,
"$mainUrl/",
Qualities.Unknown.value,
true
)
callback.invoke(
ExtractorLink(
source,
source,
base64Decode(videoData),
"$mainUrl/",
Qualities.Unknown.value,
true
) )
} )
tryParseJson<List<SubSource>>("[${subData}]") tryParseJson<List<SubSource>>("[${subData}]")
?.filter { it.kind == "captions" }?.map { ?.filter { it.kind == "captions" }?.map {

View file

@ -1,7 +1,7 @@
import org.jetbrains.kotlin.konan.properties.Properties import org.jetbrains.kotlin.konan.properties.Properties
// use an integer for version numbers // use an integer for version numbers
version = 124 version = 125
android { android {
defaultConfig { defaultConfig {

View file

@ -2872,11 +2872,13 @@ object SoraExtractor : SoraStream() {
}?.map { source -> }?.map { source ->
val quality = getIndexQuality(source.first) val quality = getIndexQuality(source.first)
val tags = getIndexQualityTags(source.first) val tags = getIndexQualityTags(source.first)
val video = source.third?.removePrefix("vlc://") ?: return@map
if(!app.get(video).isSuccessful) return@map
callback.invoke( callback.invoke(
ExtractorLink( ExtractorLink(
"Shivamhw", "Shivamhw",
"Shivamhw $tags [${source.second}]", "Shivamhw $tags [${source.second}]",
source.third?.removePrefix("vlc://") ?: return@map, video,
"", "",
quality, quality,
) )