From 078caf9f88dc92bb7416f51458b1bbea73bfb9bf Mon Sep 17 00:00:00 2001 From: LikDev-256 Date: Sun, 19 Feb 2023 10:07:54 +0530 Subject: [PATCH] feat(StreamSB) stream break: support audiotracks --- .../cloudstream3/extractors/StreamSB.kt | 25 +++++++++++++------ 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/app/src/main/java/com/lagradost/cloudstream3/extractors/StreamSB.kt b/app/src/main/java/com/lagradost/cloudstream3/extractors/StreamSB.kt index b77617c2..22037727 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/extractors/StreamSB.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/extractors/StreamSB.kt @@ -3,9 +3,10 @@ package com.lagradost.cloudstream3.extractors import com.fasterxml.jackson.annotation.JsonProperty import com.lagradost.cloudstream3.SubtitleFile import com.lagradost.cloudstream3.app +import com.lagradost.cloudstream3.mvvm.safeApiCall import com.lagradost.cloudstream3.utils.ExtractorApi import com.lagradost.cloudstream3.utils.ExtractorLink -import com.lagradost.cloudstream3.utils.M3u8Helper +import com.lagradost.cloudstream3.utils.Qualities class Sbspeed : StreamSB() { override var name = "Sbspeed" @@ -140,14 +141,22 @@ open class StreamSB : ExtractorApi() { referer = url, ).parsedSafe
() // 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( SubtitleFile( sub.label.toString(),