diff --git a/EurostreamingProvider/.idea/.gitignore b/EurostreamingProvider/.idea/.gitignore
new file mode 100644
index 0000000..26d3352
--- /dev/null
+++ b/EurostreamingProvider/.idea/.gitignore
@@ -0,0 +1,3 @@
+# Default ignored files
+/shelf/
+/workspace.xml
diff --git a/EurostreamingProvider/.idea/gradle.xml b/EurostreamingProvider/.idea/gradle.xml
new file mode 100644
index 0000000..b898c0a
--- /dev/null
+++ b/EurostreamingProvider/.idea/gradle.xml
@@ -0,0 +1,12 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/EurostreamingProvider/.idea/misc.xml b/EurostreamingProvider/.idea/misc.xml
new file mode 100644
index 0000000..6ff4d26
--- /dev/null
+++ b/EurostreamingProvider/.idea/misc.xml
@@ -0,0 +1,10 @@
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/EurostreamingProvider/.idea/vcs.xml b/EurostreamingProvider/.idea/vcs.xml
new file mode 100644
index 0000000..6c0b863
--- /dev/null
+++ b/EurostreamingProvider/.idea/vcs.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/EurostreamingProvider/build.gradle.kts b/EurostreamingProvider/build.gradle.kts
index 62f8d76..46e2d8e 100644
--- a/EurostreamingProvider/build.gradle.kts
+++ b/EurostreamingProvider/build.gradle.kts
@@ -1,6 +1,5 @@
// use an integer for version numbers
-version = 1
-
+version = 2
cloudstream {
language = "it"
diff --git a/EurostreamingProvider/src/main/kotlin/com/lagradost/EurostreamingProvider.kt b/EurostreamingProvider/src/main/kotlin/com/lagradost/EurostreamingProvider.kt
index ec81f4e..5cff937 100644
--- a/EurostreamingProvider/src/main/kotlin/com/lagradost/EurostreamingProvider.kt
+++ b/EurostreamingProvider/src/main/kotlin/com/lagradost/EurostreamingProvider.kt
@@ -5,70 +5,69 @@ import com.lagradost.cloudstream3.utils.ExtractorLink
import com.lagradost.cloudstream3.utils.loadExtractor
import com.lagradost.cloudstream3.utils.AppUtils.parseJson
import com.lagradost.cloudstream3.utils.AppUtils.toJson
-
+import com.lagradost.cloudstream3.network.CloudflareKiller
+import okhttp3.FormBody
+import org.jsoup.nodes.Element
+import android.util.Log
class EurostreamingProvider : MainAPI() {
override var lang = "it"
- override var mainUrl = "https://eurostreaming.social"
+ override var mainUrl = "https://eurostreaming.taxi"
override var name = "Eurostreaming"
override val hasMainPage = true
override val hasChromecastSupport = true
+ private val interceptor = CloudflareKiller()
override val supportedTypes = setOf(
TvType.TvSeries
)
override val mainPage = mainPageOf(
- Pair("$mainUrl/serie-tv-archive/page/", "Ultime serie Tv"),
- Pair("$mainUrl/animazione/page/", "Ultime serie Animazione"),
-
+ "$mainUrl/serie-tv-archive/page/" to "Ultime serie Tv",
+ "$mainUrl/animazione/page/" to "Ultime serie Animazione",
)
override suspend fun getMainPage(page: Int, request: MainPageRequest): HomePageResponse {
val url = request.data + page
- val soup = app.get(url).document
+ val soup = app.get(url, interceptor = interceptor).document
val home = soup.select("div.post-thumb").map {
- val title = it.selectFirst("img")!!.attr("alt")
- val link = it.selectFirst("a")!!.attr("href")
- val image = fixUrl(it.selectFirst("img")!!.attr("src"))
-
- MovieSearchResponse(
- title,
- link,
- this.name,
- TvType.Movie,
- image
- )
+ it.toSearchResult()
+ }
+ return newHomePageResponse(arrayListOf(HomePageList(request.name, home)), hasNext = true)
+ }
+
+ private fun Element.toSearchResult(): SearchResponse {
+ val title = this.selectFirst("a")?.attr("title").toString()
+ val link = this.selectFirst("a")?.attr("href").toString()
+ val image = fixUrlNull(mainUrl + this.selectFirst("img")?.attr("src")?.trim())
+
+ return newTvSeriesSearchResponse(title, link, TvType.TvSeries){
+ this.posterUrl = image
+ this.posterHeaders = interceptor.getCookieHeaders(mainUrl).toMap()
}
- return newHomePageResponse(request.name, home)
}
override suspend fun search(query: String): List {
- val doc = app.post(
- "$mainUrl/index.php", data = mapOf(
- "do" to "search",
- "subaction" to "search",
- "story" to query,
- "sortby" to "news_read"
- )
- ).document
- return doc.select("div.post-thumb").map {
- val title = it.selectFirst("img")!!.attr("alt")
- val link = it.selectFirst("a")!!.attr("href")
- val image = mainUrl + it.selectFirst("img")!!.attr("src")
+ val body = FormBody.Builder()
+ .addEncoded("do", "search")
+ .addEncoded("subaction", "search")
+ .addEncoded("story", query)
+ .addEncoded("sortby", "news_read")
+ .build()
- MovieSearchResponse(
- title,
- link,
- this.name,
- TvType.Movie,
- image
- )
+ val doc = app.post(
+ "$mainUrl/index.php",
+ requestBody = body,
+ interceptor = interceptor
+ ).document
+
+ return doc.select("div.post-thumb").map {
+ it.toSearchResult()
}
}
override suspend fun load(url: String): LoadResponse {
- val page = app.get(url)
+ val page = app.get(url, interceptor = interceptor)
val document = page.document
val title = document.selectFirst("h2")!!.text().replace("^([1-9+]]$","")
val style = document.selectFirst("div.entry-cover")!!.attr("style")
@@ -93,7 +92,8 @@ class EurostreamingProvider : MainAPI() {
}
}
return newTvSeriesLoadResponse(title, url, TvType.TvSeries, episodeList) {
- posterUrl = poster
+ this.posterUrl = poster
+ this.posterHeaders = interceptor.getCookieHeaders(mainUrl).toMap()
}
}