forked from recloudstream/cloudstream
fixed #1077
This commit is contained in:
parent
1918a1658e
commit
0e69a4ff37
4 changed files with 10 additions and 14 deletions
|
@ -594,9 +594,8 @@ open class SflixProvider : MainAPI() {
|
||||||
ignoreCase = true
|
ignoreCase = true
|
||||||
)
|
)
|
||||||
if (isM3u8) {
|
if (isM3u8) {
|
||||||
M3u8Helper().m3u8Generation(M3u8Helper.M3u8Stream(this.file, null), true)
|
M3u8Helper().m3u8Generation(M3u8Helper.M3u8Stream(this.file, null), null)
|
||||||
.map { stream ->
|
.map { stream ->
|
||||||
//println("stream: ${stream.quality} at ${stream.streamUrl}")
|
|
||||||
ExtractorLink(
|
ExtractorLink(
|
||||||
caller.name,
|
caller.name,
|
||||||
"${caller.name} $name",
|
"${caller.name} $name",
|
||||||
|
@ -610,10 +609,10 @@ open class SflixProvider : MainAPI() {
|
||||||
} else {
|
} else {
|
||||||
listOf(ExtractorLink(
|
listOf(ExtractorLink(
|
||||||
caller.name,
|
caller.name,
|
||||||
this.label?.let { "${caller.name} - $it" } ?: caller.name,
|
caller.name,
|
||||||
file,
|
file,
|
||||||
caller.mainUrl,
|
caller.mainUrl,
|
||||||
getQualityFromName(this.type ?: ""),
|
getQualityFromName(this.label),
|
||||||
false,
|
false,
|
||||||
extractorData = extractorData
|
extractorData = extractorData
|
||||||
))
|
))
|
||||||
|
@ -621,7 +620,7 @@ open class SflixProvider : MainAPI() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fun Tracks.toSubtitleFile(): SubtitleFile? {
|
private fun Tracks.toSubtitleFile(): SubtitleFile? {
|
||||||
return this.file?.let {
|
return this.file?.let {
|
||||||
SubtitleFile(
|
SubtitleFile(
|
||||||
this.label ?: "Unknown",
|
this.label ?: "Unknown",
|
||||||
|
@ -630,7 +629,6 @@ open class SflixProvider : MainAPI() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
suspend fun MainAPI.extractRabbitStream(
|
suspend fun MainAPI.extractRabbitStream(
|
||||||
url: String,
|
url: String,
|
||||||
subtitleCallback: (SubtitleFile) -> Unit,
|
subtitleCallback: (SubtitleFile) -> Unit,
|
||||||
|
|
|
@ -271,9 +271,9 @@ class GeneratorPlayer : FullScreenPlayer() {
|
||||||
val sourcesArrayAdapter =
|
val sourcesArrayAdapter =
|
||||||
ArrayAdapter<String>(ctx, R.layout.sort_bottom_single_choice)
|
ArrayAdapter<String>(ctx, R.layout.sort_bottom_single_choice)
|
||||||
|
|
||||||
sourcesArrayAdapter.addAll(sortedUrls.map {
|
sourcesArrayAdapter.addAll(sortedUrls.map { (link, uri) ->
|
||||||
val name = it.first?.name ?: it.second?.name ?: "NULL"
|
val name = link?.name ?: uri?.name ?: "NULL"
|
||||||
"$name ${Qualities.getStringByInt(it.first?.quality)}"
|
"$name ${Qualities.getStringByInt(link?.quality)}"
|
||||||
})
|
})
|
||||||
|
|
||||||
providerList.choiceMode = AbsListView.CHOICE_MODE_SINGLE
|
providerList.choiceMode = AbsListView.CHOICE_MODE_SINGLE
|
||||||
|
|
|
@ -5,7 +5,6 @@ import com.lagradost.cloudstream3.TvType
|
||||||
import com.lagradost.cloudstream3.USER_AGENT
|
import com.lagradost.cloudstream3.USER_AGENT
|
||||||
import com.lagradost.cloudstream3.app
|
import com.lagradost.cloudstream3.app
|
||||||
import com.lagradost.cloudstream3.extractors.*
|
import com.lagradost.cloudstream3.extractors.*
|
||||||
import com.lagradost.cloudstream3.extractors.BullStream
|
|
||||||
import com.lagradost.cloudstream3.mvvm.suspendSafeApiCall
|
import com.lagradost.cloudstream3.mvvm.suspendSafeApiCall
|
||||||
import kotlinx.coroutines.delay
|
import kotlinx.coroutines.delay
|
||||||
import org.jsoup.Jsoup
|
import org.jsoup.Jsoup
|
||||||
|
|
|
@ -25,7 +25,7 @@ class M3u8Helper {
|
||||||
streamUrl = streamUrl,
|
streamUrl = streamUrl,
|
||||||
quality = quality,
|
quality = quality,
|
||||||
headers = headers,
|
headers = headers,
|
||||||
), true
|
), null
|
||||||
)
|
)
|
||||||
.map { stream ->
|
.map { stream ->
|
||||||
ExtractorLink(
|
ExtractorLink(
|
||||||
|
@ -41,7 +41,6 @@ class M3u8Helper {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private val ENCRYPTION_DETECTION_REGEX = Regex("#EXT-X-KEY:METHOD=([^,]+),")
|
private val ENCRYPTION_DETECTION_REGEX = Regex("#EXT-X-KEY:METHOD=([^,]+),")
|
||||||
private val ENCRYPTION_URL_IV_REGEX =
|
private val ENCRYPTION_URL_IV_REGEX =
|
||||||
Regex("#EXT-X-KEY:METHOD=([^,]+),URI=\"([^\"]+)\"(?:,IV=(.*))?")
|
Regex("#EXT-X-KEY:METHOD=([^,]+),URI=\"([^\"]+)\"(?:,IV=(.*))?")
|
||||||
|
@ -117,7 +116,7 @@ class M3u8Helper {
|
||||||
return !url.contains("https://") && !url.contains("http://")
|
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 generate = sequence {
|
||||||
val m3u8Parent = getParentLink(m3u8.streamUrl)
|
val m3u8Parent = getParentLink(m3u8.streamUrl)
|
||||||
val response = runBlocking {
|
val response = runBlocking {
|
||||||
|
@ -155,7 +154,7 @@ class M3u8Helper {
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
if (returnThis || !hasAnyContent) {
|
if (returnThis ?: !hasAnyContent) {
|
||||||
yield(
|
yield(
|
||||||
M3u8Stream(
|
M3u8Stream(
|
||||||
m3u8.streamUrl,
|
m3u8.streamUrl,
|
||||||
|
|
Loading…
Reference in a new issue