This commit is contained in:
jack 2023-12-12 05:56:19 +07:00
parent e6c491fc16
commit a90648fa79
4 changed files with 28 additions and 9 deletions

View file

@ -2063,7 +2063,6 @@ object SoraExtractor : SoraStream() {
subtitleCallback: (SubtitleFile) -> Unit,
callback: (ExtractorLink) -> Unit,
) {
val ref = "https://blackvid.space/"
val key = "b6055c533c19131a638c3d2299d525d5ec08a814"
val url = if (season == null) {
"$blackvidAPI/v3/movie/sources/$tmdbId?key=$key"
@ -2071,11 +2070,7 @@ object SoraExtractor : SoraStream() {
"$blackvidAPI/v3/tv/sources/$tmdbId/$season/$episode?key=$key"
}
val data = app.get(
url,
timeout = 120L,
referer = ref
).okhttpResponse.peekBody(1024 * 512).source().buffer.readByteArray()
val data = request(url,).peekBody(1024 * 512).source().buffer.readByteArray()
.decrypt("2378f8e4e844f2dc839ab48f66e00acc2305a401")
val json = tryParseJson<BlackvidResponses>(data)
@ -2086,7 +2081,7 @@ object SoraExtractor : SoraStream() {
"Blackvid",
"Blackvid${source.label}",
s.url ?: return@s,
ref,
"https://blackvid.space/",
if (s.quality.equals("4k")) Qualities.P2160.value else s.quality?.toIntOrNull()
?: Qualities.P1080.value,
INFER_TYPE

View file

@ -443,7 +443,7 @@ open class SoraStream : TmdbProvider() {
)
},
{
invokeKisskh(
if (res.isAsian || res.isAnime) invokeKisskh(
res.title,
res.season,
res.episode,

View file

@ -171,7 +171,7 @@ class SoraStreamLite : SoraStream() {
)
},
{
invokeKisskh(
if (res.isAsian || res.isAnime) invokeKisskh(
res.title,
res.season,
res.episode,

View file

@ -19,12 +19,16 @@ import com.lagradost.cloudstream3.utils.AppUtils.toJson
import com.lagradost.cloudstream3.utils.AppUtils.tryParseJson
import com.lagradost.nicehttp.NiceResponse
import com.lagradost.nicehttp.RequestBodyTypes
import com.lagradost.nicehttp.Requests.Companion.await
import com.lagradost.nicehttp.requestCreator
import kotlinx.coroutines.delay
import okhttp3.FormBody
import okhttp3.HttpUrl.Companion.toHttpUrl
import okhttp3.MediaType.Companion.toMediaTypeOrNull
import okhttp3.OkHttpClient
import okhttp3.Request
import okhttp3.RequestBody.Companion.toRequestBody
import okhttp3.Response
import org.jsoup.nodes.Document
import java.math.BigInteger
import java.net.*
@ -34,6 +38,7 @@ import java.security.spec.PKCS8EncodedKeySpec
import java.security.spec.X509EncodedKeySpec
import java.text.SimpleDateFormat
import java.util.*
import java.util.concurrent.TimeUnit
import javax.crypto.Cipher
import javax.crypto.spec.GCMParameterSpec
import javax.crypto.spec.IvParameterSpec
@ -1278,6 +1283,25 @@ private enum class Symbol(val decimalValue: Int) {
}
}
suspend fun request(
url: String,
allowRedirects: Boolean = true,
timeout: Long = 60L
): Response {
val client = OkHttpClient().newBuilder()
.connectTimeout(timeout, TimeUnit.SECONDS)
.readTimeout(timeout, TimeUnit.SECONDS)
.writeTimeout(timeout, TimeUnit.SECONDS)
.followRedirects(allowRedirects)
.followSslRedirects(allowRedirects)
.build()
val request: Request = Request.Builder()
.url(url)
.build()
return client.newCall(request).await()
}
object DumpUtils {
private val deviceId = getDeviceId()