mirror of
https://github.com/recloudstream/cloudstream-extensions-multilingual.git
synced 2024-08-15 03:15:14 +00:00
doodstream work for Wiflix
This commit is contained in:
parent
36bc455b71
commit
b61b1c1213
1 changed files with 41 additions and 37 deletions
|
@ -30,10 +30,10 @@ class WiflixProvider : MainAPI() {
|
||||||
override suspend fun search(query: String): List<SearchResponse> {
|
override suspend fun search(query: String): List<SearchResponse> {
|
||||||
val link =
|
val link =
|
||||||
"$mainUrl/index.php?do=search&subaction=search&story=$query&submit=Submit+Query" // search'
|
"$mainUrl/index.php?do=search&subaction=search&story=$query&submit=Submit+Query" // search'
|
||||||
|
|
||||||
val document =
|
val document =
|
||||||
app.post(link).document // app.get() permet de télécharger la page html avec une requete HTTP (get)
|
app.post(link).document // app.get() permet de télécharger la page html avec une requete HTTP (get)
|
||||||
val results = document.select("div#dle-content > div.clearfix")
|
val results = document.select("div#dle-content > div.clearfix")
|
||||||
|
|
||||||
val Allresultshome =
|
val Allresultshome =
|
||||||
results.apmap { article -> // avec mapnotnull si un élément est null, il sera automatiquement enlevé de la liste
|
results.apmap { article -> // avec mapnotnull si un élément est null, il sera automatiquement enlevé de la liste
|
||||||
|
@ -51,7 +51,7 @@ class WiflixProvider : MainAPI() {
|
||||||
@JsonProperty("episodeNumber") val episodeNumber: String,
|
@JsonProperty("episodeNumber") val episodeNumber: String,
|
||||||
)
|
)
|
||||||
|
|
||||||
private fun Elements.takeEpisode(url: String, DuborSub:String?): ArrayList<Episode> {
|
private fun Elements.takeEpisode(url: String, DuborSub: String?): ArrayList<Episode> {
|
||||||
|
|
||||||
val episodes = ArrayList<Episode>()
|
val episodes = ArrayList<Episode>()
|
||||||
this.select("ul.eplist > li").forEach {
|
this.select("ul.eplist > li").forEach {
|
||||||
|
@ -93,20 +93,21 @@ class WiflixProvider : MainAPI() {
|
||||||
val posterUrl =
|
val posterUrl =
|
||||||
document.select("img#posterimg").attr("src")
|
document.select("img#posterimg").attr("src")
|
||||||
val yearRegex = Regex("""ate de sortie\: (\d*)""")
|
val yearRegex = Regex("""ate de sortie\: (\d*)""")
|
||||||
val year =yearRegex.find(document.text())?.groupValues?.get(1)
|
val year = yearRegex.find(document.text())?.groupValues?.get(1)
|
||||||
val DuborSub:String?
|
val DuborSub: String?
|
||||||
|
|
||||||
|
|
||||||
val tags = document.select("[itemprop=genre] > a").apmap {it.text()} // séléctione tous les tags et les ajoutes à une liste
|
val tags = document.select("[itemprop=genre] > a")
|
||||||
|
.apmap { it.text() } // séléctione tous les tags et les ajoutes à une liste
|
||||||
|
|
||||||
if (episodeFrfound.text().contains("Episode")) {
|
if (episodeFrfound.text().contains("Episode")) {
|
||||||
mediaType = TvType.TvSeries
|
mediaType = TvType.TvSeries
|
||||||
DuborSub = "Episode en VF"
|
DuborSub = "Episode en VF"
|
||||||
episodes = episodeFrfound.takeEpisode(url,DuborSub)
|
episodes = episodeFrfound.takeEpisode(url, DuborSub)
|
||||||
} else if (episodeVostfrfound.text().contains("Episode")) {
|
} else if (episodeVostfrfound.text().contains("Episode")) {
|
||||||
mediaType = TvType.TvSeries
|
mediaType = TvType.TvSeries
|
||||||
DuborSub = "Episode sous-titré"
|
DuborSub = "Episode sous-titré"
|
||||||
episodes = episodeVostfrfound.takeEpisode(url,DuborSub)
|
episodes = episodeVostfrfound.takeEpisode(url, DuborSub)
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
mediaType = TvType.Movie
|
mediaType = TvType.Movie
|
||||||
|
@ -121,18 +122,18 @@ class WiflixProvider : MainAPI() {
|
||||||
val image = element.select("a >img")?.attr("src")
|
val image = element.select("a >img")?.attr("src")
|
||||||
val recUrl = element.select("a").attr("href")
|
val recUrl = element.select("a").attr("href")
|
||||||
type_rec = TvType.TvSeries
|
type_rec = TvType.TvSeries
|
||||||
if(recUrl.contains("film")) type_rec = TvType.Movie
|
if (recUrl.contains("film")) type_rec = TvType.Movie
|
||||||
|
|
||||||
if(type_rec == TvType.TvSeries){
|
if (type_rec == TvType.TvSeries) {
|
||||||
TvSeriesSearchResponse(
|
TvSeriesSearchResponse(
|
||||||
recTitle,
|
recTitle,
|
||||||
recUrl,
|
recUrl,
|
||||||
this.name,
|
this.name,
|
||||||
TvType.TvSeries,
|
TvType.TvSeries,
|
||||||
image?.let { fixUrl(it) },
|
image?.let { fixUrl(it) },
|
||||||
|
|
||||||
)
|
)
|
||||||
}else
|
} else
|
||||||
MovieSearchResponse(
|
MovieSearchResponse(
|
||||||
recTitle,
|
recTitle,
|
||||||
recUrl,
|
recUrl,
|
||||||
|
@ -140,7 +141,7 @@ class WiflixProvider : MainAPI() {
|
||||||
TvType.Movie,
|
TvType.Movie,
|
||||||
image?.let { fixUrl(it) },
|
image?.let { fixUrl(it) },
|
||||||
|
|
||||||
)
|
)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -161,7 +162,7 @@ class WiflixProvider : MainAPI() {
|
||||||
this.plot = description
|
this.plot = description
|
||||||
this.recommendations = recommendations
|
this.recommendations = recommendations
|
||||||
this.year = year?.toInt()
|
this.year = year?.toInt()
|
||||||
this.comingSoon =comingSoon
|
this.comingSoon = comingSoon
|
||||||
this.tags = tags
|
this.tags = tags
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -176,7 +177,7 @@ class WiflixProvider : MainAPI() {
|
||||||
this.plot = description
|
this.plot = description
|
||||||
this.recommendations = recommendations
|
this.recommendations = recommendations
|
||||||
this.year = year?.toInt()
|
this.year = year?.toInt()
|
||||||
this.comingSoon =comingSoon
|
this.comingSoon = comingSoon
|
||||||
this.tags = tags
|
this.tags = tags
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -224,24 +225,27 @@ class WiflixProvider : MainAPI() {
|
||||||
document.select("$cssCodeForPlayer").apmap { player -> // séléctione tous les players
|
document.select("$cssCodeForPlayer").apmap { player -> // séléctione tous les players
|
||||||
var playerUrl = "https" + player.attr("href").replace("(.*)https".toRegex(), "")
|
var playerUrl = "https" + player.attr("href").replace("(.*)https".toRegex(), "")
|
||||||
if (playerUrl != "" || playerUrl != null)
|
if (playerUrl != "" || playerUrl != null)
|
||||||
loadExtractor(
|
if (playerUrl.contains("dood")) {
|
||||||
httpsify(playerUrl),
|
playerUrl = playerUrl.replace("doodstream.com", "dood.wf")
|
||||||
playerUrl,
|
|
||||||
subtitleCallback
|
|
||||||
) { link ->
|
|
||||||
callback.invoke(
|
|
||||||
ExtractorLink( // ici je modifie le callback pour ajouter des informations, normalement ce n'est pas nécessaire
|
|
||||||
link.source,
|
|
||||||
link.name + "",
|
|
||||||
link.url,
|
|
||||||
link.referer,
|
|
||||||
getQualityFromName("HD"),
|
|
||||||
link.isM3u8,
|
|
||||||
link.headers,
|
|
||||||
link.extractorData
|
|
||||||
)
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
|
loadExtractor(
|
||||||
|
httpsify(playerUrl),
|
||||||
|
playerUrl,
|
||||||
|
subtitleCallback
|
||||||
|
) { link ->
|
||||||
|
callback.invoke(
|
||||||
|
ExtractorLink( // ici je modifie le callback pour ajouter des informations, normalement ce n'est pas nécessaire
|
||||||
|
link.source,
|
||||||
|
link.name + "",
|
||||||
|
link.url,
|
||||||
|
link.referer,
|
||||||
|
getQualityFromName("HD"),
|
||||||
|
link.isM3u8,
|
||||||
|
link.headers,
|
||||||
|
link.extractorData
|
||||||
|
)
|
||||||
|
)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue