sora: fix Blackvid

This commit is contained in:
hexated 2023-10-06 18:25:20 +07:00
parent 411ba0ed9b
commit 26400695bd
6 changed files with 27 additions and 91 deletions

View file

@ -1,7 +1,7 @@
import org.jetbrains.kotlin.konan.properties.Properties
// use an integer for version numbers
version = 178
version = 179
android {
defaultConfig {

View file

@ -1196,67 +1196,6 @@ object SoraExtractor : SoraStream() {
}
}
suspend fun invokeFwatayako(
imdbId: String? = null,
season: Int? = null,
episode: Int? = null,
callback: (ExtractorLink) -> Unit
) {
val ref = "https://videoapi.tv/"
val files = app.get(
"$fwatayakoAPI/IAF0wWTdNYZm?imdb_id=$imdbId", referer = ref
).document.selectFirst("input#files")?.attr("value") ?: return
val data = files.let {
if (season == null) {
it.replace("\"381\"", "\"movie\"").replace("\"30\"", "\"movie_dl\"")
} else {
it.replace("\"381\"", "\"tv\"").replace("\"30\"", "\"tv_dl\"")
}
}.let { tryParseJson<SourcesFwatayako>(it) } ?: return
val sourcesLink = if (season == null) {
data.sourcesMovie
} else {
data.sourcesTv?.find { it.id == season }?.folder?.find { it.id == "${season}_${episode}" }?.file
}
val downoadLink = if (season == null) {
data.movie_dl
} else {
data.tv_dl?.find { it.id == season }?.folder?.find { it.id == "${season}_${episode}" }?.download
}
sourcesLink?.split(",")?.map {
val source = it.substringBefore("or").trim()
val quality =
Regex("\\[(\\d{3,4})p]").find(source)?.groupValues?.getOrNull(1)?.toIntOrNull()
val link = httpsify(source.replace("[${quality}p]", "").trim())
callback.invoke(
ExtractorLink(
"Fwatayako",
"Fwatayako",
link,
ref,
quality ?: Qualities.Unknown.value,
isM3u8 = true
)
)
}
downoadLink?.mapKeys {
callback.invoke(
ExtractorLink(
"Fwatayako",
"Fwatayako",
httpsify(it.value),
ref,
getQualityFromName(it.key),
)
)
}
}
suspend fun invokeGMovies(
title: String? = null,
year: Int? = null,
@ -2190,7 +2129,7 @@ object SoraExtractor : SoraStream() {
"$blackvidAPI/v3/tv/sources/$tmdbId/$season/$episode?key=$key"
}
val data = app.get(url, timeout = 120L).body.bytes().decrypt(key)
val data = request(url).body.bytes().decrypt(key)
val json = tryParseJson<BlackvidResponses>(data)
json?.sources?.map { source ->
@ -2200,7 +2139,7 @@ object SoraExtractor : SoraStream() {
"Blackvid",
"Blackvid${source.label}",
s.url ?: return@s,
"$blackvidAPI/",
"https://blackvid.space/",
s.quality?.toIntOrNull() ?: Qualities.Unknown.value,
INFER_TYPE
)

View file

@ -102,24 +102,6 @@ data class Jump1Movies(
@JsonProperty("movies") val movies: ArrayList<Jump1Episodes>? = arrayListOf(),
)
data class EpisodesFwatayako(
@JsonProperty("id") val id: String? = null,
@JsonProperty("file") val file: String? = null,
@JsonProperty("download") val download: HashMap<String, String>? = hashMapOf(),
)
data class SeasonFwatayako(
@JsonProperty("id") val id: Int? = null,
@JsonProperty("folder") val folder: ArrayList<EpisodesFwatayako>? = arrayListOf(),
)
data class SourcesFwatayako(
@JsonProperty("movie") val sourcesMovie: String? = null,
@JsonProperty("tv") val sourcesTv: ArrayList<SeasonFwatayako>? = arrayListOf(),
@JsonProperty("movie_dl") val movie_dl: HashMap<String, String>? = hashMapOf(),
@JsonProperty("tv_dl") val tv_dl: ArrayList<SeasonFwatayako>? = arrayListOf(),
)
data class DriveBotLink(
@JsonProperty("url") val url: String? = null,
)

View file

@ -20,7 +20,6 @@ import com.hexated.SoraExtractor.invokeDramaday
import com.hexated.SoraExtractor.invokeDreamfilm
import com.hexated.SoraExtractor.invokeFDMovies
import com.hexated.SoraExtractor.invokeFlixon
import com.hexated.SoraExtractor.invokeFwatayako
import com.hexated.SoraExtractor.invokeGMovies
import com.hexated.SoraExtractor.invokeGoku
import com.hexated.SoraExtractor.invokeKisskh
@ -97,7 +96,6 @@ open class SoraStream : TmdbProvider() {
const val kissKhAPI = "https://kisskh.co"
const val lingAPI = "https://ling-online.net"
const val uhdmoviesAPI = "https://uhdmovies.store"
const val fwatayakoAPI = "https://5100.svetacdn.in"
const val gMoviesAPI = "https://gdrivemovies.xyz"
const val fdMoviesAPI = "https://freedrivemovie.lol"
const val m4uhdAPI = "https://ww2.m4ufree.com"
@ -487,9 +485,6 @@ open class SoraStream : TmdbProvider() {
callback
)
},
{
if (!res.isAnime) invokeFwatayako(res.imdbId, res.season, res.episode, callback)
},
{
if (!res.isAnime) invokeGMovies(
res.title,

View file

@ -9,7 +9,6 @@ import com.hexated.SoraExtractor.invokeDramaday
import com.hexated.SoraExtractor.invokeDreamfilm
import com.hexated.SoraExtractor.invokeFilmxy
import com.hexated.SoraExtractor.invokeFlixon
import com.hexated.SoraExtractor.invokeFwatayako
import com.hexated.SoraExtractor.invokeGoku
import com.hexated.SoraExtractor.invokeKimcartoon
import com.hexated.SoraExtractor.invokeKisskh
@ -196,9 +195,6 @@ class SoraStreamLite : SoraStream() {
callback
)
},
{
invokeFwatayako(res.imdbId, res.season, res.episode, callback)
},
{
if(!res.isAnime) invokeM4uhd(
res.title,

View file

@ -21,12 +21,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.*
@ -36,6 +40,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
@ -146,6 +151,25 @@ fun Document.getMirrorServer(server: Int): String {
return this.select("div.text-center a:contains(Server $server)").attr("href")
}
suspend fun request(
url: String,
allowRedirects: Boolean = true,
timeout: Long = 30L
): 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()
}
suspend fun extractMirrorUHD(url: String, ref: String): String? {
var baseDoc = app.get(fixUrl(url, ref)).document
var downLink = baseDoc.getMirrorLink()