mirror of
https://github.com/recloudstream/cloudstream-extensions-multilingual.git
synced 2024-08-15 03:15:14 +00:00
Merge branch 'master' into master
This commit is contained in:
commit
c2cc4568d4
3 changed files with 45 additions and 47 deletions
|
@ -1,6 +1,5 @@
|
||||||
// use an integer for version numbers
|
// use an integer for version numbers
|
||||||
version = 1
|
version = 2
|
||||||
|
|
||||||
|
|
||||||
cloudstream {
|
cloudstream {
|
||||||
language = "it"
|
language = "it"
|
||||||
|
|
|
@ -5,70 +5,68 @@ import com.lagradost.cloudstream3.utils.ExtractorLink
|
||||||
import com.lagradost.cloudstream3.utils.loadExtractor
|
import com.lagradost.cloudstream3.utils.loadExtractor
|
||||||
import com.lagradost.cloudstream3.utils.AppUtils.parseJson
|
import com.lagradost.cloudstream3.utils.AppUtils.parseJson
|
||||||
import com.lagradost.cloudstream3.utils.AppUtils.toJson
|
import com.lagradost.cloudstream3.utils.AppUtils.toJson
|
||||||
|
import com.lagradost.cloudstream3.network.CloudflareKiller
|
||||||
|
import okhttp3.FormBody
|
||||||
|
import org.jsoup.nodes.Element
|
||||||
|
|
||||||
class EurostreamingProvider : MainAPI() {
|
class EurostreamingProvider : MainAPI() {
|
||||||
override var lang = "it"
|
override var lang = "it"
|
||||||
override var mainUrl = "https://eurostreaming.social"
|
override var mainUrl = "https://eurostreaming.taxi"
|
||||||
override var name = "Eurostreaming"
|
override var name = "Eurostreaming"
|
||||||
override val hasMainPage = true
|
override val hasMainPage = true
|
||||||
override val hasChromecastSupport = true
|
override val hasChromecastSupport = true
|
||||||
|
private val interceptor = CloudflareKiller()
|
||||||
override val supportedTypes = setOf(
|
override val supportedTypes = setOf(
|
||||||
TvType.TvSeries
|
TvType.TvSeries
|
||||||
)
|
)
|
||||||
|
|
||||||
override val mainPage = mainPageOf(
|
override val mainPage = mainPageOf(
|
||||||
Pair("$mainUrl/serie-tv-archive/page/", "Ultime serie Tv"),
|
"$mainUrl/serie-tv-archive/page/" to "Ultime serie Tv",
|
||||||
Pair("$mainUrl/animazione/page/", "Ultime serie Animazione"),
|
"$mainUrl/animazione/page/" to "Ultime serie Animazione",
|
||||||
|
|
||||||
)
|
)
|
||||||
|
|
||||||
override suspend fun getMainPage(page: Int, request: MainPageRequest): HomePageResponse {
|
override suspend fun getMainPage(page: Int, request: MainPageRequest): HomePageResponse {
|
||||||
val url = request.data + page
|
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 home = soup.select("div.post-thumb").mapNotNull {
|
||||||
val title = it.selectFirst("img")!!.attr("alt")
|
it.toSearchResult()
|
||||||
val link = it.selectFirst("a")!!.attr("href")
|
}
|
||||||
val image = fixUrl(it.selectFirst("img")!!.attr("src"))
|
return newHomePageResponse(arrayListOf(HomePageList(request.name, home)), hasNext = true)
|
||||||
|
}
|
||||||
MovieSearchResponse(
|
|
||||||
title,
|
private fun Element.toSearchResult(): SearchResponse? {
|
||||||
link,
|
val title = this.selectFirst("a")?.attr("title") ?: return null
|
||||||
this.name,
|
val link = this.selectFirst("a")?.attr("href") ?: return null
|
||||||
TvType.Movie,
|
val image = fixUrlNull(mainUrl + this.selectFirst("img")?.attr("src")?.trim())
|
||||||
image
|
|
||||||
)
|
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<SearchResponse> {
|
override suspend fun search(query: String): List<SearchResponse> {
|
||||||
val doc = app.post(
|
val body = FormBody.Builder()
|
||||||
"$mainUrl/index.php", data = mapOf(
|
.addEncoded("do", "search")
|
||||||
"do" to "search",
|
.addEncoded("subaction", "search")
|
||||||
"subaction" to "search",
|
.addEncoded("story", query)
|
||||||
"story" to query,
|
.addEncoded("sortby", "news_read")
|
||||||
"sortby" to "news_read"
|
.build()
|
||||||
)
|
|
||||||
).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(
|
val doc = app.post(
|
||||||
title,
|
"$mainUrl/index.php",
|
||||||
link,
|
requestBody = body,
|
||||||
this.name,
|
interceptor = interceptor
|
||||||
TvType.Movie,
|
).document
|
||||||
image
|
|
||||||
)
|
return doc.select("div.post-thumb").mapNotNull {
|
||||||
|
it?.toSearchResult()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override suspend fun load(url: String): LoadResponse {
|
override suspend fun load(url: String): LoadResponse {
|
||||||
val page = app.get(url)
|
val page = app.get(url, interceptor = interceptor)
|
||||||
val document = page.document
|
val document = page.document
|
||||||
val title = document.selectFirst("h2")!!.text().replace("^([1-9+]]$","")
|
val title = document.selectFirst("h2")!!.text().replace("^([1-9+]]$","")
|
||||||
val style = document.selectFirst("div.entry-cover")!!.attr("style")
|
val style = document.selectFirst("div.entry-cover")!!.attr("style")
|
||||||
|
@ -93,7 +91,8 @@ class EurostreamingProvider : MainAPI() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return newTvSeriesLoadResponse(title, url, TvType.TvSeries, episodeList) {
|
return newTvSeriesLoadResponse(title, url, TvType.TvSeries, episodeList) {
|
||||||
posterUrl = poster
|
this.posterUrl = poster
|
||||||
|
this.posterHeaders = interceptor.getCookieHeaders(mainUrl).toMap()
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -144,11 +144,11 @@ class NineGoal : MainAPI() {
|
||||||
}
|
}
|
||||||
if (!requestStatus) {
|
if (!requestStatus) {
|
||||||
mapOf(
|
mapOf(
|
||||||
"(1)" to "playing.smoothlikebutterstream.com",
|
"(1)" to "https://playing.smoothlikebutterstream.com",
|
||||||
"(2)" to "playing.tunnelcdnsw.net",
|
"(2)" to "https://playing.tunnelcdnsw.net",
|
||||||
"(3)" to "playing.goforfreedomwme.net",
|
"(3)" to "https://playing.goforfreedomwme.net",
|
||||||
"(4)" to "turnthe.gameon.tel",
|
"(4)" to "https://turnthe.gameon.tel",
|
||||||
"(5)" to "playing.whydontyoustreamwme.com"
|
"(5)" to "https://playing.whydontyoustreamwme.com"
|
||||||
).apmap { (name, value) ->
|
).apmap { (name, value) ->
|
||||||
callback.invoke(
|
callback.invoke(
|
||||||
ExtractorLink(
|
ExtractorLink(
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue