This commit is contained in:
jack 2023-11-21 21:46:11 +07:00
parent f6051f81bc
commit ef00741692
7 changed files with 80 additions and 20 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 = 27 version = 28
android { android {
defaultConfig { defaultConfig {

View file

@ -111,7 +111,7 @@ object NineTv {
"Referer" to (referer ?: ""), "Referer" to (referer ?: ""),
)) ))
val master = Regex("\\s*=\\s*'([^']+)").find(res.text)?.groupValues?.get(1) val master = Regex("\\s*=\\s*'([^']+)").find(res.text)?.groupValues?.get(1)
val key = res.document.getKeys() ?: throw ErrorLoadingException("can't generate key") val key = "tSIsE8FgpRkv3QQQ"
val decrypt = AesHelper.cryptoAESHandler(master ?: return, key.toByteArray(), false) val decrypt = AesHelper.cryptoAESHandler(master ?: return, key.toByteArray(), false)
?.replace("\\", "") ?.replace("\\", "")
?: throw ErrorLoadingException("failed to decrypt") ?: throw ErrorLoadingException("failed to decrypt")

View file

@ -176,12 +176,12 @@ class KuramanimeProvider : MainAPI() {
link, link,
referer = "", referer = "",
quality = quality ?: Qualities.Unknown.value, quality = quality ?: Qualities.Unknown.value,
// headers = mapOf( headers = mapOf(
// "Accept" to "video/webm,video/ogg,video/*;q=0.9,application/ogg;q=0.7,audio/*;q=0.6,*/*;q=0.5", "Accept" to "video/webm,video/ogg,video/*;q=0.9,application/ogg;q=0.7,audio/*;q=0.6,*/*;q=0.5",
// "Range" to "bytes=0-", "Range" to "bytes=0-",
// "Sec-Fetch-Dest" to "video", "Sec-Fetch-Dest" to "video",
// "Sec-Fetch-Mode" to "no-cors", "Sec-Fetch-Mode" to "no-cors",
// ), ),
) )
) )
} }
@ -193,18 +193,20 @@ class KuramanimeProvider : MainAPI() {
subtitleCallback: (SubtitleFile) -> Unit, subtitleCallback: (SubtitleFile) -> Unit,
callback: (ExtractorLink) -> Unit callback: (ExtractorLink) -> Unit
): Boolean { ): Boolean {
val req = app.get(data) val req = app.get(data)
val res = req.document val res = req.document
val token = res.select("meta[name=csrf-token]").attr("content") val token = res.select("meta[name=csrf-token]").attr("content")
val st = res.select("input#kuramaRoute").attr("value")
headers = mapOf( headers = mapOf(
"Accept" to "application/json, text/javascript, */*; q=0.01",
"Authorization" to "Bearer YTNWeVlXMWhibWx0WlRwaVMwNUNTWFk1U1d4NVFsbDBObE5KWW10a1JWVXpkWFIzTTA5c05rcFJPSFJ6T2pFM01EQTFOemN5TnpBd01EQT0%3D",
"X-Requested-With" to "XMLHttpRequest", "X-Requested-With" to "XMLHttpRequest",
"X-CSRF-TOKEN" to token "X-CSRF-TOKEN" to token
) )
cookies = req.cookies cookies = req.cookies
res.select("select#changeServer option").apmap { source -> res.select("select#changeServer option").apmap { source ->
val server = source.attr("value") val server = source.attr("value")
val link = "$data?dfgRr1OagZvvxbzHNpyCy0FqJQ18mCnb=$st&twEvZlbZbYRWBdKKwxkOnwYF0VWoGGVg=$server" val link = "$data?dfgRr1OagZvvxbzHNpyCy0FqJQ18mCnb=${getMisc()}&twEvZlbZbYRWBdKKwxkOnwYF0VWoGGVg=$server"
if (server.contains(Regex("(?i)kuramadrive|archive"))) { if (server.contains(Regex("(?i)kuramadrive|archive"))) {
invokeLocalSource(link, server, data, callback) invokeLocalSource(link, server, data, callback)
} else { } else {
@ -222,4 +224,21 @@ class KuramanimeProvider : MainAPI() {
return true return true
} }
private suspend fun getMisc(): String {
val misc = app.get(
"$mainUrl/misc/post/EVhcpMNbO77acNZcHr2XVjaG8WAdNC1u",
headers = headers + mapOf("X-Request-ID" to getRequestId()),
cookies = cookies
)
cookies = misc.cookies
return misc.parsed()
}
private fun getRequestId(length: Int = 8): String {
val allowedChars = ('a'..'z') + ('0'..'9')
return (1..length)
.map { allowedChars.random() }
.joinToString("")
}
} }

View file

@ -253,7 +253,7 @@ object NineTv {
"Referer" to (referer ?: ""), "Referer" to (referer ?: ""),
)) ))
val master = Regex("\\s*=\\s*'([^']+)").find(res.text)?.groupValues?.get(1) val master = Regex("\\s*=\\s*'([^']+)").find(res.text)?.groupValues?.get(1)
val key = res.document.getKeys() ?: throw ErrorLoadingException("can't generate key") val key = "tSIsE8FgpRkv3QQQ"
val decrypt = AesHelper.cryptoAESHandler(master ?: return, key.toByteArray(), false) val decrypt = AesHelper.cryptoAESHandler(master ?: return, key.toByteArray(), false)
?.replace("\\", "") ?.replace("\\", "")
?: throw ErrorLoadingException("failed to decrypt") ?: throw ErrorLoadingException("failed to decrypt")

