This commit is contained in:
LagradOst 2022-05-21 20:28:58 +02:00
parent 1918a1658e
commit 0e69a4ff37
4 changed files with 10 additions and 14 deletions

View File

@ -594,9 +594,8 @@ open class SflixProvider : MainAPI() {
ignoreCase = true
)
if (isM3u8) {
M3u8Helper().m3u8Generation(M3u8Helper.M3u8Stream(this.file, null), true)
M3u8Helper().m3u8Generation(M3u8Helper.M3u8Stream(this.file, null), null)
.map { stream ->
//println("stream: ${stream.quality} at ${stream.streamUrl}")
ExtractorLink(
caller.name,
"${caller.name} $name",
@ -610,10 +609,10 @@ open class SflixProvider : MainAPI() {
} else {
listOf(ExtractorLink(
caller.name,
this.label?.let { "${caller.name} - $it" } ?: caller.name,
caller.name,
file,
caller.mainUrl,
getQualityFromName(this.type ?: ""),
getQualityFromName(this.label),
false,
extractorData = extractorData
))
@ -621,7 +620,7 @@ open class SflixProvider : MainAPI() {
}
}
fun Tracks.toSubtitleFile(): SubtitleFile? {
private fun Tracks.toSubtitleFile(): SubtitleFile? {
return this.file?.let {
SubtitleFile(
this.label ?: "Unknown",
@ -630,7 +629,6 @@ open class SflixProvider : MainAPI() {
}
}
suspend fun MainAPI.extractRabbitStream(
url: String,
subtitleCallback: (SubtitleFile) -> Unit,

View File

@ -271,9 +271,9 @@ class GeneratorPlayer : FullScreenPlayer() {
val sourcesArrayAdapter =
ArrayAdapter<String>(ctx, R.layout.sort_bottom_single_choice)
sourcesArrayAdapter.addAll(sortedUrls.map {
val name = it.first?.name ?: it.second?.name ?: "NULL"
"$name ${Qualities.getStringByInt(it.first?.quality)}"
sourcesArrayAdapter.addAll(sortedUrls.map { (link, uri) ->
val name = link?.name ?: uri?.name ?: "NULL"
"$name ${Qualities.getStringByInt(link?.quality)}"
})
providerList.choiceMode = AbsListView.CHOICE_MODE_SINGLE

View File

@ -5,7 +5,6 @@ import com.lagradost.cloudstream3.TvType
import com.lagradost.cloudstream3.USER_AGENT
import com.lagradost.cloudstream3.app
import com.lagradost.cloudstream3.extractors.*
import com.lagradost.cloudstream3.extractors.BullStream
import com.lagradost.cloudstream3.mvvm.suspendSafeApiCall
import kotlinx.coroutines.delay
import org.jsoup.Jsoup

View File

@ -25,7 +25,7 @@ class M3u8Helper {
streamUrl = streamUrl,
quality = quality,
headers = headers,
), true
), null
)
.map { stream ->
ExtractorLink(
@ -41,7 +41,6 @@ class M3u8Helper {
}
}
private val ENCRYPTION_DETECTION_REGEX = Regex("#EXT-X-KEY:METHOD=([^,]+),")
private val ENCRYPTION_URL_IV_REGEX =
Regex("#EXT-X-KEY:METHOD=([^,]+),URI=\"([^\"]+)\"(?:,IV=(.*))?")
@ -117,7 +116,7 @@ class M3u8Helper {
return !url.contains("https://") && !url.contains("http://")
}
fun m3u8Generation(m3u8: M3u8Stream, returnThis: Boolean): List<M3u8Stream> {
fun m3u8Generation(m3u8: M3u8Stream, returnThis: Boolean?): List<M3u8Stream> {
val generate = sequence {
val m3u8Parent = getParentLink(m3u8.streamUrl)
val response = runBlocking {
@ -155,7 +154,7 @@ class M3u8Helper {
)
)
}
if (returnThis || !hasAnyContent) {
if (returnThis ?: !hasAnyContent) {
yield(
M3u8Stream(
m3u8.streamUrl,