sora: small fix

This commit is contained in:
hexated 2023-03-30 12:21:25 +07:00
parent 68991e3941
commit f274a6175a
4 changed files with 56 additions and 3 deletions

View file

@ -1,5 +1,5 @@
// use an integer for version numbers // use an integer for version numbers
version = 108 version = 109
cloudstream { cloudstream {

View file

@ -1282,7 +1282,7 @@ object SoraExtractor : SoraStream() {
} }
sources.apmap { (quality, link) -> sources.apmap { (quality, link) ->
val driveLink = bypassHrefli(link ?: return@apmap null) val driveLink = bypassTechmny(link ?: return@apmap null)
val base = getBaseUrl(driveLink ?: return@apmap null) val base = getBaseUrl(driveLink ?: return@apmap null)
val resDoc = app.get(driveLink).document val resDoc = app.get(driveLink).document
val bitLink = resDoc.selectFirst("a.btn.btn-outline-success")?.attr("href") val bitLink = resDoc.selectFirst("a.btn.btn-outline-success")?.attr("href")

View file

@ -103,7 +103,7 @@ open class SoraStream : TmdbProvider() {
const val kickassanimeAPI = "https://www2.kickassanime.ro" // disabled due to consumet const val kickassanimeAPI = "https://www2.kickassanime.ro" // disabled due to consumet
const val kissKhAPI = "https://kisskh.me" const val kissKhAPI = "https://kisskh.me"
const val lingAPI = "https://ling-online.net" const val lingAPI = "https://ling-online.net"
const val uhdmoviesAPI = "https://uhdmovies.world" const val uhdmoviesAPI = "https://uhdmovies.vip"
const val fwatayakoAPI = "https://5100.svetacdn.in" const val fwatayakoAPI = "https://5100.svetacdn.in"
const val gMoviesAPI = "https://gdrivemovies.xyz" const val gMoviesAPI = "https://gdrivemovies.xyz"
const val fdMoviesAPI = "https://freedrivemovie.lol" const val fdMoviesAPI = "https://freedrivemovie.lol"

View file

@ -646,6 +646,59 @@ suspend fun bypassHrefli(url: String): String? {
return fixUrl(path, getBaseUrl(driveUrl)) return fixUrl(path, getBaseUrl(driveUrl))
} }
suspend fun bypassTechmny(url: String) : String? {
val postUrl = url.substringBefore("?id=").substringAfter("/?")
var res = app.post(
postUrl, data = mapOf(
"_wp_http_c" to url.substringAfter("?id=")
)
)
val (longC, catC, _) = getTechmnyCookies(res.text)
var headers = mapOf("Cookie" to "$longC; $catC")
var formLink = res.document.selectFirst("center a")?.attr("href")
res = app.get(formLink ?: return null, headers = headers)
val (longC2, _, postC) = getTechmnyCookies(res.text)
headers = mapOf("Cookie" to "$catC; $longC2; $postC")
formLink = res.document.selectFirst("center a")?.attr("href")
res = app.get(formLink ?: return null, headers = headers)
val goToken = res.text.substringAfter("?go=").substringBefore("\"")
val tokenUrl = "$postUrl?go=$goToken"
val newLongC = "$goToken=" + longC2.substringAfter("=")
headers = mapOf("Cookie" to "$catC; rdst_post=; $newLongC")
val driveUrl = app.get(tokenUrl, headers = headers).document.selectFirst("meta[http-equiv=refresh]")?.attr("content")?.substringAfter("url=")
val path = app.get(driveUrl ?: return null).text.substringAfter("replace(\"")
.substringBefore("\")")
if (path == "/404") return null
return fixUrl(path, getBaseUrl(driveUrl))
}
private fun getTechmnyCookies(page: String): Triple<String, String, String> {
val cat = "rdst_cat"
val post = "rdst_post"
val longC = page.substringAfter(".setTime")
.substringAfter("document.cookie = \"")
.substringBefore("\"")
.substringBefore(";")
val catC = if (page.contains("$cat=")) {
page.substringAfterLast("$cat=")
.substringBefore(";").let {
"$cat=$it"
}
} else { "" }
val postC = if (page.contains("$post=")) {
page.substringAfterLast("$post=")
.substringBefore(";").let {
"$post=$it"
}
} else { "" }
return Triple(longC, catC, postC)
}
suspend fun getTvMoviesServer(url: String, season: Int?, episode: Int?): Pair<String, String?>? { suspend fun getTvMoviesServer(url: String, season: Int?, episode: Int?): Pair<String, String?>? {
val req = app.get(url) val req = app.get(url)