This commit is contained in:
monica 2023-12-24 07:57:10 +07:00
parent 9954986e47
commit ae93b677e1
3 changed files with 33 additions and 69 deletions

View file

@ -1319,7 +1319,7 @@ object SoraExtractor : SoraStream() {
} }
type.contains("oiya") || type.contains("rarbgx") -> { type.contains("oiya") || type.contains("rarbgx") -> {
val oiyaLink = extractOiya(fdLink ?: return@apmap null, qualities) val oiyaLink = extractOiya(fdLink ?: return@apmap null)
if (oiyaLink?.contains("gdtot") == true) { if (oiyaLink?.contains("gdtot") == true) {
val gdBotLink = extractGdbot(oiyaLink) val gdBotLink = extractGdbot(oiyaLink)
extractGdflix(gdBotLink ?: return@apmap null) extractGdflix(gdBotLink ?: return@apmap null)
@ -2211,7 +2211,8 @@ object SoraExtractor : SoraStream() {
"$cinemaTvAPI/shows/play/$id-$slug-$year" "$cinemaTvAPI/shows/play/$id-$slug-$year"
} }
val session = "PHPSESSID=ngr4cudjrimdnhkth30ssohs0n; _csrf=a6ffd7bb7654083fce6df528225a238d0e85aa1fb885dc7638c1259ec1ba0d5ca%3A2%3A%7Bi%3A0%3Bs%3A5%3A%22_csrf%22%3Bi%3A1%3Bs%3A32%3A%22mTTLiDLjxohs-CpKk0bjRH3HdYMB9uBV%22%3B%7D; _ga=GA1.1.1195498587.1701871187; _ga_VZD7HJ3WK6=GS1.1.$unixTime.4.0.1.$unixTime.0.0.0" val session =
"PHPSESSID=ngr4cudjrimdnhkth30ssohs0n; _csrf=a6ffd7bb7654083fce6df528225a238d0e85aa1fb885dc7638c1259ec1ba0d5ca%3A2%3A%7Bi%3A0%3Bs%3A5%3A%22_csrf%22%3Bi%3A1%3Bs%3A32%3A%22mTTLiDLjxohs-CpKk0bjRH3HdYMB9uBV%22%3B%7D; _ga=GA1.1.1195498587.1701871187; _ga_VZD7HJ3WK6=GS1.1.$unixTime.4.0.1.$unixTime.0.0.0"
val headers = mapOf( val headers = mapOf(
"Cookie" to session, "Cookie" to session,
@ -2288,16 +2289,16 @@ object SoraExtractor : SoraStream() {
) )
} }
val media = mediaRes.find { val filter = mediaRes.filter {
it.title.equals( it.title.equals(title, true) && it.type == if (season == null) "Movie" else "TV"
title, }
true
) && it.infor.equals(if (season == null) "$year" else "SS $lastSeason") && it.type == if (season == null) "Movie" else "TV" val media = if (season == null) {
} ?: mediaRes.find { filter.find { it.infor == "$year" }
it.title.equals( } else {
title, filter.find { it.infor == "SS $lastSeason" }
true ?: filter.find { it.infor == "SS ${lastSeason?.minus(1)}" }
) && it.infor.contains(if (season == null) "$year" else "SS") && it.type == if (season == null) "Movie" else "TV" ?: filter.find { it.infor == "SS 1" }
} }
val shareId = media?.url?.substringAfterLast("/") ?: return val shareId = media?.url?.substringAfterLast("/") ?: return
@ -2307,14 +2308,21 @@ object SoraExtractor : SoraStream() {
.parsedSafe<FebboxResponse>()?.data?.link?.substringAfterLast("/") .parsedSafe<FebboxResponse>()?.data?.link?.substringAfterLast("/")
val headers = mapOf("Accept-Language" to "en") val headers = mapOf("Accept-Language" to "en")
val shareRes = app.get("$febboxAPI/file/file_share_list?share_key=${shareKey ?: return}", headers = headers) val shareRes = app.get(
"$febboxAPI/file/file_share_list?share_key=${shareKey ?: return}",
headers = headers
)
.parsedSafe<FebboxResponse>()?.data .parsedSafe<FebboxResponse>()?.data
val fids = if (season == null) { val fids = if (season == null) {
shareRes?.file_list shareRes?.file_list
} else { } else {
val parentId = shareRes?.file_list?.find { it.file_name.equals("season $season", true) }?.fid val parentId =
app.get("$febboxAPI/file/file_share_list?share_key=${shareKey}&parent_id=$parentId&page=1", headers = headers) shareRes?.file_list?.find { it.file_name.equals("season $season", true) }?.fid
app.get(
"$febboxAPI/file/file_share_list?share_key=${shareKey}&parent_id=$parentId&page=1",
headers = headers
)
.parsedSafe<FebboxResponse>()?.data?.file_list?.filter { .parsedSafe<FebboxResponse>()?.data?.file_list?.filter {
it.file_name?.contains( it.file_name?.contains(
"s${seasonSlug}e${episodeSlug}", "s${seasonSlug}e${episodeSlug}",

View file

@ -116,7 +116,7 @@ open class SoraStream : TmdbProvider() {
const val aoneroomAPI = "https://api3.aoneroom.com" const val aoneroomAPI = "https://api3.aoneroom.com"
const val febboxAPI = "https://www.febbox.com" const val febboxAPI = "https://www.febbox.com"
const val fdMoviesAPI = "https://freedrivemovie.lol" const val fdMoviesAPI = "https://freedrivemovie.com"
const val uhdmoviesAPI = "https://uhdmovies.zip" const val uhdmoviesAPI = "https://uhdmovies.zip"
const val gMoviesAPI = "https://gdrivemovies.xyz" const val gMoviesAPI = "https://gdrivemovies.xyz"
const val hdmovies4uAPI = "https://hdmovies4u.band" const val hdmovies4uAPI = "https://hdmovies4u.band"

View file

@ -49,7 +49,6 @@ 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
var cinemaCookiesChecker: Boolean? = null
val encodedIndex = arrayOf( val encodedIndex = arrayOf(
"GamMovies", "GamMovies",
@ -331,10 +330,8 @@ suspend fun getDrivebotLink(url: String?): String? {
?.data()?.substringAfter("window.open('")?.substringBefore("')") ?.data()?.substringAfter("window.open('")?.substringBefore("')")
} }
suspend fun extractOiya(url: String, quality: String): String? { suspend fun extractOiya(url: String): String? {
val doc = app.get(url).document return app.get(url).document.selectFirst("div.wp-block-button a")?.attr("href")
return doc.selectFirst("div.wp-block-button a:matches((?i)$quality)")?.attr("href")
?: doc.selectFirst("div.wp-block-button a")?.attr("href")
} }
fun deobfstr(hash: String, index: String): String { fun deobfstr(hash: String, index: String): String {
@ -592,6 +589,7 @@ suspend fun bypassHrefli(url: String): String? {
fun Document.getFormUrl(): String { fun Document.getFormUrl(): String {
return this.select("form#landing").attr("action") return this.select("form#landing").attr("action")
} }
fun Document.getFormData(): Map<String, String> { fun Document.getFormData(): Map<String, String> {
return this.select("form#landing input").associate { it.attr("name") to it.attr("value") } return this.select("form#landing input").associate { it.attr("name") to it.attr("value") }
} }
@ -606,7 +604,8 @@ suspend fun bypassHrefli(url: String): String? {
formData = res.getFormData() formData = res.getFormData()
res = app.post(formUrl, data = formData).document res = app.post(formUrl, data = formData).document
val skToken = res.selectFirst("script:containsData(?go=)")?.data()?.substringAfter("?go=")?.substringBefore("\"") ?: return null val skToken = res.selectFirst("script:containsData(?go=)")?.data()?.substringAfter("?go=")
?.substringBefore("\"") ?: return null
val driveUrl = app.get( val driveUrl = app.get(
"$host?go=$skToken", cookies = mapOf( "$host?go=$skToken", cookies = mapOf(
skToken to "${formData["_wp_http2"]}" skToken to "${formData["_wp_http2"]}"
@ -648,49 +647,6 @@ suspend fun getTvMoviesServer(url: String, season: Int?, episode: Int?): Pair<St
} }
} }
suspend fun refreshCinemaCookies(session: String) = cinemaCookiesChecker ?: fetchCinemaCookiesChecker(session).also { cinemaCookiesChecker = it }
suspend fun fetchCinemaCookiesChecker(session: String): Boolean {
val wiwiApi = base64Decode("aHR0cHM6Ly9jaW5lbWEud2l3aWNlbnRlci5jb20=")
suspend fun createConfig(headers: Map<String, String>) {
app.get(
"$wiwiApi/api/v1/app-config",
headers = headers
).text
}
suspend fun checkCookies(session: String, headers: Map<String, String>) {
app.post(
"$wiwiApi/api/v1/cookie",
data = mapOf("cookie" to session),
headers = headers
).text
}
val configHeaders = mapOf(
"App-version" to "3.4",
"Authorization" to "Basic d2l3aTpXaXdpQDIwMjA=",
"Country" to "Indonesia",
"Device-id" to getDeviceId(),
"User-id" to "user-6694327",
)
listOf(1..2).apmap { createConfig(configHeaders) }
val unityData = """
{
"platform": "android",
"idfi": "d1ec7051-f58f-4ddb-9da8-8debb82cfbea",
"sdkVersionName": "4.3.0",
"gdpr.consent": true,
"user.nonbehavioral": false,
"unity.privacy.permissions.all": false,
"unity.privacy.permissions.gameExp": false,
"unity.privacy.permissions.ads": false,
"unity.privacy.permissions.external": false
}
""".trimIndent().toJson().toRequestBody(RequestBodyTypes.JSON.toMediaTypeOrNull())
app.post("https://configv2.unityads.unity3d.com/privacy/4519473/state", requestBody = unityData).text
listOf(1..4).map {checkCookies(session, configHeaders)}
return true
}
suspend fun getSfServer() = sfServer ?: fetchSfServer().also { sfServer = it } suspend fun getSfServer() = sfServer ?: fetchSfServer().also { sfServer = it }
suspend fun fetchSfServer(): String { suspend fun fetchSfServer(): String {