This commit is contained in:
jack 2023-10-27 19:46:01 +07:00
parent 783ae437d1
commit e30bce94ab
5 changed files with 13 additions and 27 deletions

View file

@ -42,6 +42,7 @@ jobs:
- name: Access Secrets
env:
TMDB_API: ${{ secrets.TMDB_API }}
SORA_API: ${{ secrets.SORA_API }}
SORAHE: ${{ secrets.SORAHE }}
SORAXA: ${{ secrets.SORAXA }}
@ -60,6 +61,7 @@ jobs:
run: |
cd $GITHUB_WORKSPACE/src
echo SORA_API=$SORA_API >> local.properties
echo TMDB_API=$TMDB_API >> local.properties
echo SORAHE=$SORAHE >> local.properties
echo SORAXA=$SORAXA >> local.properties
echo SORATED=$SORATED >> local.properties

View file

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

View file

@ -18,7 +18,6 @@ class KuramanimeProvider : MainAPI() {
override val hasDownloadSupport = true
private var headers: Map<String,String> = mapOf()
private var cookies: Map<String,String> = mapOf()
private var misc: String? = null
override val supportedTypes = setOf(
TvType.Anime,
TvType.AnimeMovie,
@ -177,12 +176,12 @@ class KuramanimeProvider : MainAPI() {
link,
referer = "",
quality = quality ?: Qualities.Unknown.value,
headers = mapOf(
"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-",
"Sec-Fetch-Dest" to "video",
"Sec-Fetch-Mode" to "no-cors",
),
// headers = mapOf(
// "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-",
// "Sec-Fetch-Dest" to "video",
// "Sec-Fetch-Mode" to "no-cors",
// ),
)
)
}
@ -197,7 +196,7 @@ class KuramanimeProvider : MainAPI() {
val req = app.get(data)
val res = req.document
val token = res.select("meta[name=csrf-token]").attr("content")
val stRt = res.selectFirst("script:containsData(window\\.stRt)")?.data()?.substringAfter("stRt = \"")?.substringBefore("\"") ?: return false
val stBt = res.selectFirst("script:containsData(stBk)")?.data()?.substringAfter("stBk = \"")?.substringBefore("\"")?.substringAfterLast("/") ?: return false
headers = mapOf(
"X-Requested-With" to "XMLHttpRequest",
"X-CSRF-TOKEN" to token
@ -205,7 +204,7 @@ class KuramanimeProvider : MainAPI() {
cookies = req.cookies
res.select("select#changeServer option").apmap { source ->
val server = source.attr("value")
val link = "$data?dfgRr1OagZvvxbzHNpyCy0FqJQ18mCnb=${getMisc(stRt)}&twEvZlbZbYRWBdKKwxkOnwYF0VWoGGVg=$server"
val link = "$data?dfgRr1OagZvvxbzHNpyCy0FqJQ18mCnb=$stBt&twEvZlbZbYRWBdKKwxkOnwYF0VWoGGVg=$server"
if (server.contains(Regex("(?i)kuramadrive|archive"))) {
invokeLocalSource(link, server, data, callback)
} else {
@ -223,9 +222,4 @@ class KuramanimeProvider : MainAPI() {
return true
}
private suspend fun getMisc(url: String) = misc ?: fetchMisc(url)
private suspend fun fetchMisc(url: String): String {
return app.post(url, headers = headers, cookies = cookies).parsed()
}
}

View file

@ -8,6 +8,7 @@ android {
val properties = Properties()
properties.load(project.rootProject.file("local.properties").inputStream())
buildConfigField("String", "TMDB_API", "\"${properties.getProperty("TMDB_API")}\"")
buildConfigField("String", "SFMOVIES_API", "\"${properties.getProperty("SFMOVIES_API")}\"")
buildConfigField("String", "ZSHOW_API", "\"${properties.getProperty("ZSHOW_API")}\"")
buildConfigField("String", "SORA_API", "\"${properties.getProperty("SORA_API")}\"")

View file

@ -52,7 +52,6 @@ import com.hexated.SoraExtractor.invokeWatchsomuch
import com.hexated.SoraExtractor.invokeZshow
import com.lagradost.cloudstream3.LoadResponse.Companion.addImdbId
import com.lagradost.cloudstream3.LoadResponse.Companion.addTMDbId
import com.lagradost.cloudstream3.extractors.VidSrcExtractor
import com.lagradost.cloudstream3.utils.AppUtils.parseJson
import com.lagradost.cloudstream3.utils.AppUtils.toJson
import com.lagradost.cloudstream3.utils.ExtractorLink
@ -79,8 +78,7 @@ open class SoraStream : TmdbProvider() {
const val malsyncAPI = "https://api.malsync.moe"
const val jikanAPI = "https://api.jikan.moe/v4"
private val apiKey =
base64DecodeAPI("ZTM=NTg=MjM=MjM=ODc=MzI=OGQ=MmE=Nzk=Nzk=ZjI=NTA=NDY=NDA=MzA=YjA=") // PLEASE DON'T STEAL
private const val apiKey = BuildConfig.TMDB_API
/** ALL SOURCES */
const val twoEmbedAPI = "https://www.2embed.cc"
@ -145,10 +143,6 @@ open class SoraStream : TmdbProvider() {
}
}
private fun base64DecodeAPI(api: String): String {
return api.chunked(4).map { base64Decode(it) }.reversed().joinToString("")
}
}
override val mainPage = mainPageOf(
@ -355,11 +349,6 @@ open class SoraStream : TmdbProvider() {
}
}
override suspend fun extractorVerifierJob(extractorData: String?) {
if (extractorData == null) return
VidSrcExtractor.validatePass(extractorData)
}
override suspend fun loadLinks(
data: String,
isCasting: Boolean,