This commit is contained in:
jack 2023-12-09 04:10:52 +07:00
parent 21947a3b1d
commit 1922d6dc26
5 changed files with 82 additions and 50 deletions

View file

@ -1634,17 +1634,15 @@ object SoraExtractor : SoraStream() {
app.get( app.get(
url, referer = "https://smashystream.com/" url, referer = "https://smashystream.com/"
).document.select("div#_default-servers a.server").map { ).document.select("div#_default-servers a.server").map {
it.attr("data-id") to it.text() it.attr("data-url") to it.text()
}.apmap { }.apmap {
when { when (it.second) {
it.second.contains(Regex("(Player F|Player SE|Player N|Player D)")) -> { "Player F" -> {
invokeSmashyFfix(it.second, it.first, url, callback) invokeSmashyFfix(it.second, it.first, url, callback)
} }
"Player D (Hindi)" -> {
it.second.equals("Player FM", true) -> invokeSmashyFm( invokeSmashyD(it.first, url, callback)
it.second, it.first, url, callback }
)
else -> return@apmap else -> return@apmap
} }
} }

View file

@ -425,3 +425,12 @@ data class SmashySources(
@JsonProperty("sourceUrls") var sourceUrls: ArrayList<String>? = arrayListOf(), @JsonProperty("sourceUrls") var sourceUrls: ArrayList<String>? = arrayListOf(),
@JsonProperty("subtitleUrls") var subtitleUrls: String? = null, @JsonProperty("subtitleUrls") var subtitleUrls: String? = null,
) )
data class SmashyDSources(
@JsonProperty("sourceUrls") var sourceUrls: ArrayList<SmashyDSourcesUrls>? = arrayListOf(),
)
data class SmashyDSourcesUrls(
@JsonProperty("file") var file: String? = null,
@JsonProperty("title") var title: String? = null,
)

View file

