Add trailer to 3 italian providers (#1180)

* bug fixes and add cast

* fixed Altadefinizione search

* fixed Altadefinizione search

* Add trailer to italians providers

Co-authored-by: Osten <11805592+LagradOst@users.noreply.github.com>
This commit is contained in:
antonydp 2022-06-17 02:34:56 +02:00 committed by GitHub
parent f64b2f7f1b
commit 5efb07ea63
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 21 additions and 17 deletions

View file

@ -5,6 +5,8 @@ import com.lagradost.cloudstream3.*
import com.lagradost.cloudstream3.mvvm.logError
import com.lagradost.cloudstream3.app
import com.lagradost.cloudstream3.utils.*
import com.lagradost.cloudstream3.LoadResponse.Companion.addTrailer
class AltadefinizioneProvider : MainAPI() {
override var lang = "it"
@ -111,6 +113,9 @@ class AltadefinizioneProvider : MainAPI() {
}
val tags: List<String> = document.select("#details > li:nth-child(1) > a").map { it.text() }
val trailerurl = document.selectFirst("#showtrailer > div > div > iframe")!!.attr("src")
return newMovieLoadResponse(
title,
url,
@ -125,6 +130,7 @@ class AltadefinizioneProvider : MainAPI() {
this.duration = null
this.actors = actors
this.tags = tags
addTrailer(trailerurl)
}
}

View file

@ -284,7 +284,7 @@ class StreamingcommunityProvider : MainAPI() {
val trailerinfojs = document.select("slider-trailer").attr("videos")
val trailerinfo = parseJson<List<TrailerElement>>(trailerinfojs)
val trailerurl: String? = if (trailerinfo.isNotEmpty()) {
"https://www.youtube.com/watch?v=${trailerinfo[0].id}"
"https://www.youtube.com/watch?v=${trailerinfo[0].url}"
} else {
null
}

View file

@ -4,6 +4,8 @@ import com.lagradost.cloudstream3.*
import com.lagradost.cloudstream3.mvvm.logError
import com.lagradost.cloudstream3.app
import com.lagradost.cloudstream3.utils.*
import com.lagradost.cloudstream3.LoadResponse.Companion.addTrailer
class TantifilmProvider : MainAPI() {
override var lang = "it"
@ -69,7 +71,6 @@ class TantifilmProvider : MainAPI() {
}
}
override suspend fun load(url: String): LoadResponse {
val document = app.get(url).document
val type = if (document.selectFirst("div.category-film")!!.text().contains("Serie")
@ -107,7 +108,7 @@ class TantifilmProvider : MainAPI() {
}
val trailerurl = document.selectFirst("#trailer_mob > iframe")!!.attr("src")
if (type == TvType.TvSeries) {
val list = ArrayList<Pair<Int, String>>()
@ -142,22 +143,18 @@ class TantifilmProvider : MainAPI() {
}
}
}
return TvSeriesLoadResponse(
return newTvSeriesLoadResponse(
title,
url,
this.name,
type,
episodeList,
fixUrlNull(poster),
year.toIntOrNull(),
descipt[0],
null,
rating,
null,
null,
null,
recomm
)
episodeList) {
this.posterUrl= fixUrlNull(poster)
this.year = year.toIntOrNull()
this.plot= descipt[0]
this.rating= rating
this.recommendations = recomm
addTrailer(trailerurl)
}
} else {
val url2 = document.selectFirst("iframe")!!.attr("src")
val actorpagelink =
@ -217,6 +214,7 @@ class TantifilmProvider : MainAPI() {
this.tags = tags
this.duration = duratio
this.actors = actors
addTrailer(trailerurl)
}
}