Tantifilm (cloudflare) and IlGenioDelloStreamingProvider fixes (#4)

This commit is contained in:
antonydp 2022-08-27 16:27:45 +02:00 committed by GitHub
parent dd31f0eead
commit 7dbb146399
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 208 additions and 28 deletions

View file

@ -0,0 +1,26 @@
// use an integer for version numbers
version = 1
cloudstream {
language = "it"
// All of these properties are optional, you can safely remove them
// description = "Lorem Ipsum"
// authors = listOf("Cloudburst")
/**
* Status int as the following:
* 0: Down
* 1: Ok
* 2: Slow
* 3: Beta only
* */
status = 1 // will be 3 if unspecified
tvTypes = listOf(
"TvSeries"
)
iconUrl = "https://www.google.com/s2/favicons?domain=eurostreaming.social&sz=%size%"
}

View file

@ -0,0 +1,2 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest package="com.lagradost"/>

View file

@ -0,0 +1,113 @@
package com.lagradost
import com.lagradost.cloudstream3.*
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
class EurostreamingProvider : MainAPI() {
override var lang = "it"
override var mainUrl = "https://eurostreaming.social"
override var name = "Eurostreaming"
override val hasMainPage = true
override val hasChromecastSupport = true
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"),
)
override suspend fun getMainPage(page: Int, request: MainPageRequest): HomePageResponse {
val url = request.data + page
val soup = app.get(url).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
)
}
return newHomePageResponse(request.name, home)
}
override suspend fun search(query: String): List<SearchResponse> {
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")
MovieSearchResponse(
title,
link,
this.name,
TvType.Movie,
image
)
}
}
override suspend fun load(url: String): LoadResponse {
val page = app.get(url)
val document = page.document
val title = document.selectFirst("h2")!!.text().replace("^([1-9+]]$","")
val style = document.selectFirst("div.entry-cover")!!.attr("style")
val poster = fixUrl(Regex("(/upload.+\\))").find(style)!!.value.dropLast(1))
val episodeList = ArrayList<Episode>()
document.select("div.tab-pane.fade").map { element ->
val season = element.attr("id").filter { it.isDigit() }.toInt()
element.select("li").filter { it-> it.selectFirst("a")?.hasAttr("data-title")?:false }.map{episode ->
val data = episode.select("div.mirrors > a").map { it.attr("data-link") }.toJson()
val epnameData = episode.selectFirst("a")
val epTitle = epnameData!!.attr("data-title")
val epNum = epnameData.text().toInt()
episodeList.add(
Episode(
data,
epTitle,
season,
epNum
)
)
}
}
return newTvSeriesLoadResponse(title, url, TvType.TvSeries, episodeList) {
posterUrl = poster
}
}
override suspend fun loadLinks(
data: String,
isCasting: Boolean,
subtitleCallback: (SubtitleFile) -> Unit,
callback: (ExtractorLink) -> Unit
): Boolean {
parseJson<List<String>>(data).map { videoUrl ->
loadExtractor(videoUrl, data, subtitleCallback, callback)
}
return true
}
}

View file

@ -0,0 +1,14 @@
package com.lagradost
import com.lagradost.cloudstream3.plugins.CloudstreamPlugin
import com.lagradost.cloudstream3.plugins.Plugin
import android.content.Context
@CloudstreamPlugin
class EurostreamingProviderPlugin: Plugin() {
override fun load(context: Context) {
// All providers should be added in this manner. Please don't edit the providers list directly.
registerMainAPI(EurostreamingProvider())
}
}