diff --git a/.github/workflows/newrun.yml b/.github/workflows/newrun.yml index c3188b7c..32f6c103 100644 --- a/.github/workflows/newrun.yml +++ b/.github/workflows/newrun.yml @@ -76,6 +76,8 @@ jobs: FlixAPI: ${{ secrets.FlixAPI }} WhvxAPI: ${{ secrets.WhvxAPI }} WhvxT: ${{ secrets.WhvxT }} + SharmaflixApikey: ${{ secrets.SharmaflixApikey }} + SharmaflixApi: ${{ secrets.SharmaflixApi }} run: | cd $GITHUB_WORKSPACE/src echo TMDB_API=$TMDB_API >> local.properties @@ -111,6 +113,8 @@ jobs: echo FlixAPI=$FlixAPI >> local.properties echo WhvxAPI=$WhvxAPI >> local.properties echo WhvxT=$WhvxT >> local.properties + echo SharmaflixApi=SharmaflixApi >> local.properties + echo SharmaflixApikey=SharmaflixApikey >> local.properties - name: Build Plugins run: | cd $GITHUB_WORKSPACE/src diff --git a/StreamPlay/build.gradle.kts b/StreamPlay/build.gradle.kts index d85e1bd1..2693d5b6 100644 --- a/StreamPlay/build.gradle.kts +++ b/StreamPlay/build.gradle.kts @@ -3,7 +3,7 @@ import org.jetbrains.kotlin.konan.properties.Properties // use an integer for version numbers -version = 89 +version = 90 android { defaultConfig { val properties = Properties() @@ -28,6 +28,9 @@ android { buildConfigField("String", "FlixAPI", "\"${properties.getProperty("FlixAPI")}\"") buildConfigField("String", "WhvxAPI", "\"${properties.getProperty("WhvxAPI")}\"") buildConfigField("String", "WhvxT", "\"${properties.getProperty("WhvxT")}\"") + buildConfigField("String", "SharmaflixApikey", "\"${properties.getProperty("SharmaflixApikey")}\"") + buildConfigField("String", "SharmaflixApi", "\"${properties.getProperty("SharmaflixApi")}\"") + } } diff --git a/StreamPlay/src/main/kotlin/com/HindiProviders/StreamPlay.kt b/StreamPlay/src/main/kotlin/com/HindiProviders/StreamPlay.kt index 98fd5466..00430127 100644 --- a/StreamPlay/src/main/kotlin/com/HindiProviders/StreamPlay.kt +++ b/StreamPlay/src/main/kotlin/com/HindiProviders/StreamPlay.kt @@ -61,6 +61,7 @@ import com.Phisher98.StreamPlayExtractor.invokeFlixAPI import com.Phisher98.StreamPlayExtractor.invokeVidbinge import com.Phisher98.StreamPlayExtractor.invokemovies4u import com.Phisher98.StreamPlayExtractor.invokenyaa +import com.Phisher98.StreamPlayExtractor.invokeSharmaflix import com.fasterxml.jackson.annotation.JsonProperty import com.lagradost.cloudstream3.Actor import com.lagradost.cloudstream3.ActorData @@ -183,7 +184,7 @@ open class StreamPlay : TmdbProvider() { const val NyaaAPI="https://nyaa.land" const val Extramovies="https://extramovies.poker" const val WhvxAPI=BuildConfig.WhvxAPI - const val Vidbinge = "https://www.vidbinge.com" + const val Sharmaflix= BuildConfig.SharmaflixApi fun getType(t: String?): TvType { return when (t) { "movie" -> TvType.Movie @@ -818,6 +819,16 @@ open class StreamPlay : TmdbProvider() { callback ) }, + { + invokeSharmaflix( + res.title, + res.year, + res.season, + res.episode, + subtitleCallback, + callback + ) + }, { if (!res.isAnime) invokeDotmovies( res.imdbId, diff --git a/StreamPlay/src/main/kotlin/com/HindiProviders/StreamPlayExtractor.kt b/StreamPlay/src/main/kotlin/com/HindiProviders/StreamPlayExtractor.kt index 52ca842b..ff7c3968 100644 --- a/StreamPlay/src/main/kotlin/com/HindiProviders/StreamPlayExtractor.kt +++ b/StreamPlay/src/main/kotlin/com/HindiProviders/StreamPlayExtractor.kt @@ -2,6 +2,8 @@ package com.Phisher98 import android.annotation.SuppressLint import android.util.Log +import com.fasterxml.jackson.module.kotlin.jacksonObjectMapper +import com.fasterxml.jackson.module.kotlin.readValue import com.lagradost.cloudstream3.* import com.lagradost.cloudstream3.APIHolder.unixTimeMS import com.lagradost.cloudstream3.utils.* @@ -2047,6 +2049,36 @@ object StreamPlayExtractor : StreamPlay() { } } + suspend fun invokeSharmaflix( + title: String? = null, + year: Int? = null, + season: Int? = null, + episode: Int? = null, + subtitleCallback: (SubtitleFile) -> Unit, + callback: (ExtractorLink) -> Unit + ) { + val searchtitle=encodeQuery(title ?:"").replace("+", "%20") + val url="$Sharmaflix/searchContent/$searchtitle/0" + val headers= mapOf("x-api-key" to BuildConfig.SharmaflixApikey,"User-Agent" to "Dalvik/2.1.0 (Linux; U; Android 13; Subsystem for Android(TM) Build/TQ3A.230901.001)") + val json= app.get(url, headers = headers).toString().toJson() + val objectMapper = jacksonObjectMapper() + val parsedResponse: SharmaFlixRoot = objectMapper.readValue(json) + parsedResponse.forEach { root -> + val id=root.id + val movieurl="$Sharmaflix/getMoviePlayLinks/$id/0" + val hrefresponse= app.get(movieurl, headers = headers).toString().toJson() + val hrefparser: SharmaFlixLinks = objectMapper.readValue(hrefresponse) + hrefparser.forEach { + callback.invoke( + ExtractorLink( + "Sharmaflix", "Sharmaflix", it.url + ?: return, "", Qualities.P1080.value, INFER_TYPE + ) + ) + } + } + } + suspend fun invokeVidSrc( id: Int? = null, season: Int? = null, diff --git a/StreamPlay/src/main/kotlin/com/HindiProviders/StreamPlayParser.kt b/StreamPlay/src/main/kotlin/com/HindiProviders/StreamPlayParser.kt index b332cafe..8afc4684 100644 --- a/StreamPlay/src/main/kotlin/com/HindiProviders/StreamPlayParser.kt +++ b/StreamPlay/src/main/kotlin/com/HindiProviders/StreamPlayParser.kt @@ -777,6 +777,83 @@ data class Vidbingeplaylist( val stream: List, ) +//SharmaFlix + +// Top-level list alias +typealias SharmaFlixRoot = List + +// Root2 data class +data class SharmaFlixRoot2( + val id: String, + @JsonProperty("TMDB_ID") + val tmdbId: String, + val name: String, + val description: String, + val genres: String, + @JsonProperty("release_date") + val releaseDate: String, + val runtime: String, + val poster: String, + val banner: String, + @JsonProperty("youtube_trailer") + val youtubeTrailer: String, + val downloadable: String, + val type: String, + val status: String, + @JsonProperty("content_type") + val contentType: String, + @JsonProperty("custom_tag") + val customTag: CustomTag +) + +// CustomTag data class +data class CustomTag( + val id: String, + @JsonProperty("custom_tags_id") + val customTagsId: String, + @JsonProperty("content_id") + val contentId: String, + @JsonProperty("content_type") + val contentType: String, + @JsonProperty("custom_tags_name") + val customTagsName: String, + @JsonProperty("background_color") + val backgroundColor: String, + @JsonProperty("text_color") + val textColor: String +) + +typealias SharmaFlixLinks = List + +data class SharmaFlixLink( + val id: String, + val name: String, + val size: String, + val quality: String, + @JsonProperty("link_order") + val linkOrder: String, + @JsonProperty("movie_id") + val movieId: String, + val url: String, + val type: String, + val status: String, + @JsonProperty("skip_available") + val skipAvailable: String, + @JsonProperty("intro_start") + val introStart: String?, + @JsonProperty("intro_end") + val introEnd: String?, + @JsonProperty("end_credits_marker") + val endCreditsMarker: String, + @JsonProperty("link_type") + val linkType: String, + @JsonProperty("drm_uuid") + val drmUuid: String?, + @JsonProperty("drm_license_uri") + val drmLicenseUri: String? +) + + data class Streamplaylist( val id: String, val type: String, diff --git a/StreamPlay/src/main/kotlin/com/HindiProviders/StreamPlayTest.kt b/StreamPlay/src/main/kotlin/com/HindiProviders/StreamPlayTest.kt index 8dabb865..ce8c1060 100644 --- a/StreamPlay/src/main/kotlin/com/HindiProviders/StreamPlayTest.kt +++ b/StreamPlay/src/main/kotlin/com/HindiProviders/StreamPlayTest.kt @@ -4,6 +4,7 @@ import android.util.Log import com.Phisher98.StreamPlayExtractor.invokeAllMovieland import com.Phisher98.StreamPlayExtractor.invokeExtramovies import com.Phisher98.StreamPlayExtractor.invokeFlixAPI +import com.Phisher98.StreamPlayExtractor.invokeSharmaflix import com.Phisher98.StreamPlayExtractor.invokeVidbinge import com.Phisher98.StreamPlayExtractor.invokenyaa import com.lagradost.cloudstream3.SubtitleFile @@ -24,10 +25,12 @@ class StreamPlayTest : StreamPlay() { Log.d("Test1", "$res") argamap( { - if (!res.isAnime) invokeAllMovieland( - res.imdbId, + invokeSharmaflix( + res.title, + res.year, res.season, res.episode, + subtitleCallback, callback ) }