diff --git a/app/src/main/java/com/tanasi/streamflix/extractors/ChillxExtractor.kt b/app/src/main/java/com/tanasi/streamflix/extractors/ChillxExtractor.kt index e42e682c..9cb83514 100644 --- a/app/src/main/java/com/tanasi/streamflix/extractors/ChillxExtractor.kt +++ b/app/src/main/java/com/tanasi/streamflix/extractors/ChillxExtractor.kt @@ -62,6 +62,11 @@ open class ChillxExtractor : Extractor() { override val mainUrl = "https://player.jeansaispasplus.homes/" } + class MoviesapiExtractor : ChillxExtractor() { + override val name = "Moviesapi" + override val mainUrl = "https://moviesapi.club/" + } + private interface Service { diff --git a/app/src/main/java/com/tanasi/streamflix/extractors/Extractor.kt b/app/src/main/java/com/tanasi/streamflix/extractors/Extractor.kt index 448b316f..2b2f3972 100644 --- a/app/src/main/java/com/tanasi/streamflix/extractors/Extractor.kt +++ b/app/src/main/java/com/tanasi/streamflix/extractors/Extractor.kt @@ -33,6 +33,7 @@ abstract class Extractor { TwoEmbedExtractor(), ChillxExtractor(), ChillxExtractor.JeanExtractor(), + MoviesapiExtractor(), ) suspend fun extract(link: String): Video { diff --git a/app/src/main/java/com/tanasi/streamflix/extractors/MoviesapiExtractor.kt b/app/src/main/java/com/tanasi/streamflix/extractors/MoviesapiExtractor.kt new file mode 100644 index 00000000..2f83ed8a --- /dev/null +++ b/app/src/main/java/com/tanasi/streamflix/extractors/MoviesapiExtractor.kt @@ -0,0 +1,57 @@ +package com.tanasi.streamflix.extractors + +import com.tanasi.retrofit_jsoup.converter.JsoupConverterFactory +import com.tanasi.streamflix.models.Video +import org.jsoup.nodes.Document +import retrofit2.Retrofit +import retrofit2.http.GET +import retrofit2.http.Header +import retrofit2.http.Url + +class MoviesapiExtractor : Extractor() { + + override val name = "Moviesapi" + override val mainUrl = "https://moviesapi.club/" + + fun server(videoType: Video.Type): Video.Server { + return Video.Server( + id = name, + name = name, + src = when (videoType) { + is Video.Type.Episode -> "$mainUrl/tv/${videoType.tvShow.id}-${videoType.season.number}-${videoType.number}" + is Video.Type.Movie -> "$mainUrl/movie/${videoType.id}" + }, + ) + } + + override suspend fun extract(link: String): Video { + val service = Service.build(mainUrl) + + val iframe = service.get(link, referer = "https://pressplay.top/") + .selectFirst("iframe") + ?.attr("src") + ?: throw Exception("Can't retrieve iframe") + + return ChillxExtractor.MoviesapiExtractor().extract(iframe) + } + + private interface Service { + + companion object { + fun build(baseUrl: String): Service { + val retrofit = Retrofit.Builder() + .baseUrl(baseUrl) + .addConverterFactory(JsoupConverterFactory.create()) + .build() + + return retrofit.create(Service::class.java) + } + } + + @GET + suspend fun get( + @Url url: String, + @Header("referer") referer: String = "", + ): Document + } +} \ No newline at end of file diff --git a/app/src/main/java/com/tanasi/streamflix/providers/TmdbProvider.kt b/app/src/main/java/com/tanasi/streamflix/providers/TmdbProvider.kt index 15d91975..f957b3fb 100644 --- a/app/src/main/java/com/tanasi/streamflix/providers/TmdbProvider.kt +++ b/app/src/main/java/com/tanasi/streamflix/providers/TmdbProvider.kt @@ -3,6 +3,7 @@ package com.tanasi.streamflix.providers import com.tanasi.streamflix.adapters.AppAdapter import com.tanasi.streamflix.extractors.Extractor import com.tanasi.streamflix.extractors.MoflixExtractor +import com.tanasi.streamflix.extractors.MoviesapiExtractor import com.tanasi.streamflix.extractors.MyFileStorageExtractor import com.tanasi.streamflix.extractors.TwoEmbedExtractor import com.tanasi.streamflix.extractors.VidsrcNetExtractor @@ -803,6 +804,7 @@ object TmdbProvider : Provider { override suspend fun getServers(id: String, videoType: Video.Type): List { val servers = listOf( + MoviesapiExtractor().server(videoType), VidsrcNetExtractor().server(videoType), MyFileStorageExtractor().nowTvServer(videoType), MoflixExtractor().server(videoType),