From 78262afdf012cfc1ec1192640c87300eba25f856 Mon Sep 17 00:00:00 2001 From: antonydp <38143733+antonydp@users.noreply.github.com> Date: Thu, 2 Jun 2022 22:16:35 +0200 Subject: [PATCH] New guardare extractor (#1120) * Added 3 new extractors and a new italian provider * Added 3 new extractors and a new italian provider * Added 3 new extractors and a new italian provider * Added 4 new extractors and a new italian provider * Added another italian provider Altadefinizione, and a new extractor Supervideo * fix extractor Supervideo * fix extractor Supervideo * fix extractor Userload, fixed pr comments * final fix to the extractor Userload * fix to the Provider Cineblog, Added Extractor Guardare * fix to the Provider Cineblog, Added Extractor Guardare --- .../com/lagradost/cloudstream3/MainAPI.kt | 2 +- .../cloudstream3/extractors/GuardareStream.kt | 36 +++++++++++++++++++ .../{Cb01Provider.kt => CineblogProvider.kt} | 6 ++-- .../cloudstream3/utils/ExtractorApi.kt | 1 + 4 files changed, 41 insertions(+), 4 deletions(-) create mode 100644 app/src/main/java/com/lagradost/cloudstream3/extractors/GuardareStream.kt rename app/src/main/java/com/lagradost/cloudstream3/movieproviders/{Cb01Provider.kt => CineblogProvider.kt} (97%) diff --git a/app/src/main/java/com/lagradost/cloudstream3/MainAPI.kt b/app/src/main/java/com/lagradost/cloudstream3/MainAPI.kt index 58528038..760c3c0a 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/MainAPI.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/MainAPI.kt @@ -87,7 +87,7 @@ object APIHolder { TheFlixToProvider(), StreamingcommunityProvider(), TantifilmProvider(), - Cb01Provider(), + CineblogProvider(), AltadefinizioneProvider(), HDMovie5(), RebahinProvider(), diff --git a/app/src/main/java/com/lagradost/cloudstream3/extractors/GuardareStream.kt b/app/src/main/java/com/lagradost/cloudstream3/extractors/GuardareStream.kt new file mode 100644 index 00000000..57435161 --- /dev/null +++ b/app/src/main/java/com/lagradost/cloudstream3/extractors/GuardareStream.kt @@ -0,0 +1,36 @@ +package com.lagradost.cloudstream3.extractors +import com.fasterxml.jackson.annotation.JsonProperty +import com.lagradost.cloudstream3.utils.ExtractorLink +import com.lagradost.cloudstream3.app +import com.lagradost.cloudstream3.utils.* + +open class GuardareStream : ExtractorApi() { + override var name = "Guardare" + override var mainUrl = "https://guardare.stream" + override val requiresReferer = false + + data class GuardareJsonData ( + @JsonProperty("data") val data : List, + ) + + data class GuardareData ( + @JsonProperty("file") val file : String, + @JsonProperty("label") val label : String, + @JsonProperty("type") val type : String + ) + + override suspend fun getUrl(url: String, referer: String?): List? { + val response = app.post(url.replace("/v/","/api/source/"), data = mapOf("d" to mainUrl)).text + val jsonvideodata = AppUtils.parseJson(response) + return jsonvideodata.data.map { + ExtractorLink( + it.file+".${it.type}", + this.name, + it.file+".${it.type}", + mainUrl, + it.label.filter{ it.isDigit() }.toInt(), + false + ) + } + } +} \ No newline at end of file diff --git a/app/src/main/java/com/lagradost/cloudstream3/movieproviders/Cb01Provider.kt b/app/src/main/java/com/lagradost/cloudstream3/movieproviders/CineblogProvider.kt similarity index 97% rename from app/src/main/java/com/lagradost/cloudstream3/movieproviders/Cb01Provider.kt rename to app/src/main/java/com/lagradost/cloudstream3/movieproviders/CineblogProvider.kt index 90e25428..d3dc62e3 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/movieproviders/Cb01Provider.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/movieproviders/CineblogProvider.kt @@ -5,10 +5,10 @@ import com.lagradost.cloudstream3.mvvm.logError import com.lagradost.cloudstream3.app import com.lagradost.cloudstream3.utils.* -class Cb01Provider : MainAPI() { +class CineblogProvider : MainAPI() { override val lang = "it" override var mainUrl = "https://cb01.rip" - override var name = "Cineblog01" + override var name = "CineBlog01" override val hasMainPage = true override val hasChromecastSupport = true override val supportedTypes = setOf( @@ -127,7 +127,7 @@ class Cb01Provider : MainAPI() { val episodeList = ArrayList() document.select("#seasons > div").reversed().map { element -> val season = element.selectFirst("div.se-q > span.se-t")!!.text().toInt() - element.select("div.se-a > ul > li").map{ episode -> + element.select("div.se-a > ul > li").filter { it.text()!="There are still no episodes this season" }.map{ episode -> val href = episode.selectFirst("div.episodiotitle > a")!!.attr("href") val epNum =episode.selectFirst("div.numerando")!!.text().substringAfter("-").filter { it.isDigit() }.toIntOrNull() val epTitle = episode.selectFirst("div.episodiotitle > a")!!.text() 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 9fc6491d..65c3c2c7 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/utils/ExtractorApi.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/utils/ExtractorApi.kt @@ -186,6 +186,7 @@ val extractorApis: Array = arrayOf( Tantifilm(), Userload(), Supervideo(), + GuardareStream(), // StreamSB.kt works // SBPlay(),