Skip to content

Commit

Permalink
sora: fix soraextrators
Browse files Browse the repository at this point in the history
  • Loading branch information
lisa committed Dec 21, 2023
1 parent f05a3cf commit 0695426
Show file tree
Hide file tree
Showing 7 changed files with 53 additions and 17 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ jobs:
SFMOVIES_API: ${{ secrets.SFMOVIES_API }}
CINEMATV_API: ${{ secrets.CINEMATV_API }}
OMOVIES_API: ${{ secrets.OMOVIES_API }}
FEBBOX_API: ${{ secrets.FEBBOX_API }}
run: |
cd $GITHUB_WORKSPACE/src
echo TMDB_API=$TMDB_API >> local.properties
Expand All @@ -70,6 +71,7 @@ jobs:
echo SFMOVIES_API=$SFMOVIES_API >> local.properties
echo CINEMATV_API=$CINEMATV_API >> local.properties
echo OMOVIES_API=$OMOVIES_API >> local.properties
echo FEBBOX_API=$FEBBOX_API >> local.properties
- name: Build Plugins
run: |
Expand Down
3 changes: 2 additions & 1 deletion SoraStream/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
import org.jetbrains.kotlin.konan.properties.Properties

// use an integer for version numbers
version = 206
version = 207

android {
defaultConfig {
val properties = Properties()
properties.load(project.rootProject.file("local.properties").inputStream())

buildConfigField("String", "TMDB_API", "\"${properties.getProperty("TMDB_API")}\"")
buildConfigField("String", "FEBBOX_API", "\"${properties.getProperty("FEBBOX_API")}\"")
buildConfigField("String", "OMOVIES_API", "\"${properties.getProperty("OMOVIES_API")}\"")
buildConfigField("String", "CINEMATV_API", "\"${properties.getProperty("CINEMATV_API")}\"")
buildConfigField("String", "SFMOVIES_API", "\"${properties.getProperty("SFMOVIES_API")}\"")
Expand Down
36 changes: 31 additions & 5 deletions SoraStream/src/main/kotlin/com/hexated/SoraExtractor.kt
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@ object SoraExtractor : SoraStream() {
id: Int? = null,
season: Int? = null,
episode: Int? = null,
subtitleCallback: (SubtitleFile) -> Unit,
callback: (ExtractorLink) -> Unit
) {
val url = if (season == null) {
Expand Down Expand Up @@ -1703,7 +1702,6 @@ object SoraExtractor : SoraStream() {
imdbId: String? = null,
season: Int? = null,
episode: Int? = null,
subtitleCallback: (SubtitleFile) -> Unit,
callback: (ExtractorLink) -> Unit,
) {
val url = if (season == null) {
Expand Down Expand Up @@ -2149,8 +2147,8 @@ object SoraExtractor : SoraStream() {
"$blackvidAPI/v3/tv/sources/$tmdbId/$season/$episode?key=$key"
}

val res = request(url)
val bytes = res.peekBody(1024 * 512).bytes().also { res.closeQuietly() }
val res = request(url).peekBody(1024 * 512)
val bytes = res.bytes().also { res.closeQuietly() }
val data = bytes.decrypt("2378f8e4e844f2dc839ab48f66e00acc2305a401")
val json = tryParseJson<BlackvidResponses>(data)

Expand Down Expand Up @@ -2260,7 +2258,6 @@ object SoraExtractor : SoraStream() {
}

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"
cinemaCookiesChecker(session)

val headers = mapOf(
"Cookie" to session,
Expand Down Expand Up @@ -2314,6 +2311,35 @@ object SoraExtractor : SoraStream() {

}

suspend fun invokeFebbox(
imdbId: String? = null,
season: Int? = null,
episode: Int? = null,
callback: (ExtractorLink) -> Unit,
) {
val url = if (season == null) {
"$febboxAPI/stream/movie/$imdbId.json"
} else {
"$febboxAPI/stream/series/$imdbId:$season:$episode.json"
}

val res = request(url).body
val data = res.string().also { res.closeQuietly() }
val video = tryParseJson<FebboxResponse>(data)?.streams?.find { it.url?.startsWith("https://www.febbox.com") == true }?.url

callback.invoke(
ExtractorLink(
"Febbox",
"Febbox",
video ?: return,
"",
Qualities.P1080.value,
INFER_TYPE
)
)

}

suspend fun invokeNinetv(
tmdbId: Int? = null,
season: Int? = null,
Expand Down
8 changes: 8 additions & 0 deletions SoraStream/src/main/kotlin/com/hexated/SoraParser.kt
Original file line number Diff line number Diff line change
Expand Up @@ -461,4 +461,12 @@ data class AoneroomResponse(
)
}
}
}

data class FebboxResponse(
@JsonProperty("streams") val streams: ArrayList<Streams>? = arrayListOf(),
) {
data class Streams(
@JsonProperty("url") val url: String? = null,
)
}
10 changes: 5 additions & 5 deletions SoraStream/src/main/kotlin/com/hexated/SoraStream.kt
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ import com.hexated.SoraExtractor.invokeUhdmovies
import com.hexated.SoraExtractor.invokeVegamovies
import com.hexated.SoraExtractor.invokeVidsrcto
import com.hexated.SoraExtractor.invokeCinemaTv
import com.hexated.SoraExtractor.invokeFebbox
import com.hexated.SoraExtractor.invokeOmovies
import com.hexated.SoraExtractor.invokeWatchsomuch
import com.hexated.SoraExtractor.invokeZshow
Expand Down Expand Up @@ -115,6 +116,7 @@ open class SoraStream : TmdbProvider() {
const val blackvidAPI = "https://prod.api.blackvid.space"
const val showflixAPI = "https://showflix.space"
const val aoneroomAPI = "https://api3.aoneroom.com"
const val febboxAPI = BuildConfig.FEBBOX_API

const val fdMoviesAPI = "https://freedrivemovie.lol"
const val uhdmoviesAPI = "https://uhdmovies.zip"
Expand Down Expand Up @@ -362,11 +364,10 @@ open class SoraStream : TmdbProvider() {

argamap(
{
if (!res.isAnime) invokeBlackvid(
res.id,
if (!res.isAnime) invokeFebbox(
res.imdbId,
res.season,
res.episode,
subtitleCallback,
callback
)
},
Expand All @@ -392,7 +393,7 @@ open class SoraStream : TmdbProvider() {
)
},
{
invokeVidSrc(res.id, res.season, res.episode, subtitleCallback, callback)
invokeVidSrc(res.id, res.season, res.episode, callback)
},
{
invokeDbgo(res.imdbId, res.season, res.episode, subtitleCallback, callback)
Expand Down Expand Up @@ -567,7 +568,6 @@ open class SoraStream : TmdbProvider() {
res.imdbId,
res.season,
res.episode,
subtitleCallback,
callback
)
},
Expand Down
9 changes: 4 additions & 5 deletions SoraStream/src/main/kotlin/com/hexated/SoraStreamLite.kt
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import com.hexated.SoraExtractor.invokeShowflix
import com.hexated.SoraExtractor.invokeVidSrc
import com.hexated.SoraExtractor.invokeVidsrcto
import com.hexated.SoraExtractor.invokeCinemaTv
import com.hexated.SoraExtractor.invokeFebbox
import com.hexated.SoraExtractor.invokeOmovies
import com.hexated.SoraExtractor.invokeWatchsomuch
import com.hexated.SoraExtractor.invokeZshow
Expand All @@ -53,11 +54,10 @@ class SoraStreamLite : SoraStream() {

argamap(
{
if (!res.isAnime) invokeBlackvid(
res.id,
if (!res.isAnime) invokeFebbox(
res.imdbId,
res.season,
res.episode,
subtitleCallback,
callback
)
},
Expand Down Expand Up @@ -100,7 +100,7 @@ class SoraStreamLite : SoraStream() {
)
},
{
invokeVidSrc(res.id, res.season, res.episode, subtitleCallback, callback)
invokeVidSrc(res.id, res.season, res.episode, callback)
},
{
invokeDbgo(res.imdbId, res.season, res.episode, subtitleCallback, callback)
Expand Down Expand Up @@ -158,7 +158,6 @@ class SoraStreamLite : SoraStream() {
res.imdbId,
res.season,
res.episode,
subtitleCallback,
callback
)
},
Expand Down
2 changes: 1 addition & 1 deletion SoraStream/src/main/kotlin/com/hexated/SoraUtils.kt
Original file line number Diff line number Diff line change
Expand Up @@ -648,7 +648,7 @@ suspend fun getTvMoviesServer(url: String, season: Int?, episode: Int?): Pair<St
}
}

suspend fun cinemaCookiesChecker(session: String) = cinemaCookiesChecker ?: fetchCinemaCookiesChecker(session).also { cinemaCookiesChecker = it }
suspend fun refreshCinemaCookies(session: String) = cinemaCookiesChecker ?: fetchCinemaCookiesChecker(session).also { cinemaCookiesChecker = it }

suspend fun fetchCinemaCookiesChecker(session: String): Boolean {
val wiwiApi = base64Decode("aHR0cHM6Ly9jaW5lbWEud2l3aWNlbnRlci5jb20=")
Expand Down

0 comments on commit 0695426

Please sign in to comment.