feat(StreamSB) stream break: support audiotracks

This commit is contained in:
LikDev-256 2023-02-19 10:07:54 +05:30
parent 6b8008f460
commit 078caf9f88

View file

@ -3,9 +3,10 @@ package com.lagradost.cloudstream3.extractors
import com.fasterxml.jackson.annotation.JsonProperty import com.fasterxml.jackson.annotation.JsonProperty
import com.lagradost.cloudstream3.SubtitleFile import com.lagradost.cloudstream3.SubtitleFile
import com.lagradost.cloudstream3.app import com.lagradost.cloudstream3.app
import com.lagradost.cloudstream3.mvvm.safeApiCall
import com.lagradost.cloudstream3.utils.ExtractorApi import com.lagradost.cloudstream3.utils.ExtractorApi
import com.lagradost.cloudstream3.utils.ExtractorLink import com.lagradost.cloudstream3.utils.ExtractorLink
import com.lagradost.cloudstream3.utils.M3u8Helper import com.lagradost.cloudstream3.utils.Qualities
class Sbspeed : StreamSB() { class Sbspeed : StreamSB() {
override var name = "Sbspeed" override var name = "Sbspeed"
@ -140,14 +141,22 @@ open class StreamSB : ExtractorApi() {
referer = url, referer = url,
).parsedSafe<Main>() ).parsedSafe<Main>()
// val urlmain = mapped.streamData.file.substringBefore("/hls/") // val urlmain = mapped.streamData.file.substringBefore("/hls/")
M3u8Helper.generateM3u8(
name,
mapped?.streamData?.file ?: return,
url,
headers = headers
).forEach(callback)
mapped.streamData.subs?.map {sub -> safeApiCall {
callback.invoke(
ExtractorLink(
name,
name,
mapped?.streamData?.file ?: return@safeApiCall,
url,
Qualities.Unknown.value,
true,
headers
)
)
}
mapped?.streamData?.subs?.map {sub ->
subtitleCallback.invoke( subtitleCallback.invoke(
SubtitleFile( SubtitleFile(
sub.label.toString(), sub.label.toString(),