View file

@ -1936,6 +1936,26 @@ object SoraExtractor : SoraStream() {
} }
suspend fun invokeGomovies(
title: String? = null,
year: Int? = null,
season: Int? = null,
episode: Int? = null,
callback: (ExtractorLink) -> Unit,
) {
invokeGpress(
title,
year,
season,
episode,
callback,
"https://gomovies-online.cam",
"Gomovies",
"_smQamBQsETb",
"_sBWcqbTBMaT"
)
}
private suspend fun invokeGpress( private suspend fun invokeGpress(
title: String? = null, title: String? = null,
year: Int? = null, year: Int? = null,
@ -1957,9 +1977,14 @@ object SoraExtractor : SoraStream() {
} else { } else {
"$title Season $season" "$title Season $season"
} }
val idCookies =
val doc = app.get("$api/search/$query").document mapOf(
"advanced-frontendgomovies7" to "bjd4n0nnv4hlt4fj5cdjgbrne2",
"_identitygomovies7" to "52fdc70b008c0b1d881dac0f01cca819edd512de01cc8bbc1224ed4aafb78b52a:2:{i:0;s:18:\"_identitygomovies7\";i:1;s:52:\"[2050366,\"HnVRRAObTASOJEr45YyCM8wiHol0V1ko\",2592000]\";}"
)
val req = app.get("$api/search/$query")
val doc = req.document
var cookies = req.cookies + idCookies
val media = doc.select("div.$mediaSelector").map { val media = doc.select("div.$mediaSelector").map {
Triple( Triple(
it.attr("data-filmName"), it.attr("data-year"), it.select("a").attr("href") it.attr("data-filmName"), it.attr("data-year"), it.select("a").attr("href")
@ -1983,12 +2008,14 @@ object SoraExtractor : SoraStream() {
val iframe = if (season == null) { val iframe = if (season == null) {
media.third media.third
} else { } else {
app.get( val res = app.get(
fixUrl( fixUrl(
media.third, media.third,
api api
) ), cookies = cookies
).document.selectFirst("div#$episodeSelector a:contains(Episode ${slug.second})") )
cookies = cookies + res.cookies
res.document.selectFirst("div#$episodeSelector a:contains(Episode ${slug.second})")
?.attr("href") ?.attr("href")
} ?: return } ?: return
@ -1998,11 +2025,11 @@ object SoraExtractor : SoraStream() {
media.third.substringAfterLast("/") to iframe.substringAfterLast("/") media.third.substringAfterLast("/") to iframe.substringAfterLast("/")
.substringBefore("-") .substringBefore("-")
} }
val res = app.get(fixUrl(iframe, api), verify = false) val res = app.get(fixUrl(iframe ?: return, api), cookies = cookies, verify = false)
val serverUrl = res.document.selectFirst("script:containsData(pushState)")?.data()?.let { val serverUrl = res.document.selectFirst("script:containsData(pushState)")?.data()?.let {
""",\s*'([^']+)""".toRegex().find(it)?.groupValues?.get(1) """,\s*'([^']+)""".toRegex().find(it)?.groupValues?.get(1)
} ?: return } ?: return
val cookies = res.cookies cookies = cookies + res.cookies
val url = res.document.select("meta[property=og:url]").attr("content") val url = res.document.select("meta[property=og:url]").attr("content")
val headers = mapOf("X-Requested-With" to "XMLHttpRequest") val headers = mapOf("X-Requested-With" to "XMLHttpRequest")
val qualities = intArrayOf(2160, 1440, 1080, 720, 480, 360) val qualities = intArrayOf(2160, 1440, 1080, 720, 480, 360)
@ -2445,7 +2472,7 @@ object SoraExtractor : SoraStream() {
ExtractorLink( ExtractorLink(
"SFMovies", "SFMovies",
"SFMovies", "SFMovies",
fixUrl(video, base64DecodeAPI("YQ==bm4=dGE=YXQ=L3I=ZXQ=Lm4=d3M=ZG8=aW4=Lnc=cmU=Y28=Yi4=bG8=LmI=bmE=YW4=dHQ=cmE=Ly8=czo=dHA=aHQ=")), fixUrl(video, base64DecodeAPI("cw==aWM=c20=Y28=dC8=bmU=cy4=b3c=bmQ=d2k=ZS4=b3I=LmM=b2I=Ymw=cy4=aWM=c20=Y28=Ly8=czo=dHA=aHQ=")),
"", "",
Qualities.P1080.value, Qualities.P1080.value,
INFER_TYPE INFER_TYPE

View file

@ -33,6 +33,7 @@ import com.hexated.SoraExtractor.invokeRidomovies
import com.hexated.SoraExtractor.invokeSmashyStream import com.hexated.SoraExtractor.invokeSmashyStream
import com.hexated.SoraExtractor.invokeDumpStream import com.hexated.SoraExtractor.invokeDumpStream
import com.hexated.SoraExtractor.invokeEmovies import com.hexated.SoraExtractor.invokeEmovies
import com.hexated.SoraExtractor.invokeGomovies
import com.hexated.SoraExtractor.invokeHdmovies4u import com.hexated.SoraExtractor.invokeHdmovies4u
import com.hexated.SoraExtractor.invokeMoment import com.hexated.SoraExtractor.invokeMoment
import com.hexated.SoraExtractor.invokeMultimovies import com.hexated.SoraExtractor.invokeMultimovies
@ -679,6 +680,9 @@ open class SoraStream : TmdbProvider() {
callback callback
) )
}, },
{
if (!res.isAnime) invokeGomovies(res.title, res.year, res.season, res.episode, callback)
},
{ {
if (!res.isAnime) invokeShowflix( if (!res.isAnime) invokeShowflix(
res.title, res.title,

View file

@ -22,6 +22,7 @@ import com.hexated.SoraExtractor.invokeRidomovies
import com.hexated.SoraExtractor.invokeSmashyStream import com.hexated.SoraExtractor.invokeSmashyStream
import com.hexated.SoraExtractor.invokeDumpStream import com.hexated.SoraExtractor.invokeDumpStream
import com.hexated.SoraExtractor.invokeEmovies import com.hexated.SoraExtractor.invokeEmovies
import com.hexated.SoraExtractor.invokeGomovies
import com.hexated.SoraExtractor.invokeMoment import com.hexated.SoraExtractor.invokeMoment
import com.hexated.SoraExtractor.invokeMultimovies import com.hexated.SoraExtractor.invokeMultimovies
import com.hexated.SoraExtractor.invokeNetmovies import com.hexated.SoraExtractor.invokeNetmovies
@ -244,6 +245,15 @@ class SoraStreamLite : SoraStream() {
callback callback
) )
}, },
{
if (!res.isAnime) invokeGomovies(
res.title,
res.year,
res.season,
res.episode,
callback
)
},
{ {
invokeMoment(res.imdbId, res.season, res.episode, callback) invokeMoment(res.imdbId, res.season, res.episode, callback)
}, },