@ -536,7 +536,7 @@ open class SoraStream : TmdbProvider() {
}, },
{ {
if (!res.isAnime) invokeSmashyStream( if (!res.isAnime) invokeSmashyStream(
res.id, res.imdbId,
res.season, res.season,
res.episode, res.episode,
subtitleCallback, subtitleCallback,

View file

@ -144,7 +144,7 @@ class SoraStreamLite : SoraStream() {
}, },
{ {
if (!res.isAnime) invokeSmashyStream( if (!res.isAnime) invokeSmashyStream(
res.id, res.imdbId,
res.season, res.season,
res.episode, res.episode,
subtitleCallback, subtitleCallback,

View file

@ -45,7 +45,7 @@ import kotlin.collections.ArrayList
import kotlin.math.min import kotlin.math.min
var watchflxCookies: Map<String, String>? = null var watchflxCookies: Map<String, String>? = null
var filmxyCookies: Map<String,String>? = null var filmxyCookies: Map<String, String>? = null
var sfServer: String? = null var sfServer: String? = null
val encodedIndex = arrayOf( val encodedIndex = arrayOf(
@ -131,6 +131,7 @@ fun String.filterMedia(title: String?, yearNum: Int?, seasonNum: Int?): Boolean
seasonNum > 1 -> this.contains(Regex("(?i)(Season\\s0?1-0?$seasonNum)|(S0?1-S?0?$seasonNum)")) && this.contains( seasonNum > 1 -> this.contains(Regex("(?i)(Season\\s0?1-0?$seasonNum)|(S0?1-S?0?$seasonNum)")) && this.contains(
Regex("(?i)($fixTitle)|($title)") Regex("(?i)($fixTitle)|($title)")
) )
else -> this.contains(Regex("(?i)(Season\\s0?1)|(S0?1)")) && this.contains( else -> this.contains(Regex("(?i)(Season\\s0?1)|(S0?1)")) && this.contains(
Regex("(?i)($fixTitle)|($title)") Regex("(?i)($fixTitle)|($title)")
) && this.contains("$yearNum") ) && this.contains("$yearNum")
@ -449,22 +450,31 @@ suspend fun invokeSmashyFfix(
ref: String, ref: String,
callback: (ExtractorLink) -> Unit, callback: (ExtractorLink) -> Unit,
) { ) {
val res = app.get(url, referer = ref).text val json = app.get(url, referer = ref, headers = mapOf("X-Requested-With" to "XMLHttpRequest"))
val source = Regex("['\"]?file['\"]?:\\s*\"([^\"]+)").find(res)?.groupValues?.get(1) ?: return .parsedSafe<SmashySources>()
json?.sourceUrls?.map {
M3u8Helper.generateM3u8(
"Smashy [$name]",
it,
""
).forEach(callback)
}
source.split(",").map { links -> }
val quality = Regex("\\[(\\S+)]").find(links)?.groupValues?.getOrNull(1)?.trim()
val link = links.removePrefix("[$quality]").trim() suspend fun invokeSmashyD(
callback.invoke( url: String,
ExtractorLink( ref: String,
"Smashy [$name]", callback: (ExtractorLink) -> Unit,
"Smashy [$name]", ) {
decode(link).replace("\\/", "/"), val json = app.get(url, referer = ref, headers = mapOf("X-Requested-With" to "XMLHttpRequest"))
smashyStreamAPI, .parsedSafe<SmashyDSources>()
getQualityFromName(quality), json?.sourceUrls?.apmap {
INFER_TYPE, M3u8Helper.generateM3u8(
) "Smashy [Player D ${it.title}]",
) it.file ?: return@apmap,
""
).forEach(callback)
} }
} }
@ -492,6 +502,7 @@ suspend fun getDumpIdAndType(title: String?, year: Int?, season: Int?): Pair<Str
true true
) && it.releaseTime == "$year" && it.domainType == 0 ) && it.releaseTime == "$year" && it.domainType == 0
} }
1 -> { 1 -> {
it.name?.contains( it.name?.contains(
"$title", "$title",
@ -501,6 +512,7 @@ suspend fun getDumpIdAndType(title: String?, year: Int?, season: Int?): Pair<Str
true true
)) && it.domainType == 1 )) && it.domainType == 1
} }
else -> { else -> {
it.name?.contains(Regex("(?i)$title\\s?($season|${season.toRomanNumeral()}|Season\\s$season)")) == true && it.releaseTime == "$year" && it.domainType == 1 it.name?.contains(Regex("(?i)$title\\s?($season|${season.toRomanNumeral()}|Season\\s$season)")) == true && it.releaseTime == "$year" && it.domainType == 1
} }
@ -536,9 +548,10 @@ suspend fun invokeDrivetot(
) { ) {
val res = app.get(url) val res = app.get(url)
val data = res.document.select("form input").associate { it.attr("name") to it.attr("value") } val data = res.document.select("form input").associate { it.attr("name") to it.attr("value") }
app.post(res.url, data = data, cookies = res.cookies).document.select("div.card-body a").apmap { ele -> app.post(res.url, data = data, cookies = res.cookies).document.select("div.card-body a")
.apmap { ele ->
val href = base64Decode(ele.attr("href").substringAfterLast("/")).let { val href = base64Decode(ele.attr("href").substringAfterLast("/")).let {
if(it.contains("hubcloud.lol")) it.replace("hubcloud.lol", "hubcloud.in") else it if (it.contains("hubcloud.lol")) it.replace("hubcloud.lol", "hubcloud.in") else it
} }
loadExtractor(href, "$hdmovies4uAPI/", subtitleCallback) { link -> loadExtractor(href, "$hdmovies4uAPI/", subtitleCallback) { link ->
callback.invoke( callback.invoke(
@ -773,10 +786,13 @@ suspend fun fetchSfServer(): String {
return app.get("https://raw.githubusercontent.com/hexated/cloudstream-resources/main/sfmovies_server").text return app.get("https://raw.githubusercontent.com/hexated/cloudstream-resources/main/sfmovies_server").text
} }
suspend fun getFilmxyCookies(url: String) = filmxyCookies ?: fetchFilmxyCookies(url).also { filmxyCookies = it } suspend fun getFilmxyCookies(url: String) =
filmxyCookies ?: fetchFilmxyCookies(url).also { filmxyCookies = it }
suspend fun fetchFilmxyCookies(url: String): Map<String, String> { suspend fun fetchFilmxyCookies(url: String): Map<String, String> {
val defaultCookies = mutableMapOf("G_ENABLED_IDPS" to "google", "true_checker" to "1", "XID" to "1") val defaultCookies =
mutableMapOf("G_ENABLED_IDPS" to "google", "true_checker" to "1", "XID" to "1")
session.get( session.get(
url, url,
headers = mapOf( headers = mapOf(
@ -789,7 +805,10 @@ suspend fun fetchFilmxyCookies(url: String): Map<String, String> {
defaultCookies["PHPSESSID"] = phpsessid defaultCookies["PHPSESSID"] = phpsessid
val userNonce = val userNonce =
app.get("$filmxyAPI/login/?redirect_to=$filmxyAPI/", cookies = defaultCookies).document.select("script") app.get(
"$filmxyAPI/login/?redirect_to=$filmxyAPI/",
cookies = defaultCookies
).document.select("script")
.find { it.data().contains("var userNonce") }?.data()?.let { .find { it.data().contains("var userNonce") }?.data()?.let {
Regex("var\\suserNonce.*?\"(\\S+?)\";").find(it)?.groupValues?.get(1) Regex("var\\suserNonce.*?\"(\\S+?)\";").find(it)?.groupValues?.get(1)
} }
@ -813,7 +832,8 @@ suspend fun fetchFilmxyCookies(url: String): Map<String, String> {
return cookieJar.plus(defaultCookies) return cookieJar.plus(defaultCookies)
} }
suspend fun getWatchflxCookies() = watchflxCookies ?: fetchWatchflxCookies().also { watchflxCookies = it } suspend fun getWatchflxCookies() =
watchflxCookies ?: fetchWatchflxCookies().also { watchflxCookies = it }
suspend fun fetchWatchflxCookies(): Map<String, String> { suspend fun fetchWatchflxCookies(): Map<String, String> {
session.get(watchflxAPI) session.get(watchflxAPI)
@ -825,7 +845,8 @@ suspend fun fetchWatchflxCookies(): Map<String, String> {
"continue_as_temp" to "true" "continue_as_temp" to "true"
), cookies = cookies, headers = mapOf("X-Requested-With" to "XMLHttpRequest") ), cookies = cookies, headers = mapOf("X-Requested-With" to "XMLHttpRequest")
) )
return session.baseClient.cookieJar.loadForRequest(loginUrl.toHttpUrl()).associate { it.name to it.value } return session.baseClient.cookieJar.loadForRequest(loginUrl.toHttpUrl())
.associate { it.name to it.value }
} }
fun Document.findTvMoviesIframe(): String? { fun Document.findTvMoviesIframe(): String? {
@ -1160,7 +1181,11 @@ fun String.decodePrimewireXor(key: String): String {
fun vidsrctoDecrypt(text: String): String { fun vidsrctoDecrypt(text: String): String {
val parse = Base64.decode(text.toByteArray(), Base64.URL_SAFE) val parse = Base64.decode(text.toByteArray(), Base64.URL_SAFE)
val cipher = Cipher.getInstance("RC4") val cipher = Cipher.getInstance("RC4")
cipher.init(Cipher.DECRYPT_MODE, SecretKeySpec("8z5Ag5wgagfsOuhz".toByteArray(), "RC4"), cipher.parameters) cipher.init(
Cipher.DECRYPT_MODE,
SecretKeySpec("8z5Ag5wgagfsOuhz".toByteArray(), "RC4"),
cipher.parameters
)
return decode(cipher.doFinal(parse).toString(Charsets.UTF_8)) return decode(cipher.doFinal(parse).toString(Charsets.UTF_8))
} }
@ -1300,7 +1325,7 @@ fun isUpcoming(dateString: String?): Boolean {
} }
} }
fun getDate() : TmdbDate { fun getDate(): TmdbDate {
val formatter = SimpleDateFormat("yyyy-MM-dd", Locale.getDefault()) val formatter = SimpleDateFormat("yyyy-MM-dd", Locale.getDefault())
val calender = Calendar.getInstance() val calender = Calendar.getInstance()
val today = formatter.format(calender.time) val today = formatter.format(calender.time)