diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ac71c021..a2aee2ec 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -40,10 +40,18 @@ jobs: - name: Setup Android SDK uses: android-actions/setup-android@v2 - - name: Access SORA_API + - name: Access Secrets env: SORA_API: ${{ secrets.SORA_API }} - run: echo SORA_API=$SORA_API > $GITHUB_WORKSPACE/src/local.properties + SORAHE: ${{ secrets.SORAHE }} + SORAXA: ${{ secrets.SORAXA }} + SORATED: ${{ secrets.SORATED }} + run: | + cd $GITHUB_WORKSPACE/src + echo SORA_API=$SORA_API > local.properties + echo SORAHE=$SORAHE > local.properties + echo SORAXA=$SORAXA > local.properties + echo SORATED=$SORATED > local.properties - name: Build Plugins run: | diff --git a/OploverzProvider/src/main/kotlin/com/hexated/Extractors.kt b/OploverzProvider/src/main/kotlin/com/hexated/Extractors.kt index 98d831b0..bb6fc3cb 100644 --- a/OploverzProvider/src/main/kotlin/com/hexated/Extractors.kt +++ b/OploverzProvider/src/main/kotlin/com/hexated/Extractors.kt @@ -32,10 +32,6 @@ class Krakenfiles : ExtractorApi() { } - data class Source( - @JsonProperty("url") val url: String? = null, - ) - } class Gofile : ExtractorApi() { diff --git a/SoraStream/build.gradle.kts b/SoraStream/build.gradle.kts index c90729d7..0ecebf3e 100644 --- a/SoraStream/build.gradle.kts +++ b/SoraStream/build.gradle.kts @@ -9,6 +9,9 @@ android { properties.load(project.rootProject.file("local.properties").inputStream()) buildConfigField("String", "SORA_API", "\"${properties.getProperty("SORA_API")}\"") + buildConfigField("String", "SORAHE", "\"${properties.getProperty("SORAHE")}\"") + buildConfigField("String", "SORAXA", "\"${properties.getProperty("SORAXA")}\"") + buildConfigField("String", "SORATED", "\"${properties.getProperty("SORATED")}\"") } diff --git a/SoraStream/src/main/kotlin/com/hexated/Extractors.kt b/SoraStream/src/main/kotlin/com/hexated/Extractors.kt index 82a7e440..28036712 100644 --- a/SoraStream/src/main/kotlin/com/hexated/Extractors.kt +++ b/SoraStream/src/main/kotlin/com/hexated/Extractors.kt @@ -5,6 +5,7 @@ import com.lagradost.cloudstream3.* import com.lagradost.cloudstream3.extractors.Filesim import com.lagradost.cloudstream3.extractors.StreamSB import com.lagradost.cloudstream3.extractors.XStreamCdn +import com.lagradost.cloudstream3.extractors.helper.AsianEmbedHelper import com.lagradost.cloudstream3.utils.AppUtils import com.lagradost.cloudstream3.utils.ExtractorApi import com.lagradost.cloudstream3.utils.ExtractorLink @@ -15,9 +16,9 @@ import javax.crypto.spec.IvParameterSpec import javax.crypto.spec.PBEKeySpec import javax.crypto.spec.SecretKeySpec -class Sbasian : StreamSB() { - override var mainUrl = "https://sbasian.pro" - override var name = "Sbasian" +class StreamM4u : XStreamCdn() { + override val name: String = "StreamM4u" + override val mainUrl: String = "https://streamm4u.club" } class Fembed9hd : XStreamCdn() { @@ -25,9 +26,9 @@ class Fembed9hd : XStreamCdn() { override var name = "Fembed9hd" } -class Moviesm4u : Filesim() { - override val mainUrl = "https://moviesm4u.com" - override val name = "Moviesm4u" +class Sbasian : StreamSB() { + override var mainUrl = "https://sbasian.pro" + override var name = "Sbasian" } class Sbnet : StreamSB() { @@ -35,11 +36,6 @@ class Sbnet : StreamSB() { override var mainUrl = "https://sbnet.one" } -class StreamM4u : XStreamCdn() { - override val name: String = "StreamM4u" - override val mainUrl: String = "https://streamm4u.club" -} - class Sblongvu : StreamSB() { override var name = "Sblongvu" override var mainUrl = "https://sblongvu.com" @@ -50,6 +46,11 @@ class Keephealth : StreamSB() { override var mainUrl = "https://keephealth.info" } +class Moviesm4u : Filesim() { + override val mainUrl = "https://moviesm4u.com" + override val name = "Moviesm4u" +} + class FileMoonIn : Filesim() { override val mainUrl = "https://filemoon.in" override val name = "FileMoon" @@ -97,6 +98,7 @@ open class Chillx : ExtractorApi() { val source = Regex("""sources:\s*\[\{"file":"([^"]+)""").find(decrypt)?.groupValues?.get(1) val tracks = Regex("""tracks:\s*\[(.+)]""").find(decrypt)?.groupValues?.get(1) + // required val headers = mapOf( "Accept" to "*/*", "Connection" to "keep-alive", diff --git a/SoraStream/src/main/kotlin/com/hexated/SoraExtractor.kt b/SoraStream/src/main/kotlin/com/hexated/SoraExtractor.kt index a0d70626..64c76e99 100644 --- a/SoraStream/src/main/kotlin/com/hexated/SoraExtractor.kt +++ b/SoraStream/src/main/kotlin/com/hexated/SoraExtractor.kt @@ -649,24 +649,24 @@ object SoraExtractor : SoraStream() { ) } -// if(season == null) return -// json.definitionList?.map { video -> -// val media = app.get( -// "${BuildConfig.SORA_API}/movieDrama/getPlayInfo?category=${type}&contentId=${id}&episodeId=${json.id}&definition=${video.code}", -// headers = soraHeaders, -// ).parsedSafe()?.data -// -// callback.invoke( -// ExtractorLink( -// this.name, -// this.name, -// media?.mediaUrl ?: return@map null, -// base64DecodeAPI("Lw==b20=LmM=b2s=a2w=bG8=Ly8=czo=dHA=aHQ="), -// getSoraQuality(media.currentDefinition ?: ""), -// true, -// ) -// ) -// } + if(season == null) return + json.definitionList?.map { video -> + val media = app.get( + "${BuildConfig.SORA_API}/movieDrama/getPlayInfo?category=${type}&contentId=${id}&episodeId=${json.id}&definition=${video.code}", + headers = soraHeaders, + ).parsedSafe()?.data + + callback.invoke( + ExtractorLink( + this.name, + this.name, + if(media?.mediaUrl?.startsWith(BuildConfig.SORAXA) == true) upgradeSoraUrl(media.mediaUrl) else media?.mediaUrl ?: return@map null, + if(media.mediaUrl.startsWith(BuildConfig.SORAHE)) base64DecodeAPI("Lw==b20=LmM=b2s=a2w=bG8=Ly8=czo=dHA=aHQ=") else "", + getSoraQuality(media.currentDefinition ?: ""), + true, + ) + ) + } } suspend fun invokeXmovies( @@ -873,16 +873,9 @@ object SoraExtractor : SoraStream() { subtitleCallback: (SubtitleFile) -> Unit, callback: (ExtractorLink) -> Unit ) { - val malId = - if (season != null) app.get("$tmdb2mal/?id=$id&s=$season").text.trim() - else app.get("${jikanAPI}/anime?q=${title}&start_date=${year}&type=movie&limit=1") - .parsedSafe()?.data?.firstOrNull()?.mal_id - - val aniId = app.post( - "https://graphql.anilist.co/", data = mapOf( - "query" to "{Media(idMal:$malId,type:ANIME){id}}", - ) - ).parsedSafe()?.data?.media?.id + val (aniId, malId) = app.get( + if(season == null) "$tmdb2anilist/movie/?id=$id" else "$tmdb2anilist/tv/?id=$id&s=$season" + ).parsedSafe().let { it?.anilist_id to it?.mal_id } argamap( { @@ -2956,6 +2949,12 @@ data class BaymoviesConfig( val workers: List ) +data class Tmdb2Anilist( + @JsonProperty("tmdb_id") val tmdb_id: String? = null, + @JsonProperty("anilist_id") val anilist_id: String? = null, + @JsonProperty("mal_id") val mal_id: String? = null, +) + data class Movie123Media( @JsonProperty("url") val url: String? = null, ) @@ -3155,26 +3154,6 @@ data class FDAds( @JsonProperty("linkr") val linkr: String? = null, ) -data class DataMal( - @JsonProperty("mal_id") val mal_id: String? = null, -) - -data class JikanResponse( - @JsonProperty("data") val data: ArrayList? = arrayListOf(), -) - -data class IdAni( - @JsonProperty("id") val id: String? = null, -) - -data class MediaAni( - @JsonProperty("Media") val media: IdAni? = null, -) - -data class DataAni( - @JsonProperty("data") val data: MediaAni? = null, -) - data class Smashy1Tracks( @JsonProperty("file") val file: String? = null, @JsonProperty("label") val label: String? = null, diff --git a/SoraStream/src/main/kotlin/com/hexated/SoraStream.kt b/SoraStream/src/main/kotlin/com/hexated/SoraStream.kt index 92914817..2b9878fb 100644 --- a/SoraStream/src/main/kotlin/com/hexated/SoraStream.kt +++ b/SoraStream/src/main/kotlin/com/hexated/SoraStream.kt @@ -78,8 +78,7 @@ open class SoraStream : TmdbProvider() { companion object { /** TOOLS */ private const val tmdbAPI = "https://api.themoviedb.org/3" - const val tmdb2mal = "https://tmdb2mal.slidemovies.org" - const val jikanAPI = "https://api.jikan.moe/v4" + const val tmdb2anilist = "https://tmdb2anilist.slidemovies.org" const val gdbot = "https://gdbot.xyz" const val consumetAnilistAPI = "https://api.consumet.org/meta/anilist" diff --git a/SoraStream/src/main/kotlin/com/hexated/SoraUtils.kt b/SoraStream/src/main/kotlin/com/hexated/SoraUtils.kt index d1899cb9..f87e8663 100644 --- a/SoraStream/src/main/kotlin/com/hexated/SoraUtils.kt +++ b/SoraStream/src/main/kotlin/com/hexated/SoraUtils.kt @@ -27,6 +27,7 @@ import okhttp3.Headers import okhttp3.HttpUrl.Companion.toHttpUrl import okhttp3.MediaType.Companion.toMediaTypeOrNull import okhttp3.RequestBody.Companion.toRequestBody +import okio.ByteString.Companion.encode import org.jsoup.nodes.Document import java.net.URI import java.net.URL @@ -593,6 +594,12 @@ suspend fun fetchSoraEpisodes(id: String, type: String, episode: Int?): EpisodeV } } +fun upgradeSoraUrl(url: String) : String { + val expiry = System.currentTimeMillis() * 60 * 60 * 12 + val mac = "fuckfuck".encode().hmacSha256("$expiry".encode()).hex() + return "${url.replace(BuildConfig.SORAXA, BuildConfig.SORATED).substringBefore(".m3u8")}.m3u8?hdntl=exp=$expiry-acl=%2f*-data=hdntl-hmac=$mac" +} + suspend fun bypassOuo(url: String?): String? { var res = session.get(url ?: return null) run lit@{