Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
alex committed Jan 24, 2024
1 parent 590ccaa commit 92a0b49
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 11 deletions.
2 changes: 1 addition & 1 deletion Superstream/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import org.jetbrains.kotlin.konan.properties.Properties

// use an integer for version numbers
version = 1
version = 2

android {
defaultConfig {
Expand Down
33 changes: 23 additions & 10 deletions Superstream/src/main/kotlin/com/hexated/Extractors.kt
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
package com.hexated

import com.lagradost.cloudstream3.*
import com.lagradost.cloudstream3.mvvm.normalSafeApiCall
import com.lagradost.cloudstream3.utils.*
import java.net.URL

object Extractors : Superstream() {

Expand Down Expand Up @@ -94,17 +96,28 @@ object Extractors : Superstream() {

fids?.apmapIndexed { index, fileList ->
val player = app.get("$thirdAPI/file/player?fid=${fileList.fid}&share_key=$shareKey").text
val video = """"(https.*?m3u8.*?)"""".toRegex().find(player)?.groupValues?.get(1)
callback.invoke(
ExtractorLink(
"External",
"External [Server ${index + 1}]",
video?.replace("\\/", "/") ?: return@apmapIndexed,
"$thirdAPI/",
getIndexQuality(fileList.file_name),
isM3u8 = true
val hls = """"(https.*?m3u8.*?)"""".toRegex().find(player)?.groupValues?.get(1)
val mp4 = "sources\\s*=\\s*(.*);".toRegex().find(player)?.groupValues?.get(1)?.let {
AppUtils.tryParseJson<List<ExternalSources>>(it)?.first()
}
listOf(
mp4?.file to mp4?.label,
hls to fileList.file_name
).map {
val path = normalSafeApiCall { URL(it.first).path }.let { p ->
if(p?.endsWith(".m3u8") == true) "HLS" else "MP4"
}
callback.invoke(
ExtractorLink(
"External $path",
"External $path [Server ${index + 1}]",
it.first?.replace("\\/", "/") ?: return@apmapIndexed,
"$thirdAPI/",
getIndexQuality(it.second),
type = INFER_TYPE,
)
)
)
}
}
}

Expand Down
5 changes: 5 additions & 0 deletions Superstream/src/main/kotlin/com/hexated/Superstream.kt
Original file line number Diff line number Diff line change
Expand Up @@ -774,6 +774,11 @@ open class Superstream : MainAPI() {
}
}

data class ExternalSources(
@JsonProperty("file") val file: String? = null,
@JsonProperty("label") val label: String? = null,
)

data class WatchsomuchTorrents(
@JsonProperty("id") val id: Int? = null,
@JsonProperty("movieId") val movieId: Int? = null,
Expand Down

0 comments on commit 92a0b49

Please sign in to comment.