fixed Vidsrc

This commit is contained in:
jack 2023-10-27 17:03:06 +07:00
parent acb64d221b
commit 783ae437d1
5 changed files with 50 additions and 24 deletions

View file

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

View file

@ -105,12 +105,35 @@ object SoraExtractor : SoraStream() {
callback: (ExtractorLink) -> Unit callback: (ExtractorLink) -> Unit
) { ) {
val url = if (season == null) { val url = if (season == null) {
"$vidSrcAPI/embed/$id" "$vidSrcAPI/embed/movie?tmdb=$id"
} else { } else {
"$vidSrcAPI/embed/$id/${season}-${episode}" "$vidSrcAPI/embed/tv?tmdb=$id&season=$season&episode=$episode"
} }
loadCustomExtractor(null, url, null, subtitleCallback, callback) val iframedoc = app.get(url).document.select("iframe#player_iframe").attr("src").let { httpsify(it) }
val doc = app.get(iframedoc, referer = url).document
val index = doc.select("body").attr("data-i")
val hash = doc.select("div#hidden").attr("data-h")
val srcrcp = deobfstr(hash, index)
val script = app.get(
httpsify(srcrcp),
referer = iframedoc
).document.selectFirst("script:containsData(Playerjs)")?.data()
val video = script?.substringAfter("file:\"#2")?.substringBefore("\"")
?.replace(Regex("(//\\S+?=)"), "")?.let { base64Decode(it) }
callback.invoke(
ExtractorLink(
"Vidsrc",
"Vidsrc",
video ?: return,
"https://vidsrc.stream/",
Qualities.P1080.value,
INFER_TYPE
)
)
} }
suspend fun invokeDbgo( suspend fun invokeDbgo(
@ -1721,14 +1744,12 @@ object SoraExtractor : SoraStream() {
it.attr("data-id") to it.text() it.attr("data-id") to it.text()
}.apmap { }.apmap {
when { when {
it.second.contains(Regex("(Player F|Player SE|Player N)")) -> {
invokeSmashyFfix(it.second, it.first, url, callback)
}
it.second.equals("Player FM", true) -> invokeSmashyFm( it.second.equals("Player FM", true) -> invokeSmashyFm(
it.second, it.first, url, callback it.second, it.first, url, callback
) )
it.second.contains(Regex("(Player F|Player SE|Player N)")) -> {
invokeSmashyFfix(it.second, it.first, url, callback)
}
else -> return@apmap else -> return@apmap
} }
} }
@ -1991,30 +2012,25 @@ object SoraExtractor : SoraStream() {
} }
suspend fun invoke2embed( suspend fun invoke2embed(
imdbId: String?, season: Int?, episode: Int?, callback: (ExtractorLink) -> Unit imdbId: String?,
season: Int?,
episode: Int?,
subtitleCallback: (SubtitleFile) -> Unit,
callback: (ExtractorLink) -> Unit
) { ) {
val server = "https://stream.2embed.cc"
val url = if (season == null) { val url = if (season == null) {
"$twoEmbedAPI/embed/$imdbId" "$twoEmbedAPI/embed/$imdbId"
} else { } else {
"$twoEmbedAPI/embedtv/$imdbId&s=$season&e=$episode" "$twoEmbedAPI/embedtv/$imdbId&s=$season&e=$episode"
} }
val iframesrc = app.get(url).document.selectFirst("iframe#iframesrc")?.attr("src") val iframesrc = app.get(url).document.selectFirst("iframe#vsrcs")?.attr("data-src") ?: return
val ref = getBaseUrl(iframesrc)
val framesrc = app.get( val framesrc = app.get(
fixUrl( iframesrc
iframesrc ?: return, twoEmbedAPI
)
).document.selectFirst("iframe#framesrc")?.attr("src") ).document.selectFirst("iframe#framesrc")?.attr("src")
val video = app.get(fixUrl(framesrc ?: return, "$server/e/")).text.let {
Regex("file:\\s*\"(.*?m3u8.*?)\"").find(it)?.groupValues?.getOrNull(1)
}
M3u8Helper.generateM3u8( loadExtractor("https://embedwish.com/e/$framesrc", "$ref/", subtitleCallback, callback)
"2embed",
video ?: return,
"$server/",
).forEach(callback)
} }

View file

@ -694,7 +694,7 @@ open class SoraStream : TmdbProvider() {
) )
}, },
{ {
if (!res.isAnime) invoke2embed(res.imdbId, res.season, res.episode, callback) if (!res.isAnime) invoke2embed(res.imdbId, res.season, res.episode, subtitleCallback, callback)
}, },
{ {
if (!res.isAnime) invokeJump1( if (!res.isAnime) invokeJump1(

View file

@ -290,6 +290,7 @@ class SoraStreamLite : SoraStream() {
res.imdbId, res.imdbId,
res.season, res.season,
res.episode, res.episode,
subtitleCallback,
callback callback
) )
}, },

View file

@ -375,6 +375,15 @@ suspend fun extractOiya(url: String, quality: String): String? {
?: doc.selectFirst("div.wp-block-button a")?.attr("href") ?: doc.selectFirst("div.wp-block-button a")?.attr("href")
} }
fun deobfstr(hash: String, index: String): String {
var result = ""
for (i in hash.indices step 2) {
val j = hash.substring(i, i + 2)
result += (j.toInt(16) xor index[(i / 2) % index.length].code).toChar()
}
return result
}
suspend fun extractCovyn(url: String?): Pair<String?, String?>? { suspend fun extractCovyn(url: String?): Pair<String?, String?>? {
val request = session.get(url ?: return null, referer = "${tvMoviesAPI}/") val request = session.get(url ?: return null, referer = "${tvMoviesAPI}/")
val filehosting = session.baseClient.cookieJar.loadForRequest(url.toHttpUrl()) val filehosting = session.baseClient.cookieJar.loadForRequest(url.toHttpUrl())