From 7ca56b74505d1914081b8c1a470e9028f37b6724 Mon Sep 17 00:00:00 2001 From: Stormunblessed <86633626+Stormunblessed@users.noreply.github.com> Date: Wed, 2 Feb 2022 05:45:11 -0600 Subject: [PATCH] Small fixes, and unified Tomatomatela --- .../cloudstream3/extractors/Cinestart.kt | 34 ------------ .../cloudstream3/extractors/Tomatomatela.kt | 9 ++- .../movieproviders/CinecalidadProvider.kt | 14 ----- .../EntrepeliculasyseriesProvider.kt | 55 +++++++++---------- .../movieproviders/PelisflixProvider.kt | 2 - .../movieproviders/SeriesflixProvider.kt | 9 +-- .../cloudstream3/utils/ExtractorApi.kt | 2 +- 7 files changed, 38 insertions(+), 87 deletions(-) delete mode 100644 app/src/main/java/com/lagradost/cloudstream3/extractors/Cinestart.kt diff --git a/app/src/main/java/com/lagradost/cloudstream3/extractors/Cinestart.kt b/app/src/main/java/com/lagradost/cloudstream3/extractors/Cinestart.kt deleted file mode 100644 index 0ff422ed7..000000000 --- a/app/src/main/java/com/lagradost/cloudstream3/extractors/Cinestart.kt +++ /dev/null @@ -1,34 +0,0 @@ -package com.lagradost.cloudstream3.extractors - -import com.lagradost.cloudstream3.utils.* -import com.lagradost.cloudstream3.app -import com.fasterxml.jackson.annotation.JsonProperty -import com.fasterxml.jackson.module.kotlin.readValue -import com.lagradost.cloudstream3.mapper - - -open class Cinestart : ExtractorApi() { - override val name = "Cinestart" - override val mainUrl = "https://cinestart.net" - override val requiresReferer = false - private data class cinestart ( - @JsonProperty("status") val status: Int, - @JsonProperty("file") val file: String - ) - override suspend fun getUrl(url: String, referer: String?): List? { - val link = url.replace("https://cinestart.net/embed.html#","https://cinestart.net/vr.php?v=") - val server = app.get(link, allowRedirects = false).text - val json = mapper.readValue(server) - if (json.status == 200) return listOf( - ExtractorLink( - name, - name, - json.file, - "", - Qualities.Unknown.value, - isM3u8 = false - ) - ) - return null - } -} \ No newline at end of file diff --git a/app/src/main/java/com/lagradost/cloudstream3/extractors/Tomatomatela.kt b/app/src/main/java/com/lagradost/cloudstream3/extractors/Tomatomatela.kt index 01c995471..171b481cd 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/extractors/Tomatomatela.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/extractors/Tomatomatela.kt @@ -7,6 +7,12 @@ import com.fasterxml.jackson.module.kotlin.readValue import com.lagradost.cloudstream3.mapper +class Cinestart: Tomatomatela() { + override val name: String = "Cinestart" + override val mainUrl: String = "https://cinestart.net" + override val details = "vr.php?v=" +} + open class Tomatomatela : ExtractorApi() { override val name = "Tomatomatela" override val mainUrl = "https://tomatomatela.com" @@ -15,8 +21,9 @@ open class Tomatomatela : ExtractorApi() { @JsonProperty("status") val status: Int, @JsonProperty("file") val file: String ) + open val details = "details.php?v=" override suspend fun getUrl(url: String, referer: String?): List? { - val link = url.replace("https://tomatomatela.com/embed.html#","https://tomatomatela.com/details.php?v=") + val link = url.replace("$mainUrl/embed.html#","$mainUrl/$details") val server = app.get(link, allowRedirects = false).text val json = mapper.readValue(server) if (json.status == 200) return listOf( diff --git a/app/src/main/java/com/lagradost/cloudstream3/movieproviders/CinecalidadProvider.kt b/app/src/main/java/com/lagradost/cloudstream3/movieproviders/CinecalidadProvider.kt index 581959fc7..81180514c 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/movieproviders/CinecalidadProvider.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/movieproviders/CinecalidadProvider.kt @@ -1,15 +1,9 @@ package com.lagradost.cloudstream3.movieproviders import com.fasterxml.jackson.annotation.JsonProperty -import com.fasterxml.jackson.module.kotlin.readValue import com.lagradost.cloudstream3.* -import com.lagradost.cloudstream3.animeproviders.AllAnimeProvider import com.lagradost.cloudstream3.extractors.Cinestart -import com.lagradost.cloudstream3.extractors.Evoload -import com.lagradost.cloudstream3.extractors.FEmbed -import com.lagradost.cloudstream3.extractors.StreamTape import com.lagradost.cloudstream3.utils.* -import java.net.URLDecoder import java.util.* class CinecalidadProvider:MainAPI() { @@ -143,14 +137,6 @@ class CinecalidadProvider:MainAPI() { } } - - data class cinestart ( - @JsonProperty("status") val status: Int, - @JsonProperty("file") val file: String - ) - - - override suspend fun loadLinks( data: String, isCasting: Boolean, diff --git a/app/src/main/java/com/lagradost/cloudstream3/movieproviders/EntrepeliculasyseriesProvider.kt b/app/src/main/java/com/lagradost/cloudstream3/movieproviders/EntrepeliculasyseriesProvider.kt index 0707eadc7..2a533039c 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/movieproviders/EntrepeliculasyseriesProvider.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/movieproviders/EntrepeliculasyseriesProvider.kt @@ -1,9 +1,6 @@ package com.lagradost.cloudstream3.movieproviders import com.lagradost.cloudstream3.* -import com.lagradost.cloudstream3.extractors.Evoload -import com.lagradost.cloudstream3.extractors.FEmbed -import com.lagradost.cloudstream3.extractors.StreamTape import com.lagradost.cloudstream3.utils.* import java.util.* @@ -155,31 +152,33 @@ class EntrepeliculasyseriesProvider:MainAPI() { app.get(data).document.select(".video ul.dropdown-menu li").apmap { val servers = it.attr("data-link") val doc = app.get(servers).document - val postkey = doc.selectFirst("input").attr("value") - val server = app.post("https://entrepeliculasyseries.nu/r.php", - headers = mapOf("Host" to "entrepeliculasyseries.nu", - "User-Agent" to USER_AGENT, - "Accept" to "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8", - "Accept-Language" to "en-US,en;q=0.5", - "Content-Type" to "application/x-www-form-urlencoded", - "Content-Length" to "90", - "Origin" to "https://entrepeliculasyseries.nu", - "DNT" to "1", - "Connection" to "keep-alive", - "Referer" to servers, - "Upgrade-Insecure-Requests" to "1", - "Sec-Fetch-Dest" to "document", - "Sec-Fetch-Mode" to "navigate", - "Sec-Fetch-Site" to "same-origin", - "Sec-Fetch-User" to "?1",), - //params = mapOf(Pair("h", postkey)), - data = mapOf(Pair("h", postkey)), - allowRedirects = false - ).response.headers.values("location").apmap { - for (extractor in extractorApis) { - if (it.startsWith(extractor.mainUrl)) { - extractor.getSafeUrl(it, data)?.apmap { - callback(it) + doc.select("input").apmap { + val postkey = it.attr("value") + app.post("https://entrepeliculasyseries.nu/r.php", + headers = mapOf("Host" to "entrepeliculasyseries.nu", + "User-Agent" to USER_AGENT, + "Accept" to "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8", + "Accept-Language" to "en-US,en;q=0.5", + "Content-Type" to "application/x-www-form-urlencoded", + "Content-Length" to "90", + "Origin" to "https://entrepeliculasyseries.nu", + "DNT" to "1", + "Connection" to "keep-alive", + "Referer" to servers, + "Upgrade-Insecure-Requests" to "1", + "Sec-Fetch-Dest" to "document", + "Sec-Fetch-Mode" to "navigate", + "Sec-Fetch-Site" to "same-origin", + "Sec-Fetch-User" to "?1",), + //params = mapOf(Pair("h", postkey)), + data = mapOf(Pair("h", postkey)), + allowRedirects = false + ).response.headers.values("location").apmap { + for (extractor in extractorApis) { + if (it.startsWith(extractor.mainUrl)) { + extractor.getSafeUrl(it, data)?.apmap { + callback(it) + } } } } diff --git a/app/src/main/java/com/lagradost/cloudstream3/movieproviders/PelisflixProvider.kt b/app/src/main/java/com/lagradost/cloudstream3/movieproviders/PelisflixProvider.kt index c030155fc..d67ca9c89 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/movieproviders/PelisflixProvider.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/movieproviders/PelisflixProvider.kt @@ -2,8 +2,6 @@ package com.lagradost.cloudstream3.movieproviders import com.lagradost.cloudstream3.* import com.lagradost.cloudstream3.utils.* -import com.lagradost.cloudstream3.utils.AppUtils.toJson -import org.jsoup.nodes.Document import kotlin.collections.ArrayList class PelisflixProvider:MainAPI() { diff --git a/app/src/main/java/com/lagradost/cloudstream3/movieproviders/SeriesflixProvider.kt b/app/src/main/java/com/lagradost/cloudstream3/movieproviders/SeriesflixProvider.kt index af6a26988..2c7981f85 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/movieproviders/SeriesflixProvider.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/movieproviders/SeriesflixProvider.kt @@ -2,16 +2,11 @@ package com.lagradost.cloudstream3.movieproviders import com.lagradost.cloudstream3.* import com.lagradost.cloudstream3.utils.* -import com.lagradost.cloudstream3.utils.AppUtils.toJson -import org.jsoup.Jsoup -import org.jsoup.nodes.Document import kotlin.collections.ArrayList class SeriesflixProvider:MainAPI() { - override val mainUrl: String - get() = "https://seriesflix.video" - override val name: String - get() = "Seriesflix" + override val mainUrl = "https://seriesflix.video" + override val name = "Seriesflix" override val lang = "es" override val hasMainPage = true override val hasChromecastSupport = true diff --git a/app/src/main/java/com/lagradost/cloudstream3/utils/ExtractorApi.kt b/app/src/main/java/com/lagradost/cloudstream3/utils/ExtractorApi.kt index 84deae198..0a13099ca 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/utils/ExtractorApi.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/utils/ExtractorApi.kt @@ -100,8 +100,8 @@ val extractorApis: Array = arrayOf( StreamSB(), Streamhub(), - Cinestart(), Tomatomatela(), + Cinestart(), Solidfiles(), Solidfiles1(),