mirror of
https://github.com/recloudstream/cloudstream-extensions-multilingual.git
synced 2024-08-15 03:15:14 +00:00
autoformat the code and add the changes requested
This commit is contained in:
parent
313017749c
commit
640cc4c575
4 changed files with 268 additions and 226 deletions
|
@ -7,7 +7,8 @@ import org.jsoup.Jsoup
|
||||||
open class MytvExtractor : ExtractorApi() {
|
open class MytvExtractor : ExtractorApi() {
|
||||||
override val name: String = "Mytv"
|
override val name: String = "Mytv"
|
||||||
override val mainUrl: String = "https://www.myvi.tv/"
|
override val mainUrl: String = "https://www.myvi.tv/"
|
||||||
private val srcRegex = Regex("""PlayerLoader\.CreatePlayer\(\"v\=(.*)\\u0026tp""") // would be possible to use the parse and find src attribute
|
private val srcRegex =
|
||||||
|
Regex("""PlayerLoader\.CreatePlayer\(\"v\=(.*)\\u0026tp""") // would be possible to use the parse and find src attribute
|
||||||
override val requiresReferer = false
|
override val requiresReferer = false
|
||||||
|
|
||||||
|
|
||||||
|
@ -17,7 +18,8 @@ open class MytvExtractor : ExtractorApi() {
|
||||||
with(html) { // raised error ERROR_CODE_PARSING_CONTAINER_UNSUPPORTED (3003) is due to the response: "error_nofile"
|
with(html) { // raised error ERROR_CODE_PARSING_CONTAINER_UNSUPPORTED (3003) is due to the response: "error_nofile"
|
||||||
srcRegex.find(this.text)?.groupValues?.get(1)?.let { link ->
|
srcRegex.find(this.text)?.groupValues?.get(1)?.let { link ->
|
||||||
var lien = link
|
var lien = link
|
||||||
lien= lien.replace("%2f","/").replace("%3a",":").replace("%3f","?").replace("%3d","=").replace("%26","&")
|
lien = lien.replace("%2f", "/").replace("%3a", ":").replace("%3f", "?")
|
||||||
|
.replace("%3d", "=").replace("%26", "&")
|
||||||
|
|
||||||
//val html = app.get(url).text
|
//val html = app.get(url).text
|
||||||
//val document = Jsoup.parse(html)
|
//val document = Jsoup.parse(html)
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
|
||||||
package com.lagradost
|
package com.lagradost
|
||||||
import com.lagradost.cloudstream3.utils.*
|
import com.lagradost.cloudstream3.utils.*
|
||||||
import com.lagradost.cloudstream3.app
|
import com.lagradost.cloudstream3.app
|
||||||
|
@ -7,7 +8,8 @@ import org.jsoup.Jsoup
|
||||||
open class SibnetExtractor : ExtractorApi() {
|
open class SibnetExtractor : ExtractorApi() {
|
||||||
override val name: String = "Sibnet"
|
override val name: String = "Sibnet"
|
||||||
override val mainUrl: String = "https://video.sibnet.ru"
|
override val mainUrl: String = "https://video.sibnet.ru"
|
||||||
private val srcRegex = Regex("""player\.src\(\[\{src: \"(.*?)\"""") // would be possible to use the parse and find src attribute
|
private val srcRegex =
|
||||||
|
Regex("""player\.src\(\[\{src: \"(.*?)\"""") // would be possible to use the parse and find src attribute
|
||||||
override val requiresReferer = true
|
override val requiresReferer = true
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
package com.lagradost
|
package com.lagradost
|
||||||
|
|
||||||
|
package com.lagradost.cloudstream3.animeproviders
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonProperty
|
import com.fasterxml.jackson.annotation.JsonProperty
|
||||||
import com.lagradost.cloudstream3.*
|
import com.lagradost.cloudstream3.*
|
||||||
import com.lagradost.cloudstream3.utils.*
|
import com.lagradost.cloudstream3.utils.*
|
||||||
|
@ -14,8 +16,10 @@ class VostfreeProvider : MainAPI() {
|
||||||
override val hasQuickSearch = false // recherche rapide (optionel, pas vraimet utile)
|
override val hasQuickSearch = false // recherche rapide (optionel, pas vraimet utile)
|
||||||
override val hasMainPage = true // page d'accueil (optionel mais encoragé)
|
override val hasMainPage = true // page d'accueil (optionel mais encoragé)
|
||||||
override var lang = "fr" // fournisseur est en francais
|
override var lang = "fr" // fournisseur est en francais
|
||||||
|
|
||||||
//override val supportedTypes = setOf(TvType.Movie) // ici on ne supporte que les films
|
//override val supportedTypes = setOf(TvType.Movie) // ici on ne supporte que les films
|
||||||
override val supportedTypes = setOf( TvType.Anime,TvType.AnimeMovie,TvType.OVA) // animes, animesfilms et series
|
override val supportedTypes =
|
||||||
|
setOf(TvType.Anime, TvType.AnimeMovie, TvType.OVA) // animes, animesfilms et series
|
||||||
// liste des types: https://recloudstream.github.io/dokka/app/com.lagradost.cloudstream3/-tv-type/index.html
|
// liste des types: https://recloudstream.github.io/dokka/app/com.lagradost.cloudstream3/-tv-type/index.html
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -29,16 +33,20 @@ class VostfreeProvider : MainAPI() {
|
||||||
val link = "$mainUrl/index.php?story=$query&do=search&subaction=search"
|
val link = "$mainUrl/index.php?story=$query&do=search&subaction=search"
|
||||||
// L'url pour chercher un anime de dragon sera donc: 'https://vostfree.cx/index.php?story=dragon&do=search&subaction=search'
|
// L'url pour chercher un anime de dragon sera donc: 'https://vostfree.cx/index.php?story=dragon&do=search&subaction=search'
|
||||||
// le $ dans une string permet d'insérer une variable
|
// le $ dans une string permet d'insérer une variable
|
||||||
val document = app.get(link).document // app.get() permet de télécharger la page html avec une requete HTTP (get)
|
val document =
|
||||||
|
app.get(link).document // app.get() permet de télécharger la page html avec une requete HTTP (get)
|
||||||
// on convertit le html en un document
|
// on convertit le html en un document
|
||||||
return document.select("div.search-result") // on séléctione tous les éléments 'enfant' du type articles
|
return document.select("div.search-result") // on séléctione tous les éléments 'enfant' du type articles
|
||||||
.apmap { div -> // apmap crée une liste des éléments (ici newMovieSearchResponse et newAnimeSearchResponse)
|
.apmap { div -> // apmap crée une liste des éléments (ici newMovieSearchResponse et newAnimeSearchResponse)
|
||||||
//val posterContainer = div.selectFirst("> span.image ") // selectione le premier élément correspondant à ces critères
|
//val posterContainer = div.selectFirst("> span.image ") // selectione le premier élément correspondant à ces critères
|
||||||
val type = div?.selectFirst("div.genre")?.text()?.replace("\t", "")?.replace("\n", "")
|
val type =
|
||||||
|
div?.selectFirst("div.genre")?.text()?.replace("\t", "")?.replace("\n", "")
|
||||||
// replace enlève tous les '\t' et '\n' du titre
|
// replace enlève tous les '\t' et '\n' du titre
|
||||||
val mediaPoster = mainUrl + div?.selectFirst("span.image > img")?.attr("src") // récupère le texte de l'attribut src de l'élément
|
val mediaPoster = mainUrl + div?.selectFirst("span.image > img")
|
||||||
|
?.attr("src") // récupère le texte de l'attribut src de l'élément
|
||||||
|
|
||||||
val href = div?.selectFirst("div.info > div.title > a")?.attr("href") ?: throw ErrorLoadingException("invalid link") // renvoie une erreur si il n'y a pas de lien vers le média
|
val href = div?.selectFirst("div.info > div.title > a")?.attr("href")
|
||||||
|
?: throw ErrorLoadingException("invalid link") // renvoie une erreur si il n'y a pas de lien vers le média
|
||||||
val title = div.selectFirst("> div.info > div.title > a")?.text().toString()
|
val title = div.selectFirst("> div.info > div.title > a")?.text().toString()
|
||||||
|
|
||||||
when (type) {
|
when (type) {
|
||||||
|
@ -85,13 +93,15 @@ class VostfreeProvider : MainAPI() {
|
||||||
@JsonProperty("url") val url: String,
|
@JsonProperty("url") val url: String,
|
||||||
@JsonProperty("episodeNumber") val episodeNumber: String,
|
@JsonProperty("episodeNumber") val episodeNumber: String,
|
||||||
)
|
)
|
||||||
|
|
||||||
override suspend fun load(url: String): LoadResponse {
|
override suspend fun load(url: String): LoadResponse {
|
||||||
val document = app.get(url).document // récupere le texte sur la page (requète http)
|
val document = app.get(url).document // récupere le texte sur la page (requète http)
|
||||||
// url est le lien retourné par la fonction search (la variable href) ou la fonction getMainPage
|
// url est le lien retourné par la fonction search (la variable href) ou la fonction getMainPage
|
||||||
var mediaType = TvType.Anime
|
var mediaType = TvType.Anime
|
||||||
val episodes = ArrayList<Episode>()
|
val episodes = ArrayList<Episode>()
|
||||||
|
|
||||||
val meta = document.selectFirst("div#dle-content > div.watch-top > div.image-bg > div.image-bg-content > div.slide-block ")
|
val meta =
|
||||||
|
document.selectFirst("div#dle-content > div.watch-top > div.image-bg > div.image-bg-content > div.slide-block ")
|
||||||
var poster: String? = ""
|
var poster: String? = ""
|
||||||
var title = ""
|
var title = ""
|
||||||
|
|
||||||
|
@ -106,10 +116,12 @@ class VostfreeProvider : MainAPI() {
|
||||||
isSaison.forEach {
|
isSaison.forEach {
|
||||||
var url1 = it.attr("href")
|
var url1 = it.attr("href")
|
||||||
while (noSeason) {
|
while (noSeason) {
|
||||||
it.select("[alt=Saison 0$i]").forEach{ // enter in the block when it match the season
|
it.select("[alt=Saison 0$i]")
|
||||||
|
.forEach { // enter in the block when it match the season
|
||||||
noSeason = false
|
noSeason = false
|
||||||
}
|
}
|
||||||
it.select("[alt=Saison $i]").forEach{ // enter in the block when it match the season
|
it.select("[alt=Saison $i]")
|
||||||
|
.forEach { // enter in the block when it match the season
|
||||||
noSeason = false
|
noSeason = false
|
||||||
}
|
}
|
||||||
i++
|
i++
|
||||||
|
@ -120,12 +132,16 @@ class VostfreeProvider : MainAPI() {
|
||||||
noSeason = true
|
noSeason = true
|
||||||
var document1 = app.get(url1).document // récupere le texte sur la page (requète http)
|
var document1 = app.get(url1).document // récupere le texte sur la page (requète http)
|
||||||
// url est le lien retourné par la fonction search (la variable href) ou la fonction getMainPage
|
// url est le lien retourné par la fonction search (la variable href) ou la fonction getMainPage
|
||||||
var meta1 = document1.selectFirst("div#dle-content > div.watch-top > div.image-bg > div.image-bg-content > div.slide-block ")
|
var meta1 =
|
||||||
poster = mainUrl + meta1?.select(" div.slide-poster > img")?.attr("src") // récupere le texte de l'attribut 'data-src'
|
document1.selectFirst("div#dle-content > div.watch-top > div.image-bg > div.image-bg-content > div.slide-block ")
|
||||||
title = meta1?.select("div.slide-middle > h1")?.text() ?: throw ErrorLoadingException("Invalid title")
|
poster = mainUrl + meta1?.select(" div.slide-poster > img")
|
||||||
|
?.attr("src") // récupere le texte de l'attribut 'data-src'
|
||||||
|
title = meta1?.select("div.slide-middle > h1")?.text()
|
||||||
|
?: throw ErrorLoadingException("Invalid title")
|
||||||
title = title.replace("Saison", "").replace("saison", "").replace("SAISON", "")
|
title = title.replace("Saison", "").replace("saison", "").replace("SAISON", "")
|
||||||
title =title.replace("Season","").replace("season","").replace("SEASON","")
|
.replace("Season", "").replace("season", "").replace("SEASON", "")
|
||||||
description= meta1.select("div.slide-middle > div.slide-desc").first()?.text() // first() selectione le premier élément de la liste
|
description = meta1.select("div.slide-middle > div.slide-desc").first()
|
||||||
|
?.text() // first() selectione le premier élément de la liste
|
||||||
|
|
||||||
val listEpisode = document.select(" select.new_player_selector > option").forEach {
|
val listEpisode = document.select(" select.new_player_selector > option").forEach {
|
||||||
|
|
||||||
|
@ -135,14 +151,16 @@ class VostfreeProvider : MainAPI() {
|
||||||
url1,
|
url1,
|
||||||
it.text().replace("Episode ", ""),
|
it.text().replace("Episode ", ""),
|
||||||
).toJson()
|
).toJson()
|
||||||
episodes.add( Episode(
|
episodes.add(
|
||||||
|
Episode(
|
||||||
link,
|
link,
|
||||||
episode = it.text().replace("Episode ", "").toInt(),
|
episode = it.text().replace("Episode ", "").toInt(),
|
||||||
season = saison00,
|
season = saison00,
|
||||||
name = "Saison ${saison00.toString()}" + it.text(),
|
name = "Saison ${saison00.toString()}" + it.text(),
|
||||||
//description= description,
|
//description= description,
|
||||||
posterUrl = poster
|
posterUrl = poster
|
||||||
) )
|
)
|
||||||
|
)
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
mediaType = TvType.AnimeMovie
|
mediaType = TvType.AnimeMovie
|
||||||
|
@ -150,23 +168,30 @@ class VostfreeProvider : MainAPI() {
|
||||||
}
|
}
|
||||||
enterInIseason = true
|
enterInIseason = true
|
||||||
}
|
}
|
||||||
poster = mainUrl + meta?.select(" div.slide-poster > img")?.attr("src") // récupere le texte de l'attribut 'data-src'
|
poster = mainUrl + meta?.select(" div.slide-poster > img")
|
||||||
title = meta?.select("div.slide-middle > h1")?.text() ?: throw ErrorLoadingException("Invalid title")
|
?.attr("src") // récupere le texte de l'attribut 'data-src'
|
||||||
|
title = meta?.select("div.slide-middle > h1")?.text()
|
||||||
|
?: throw ErrorLoadingException("Invalid title")
|
||||||
|
|
||||||
|
|
||||||
description = meta.select("div.slide-middle > div.slide-desc").first()?.text() // first() selectione le premier élément de la liste
|
description = meta.select("div.slide-middle > div.slide-desc").first()
|
||||||
|
?.text() // first() selectione le premier élément de la liste
|
||||||
//var saison0 = document.select("div.new_player_series_count > a")?.text()?.replace("Saison 0","")?.replace("Saison ","")?.toInt()
|
//var saison0 = document.select("div.new_player_series_count > a")?.text()?.replace("Saison 0","")?.replace("Saison ","")?.toInt()
|
||||||
var season: Int?
|
var season: Int?
|
||||||
if(enterInIseason){val seasontext = meta.select("ul.slide-top > li:last-child > b:last-child").text()
|
if (enterInIseason) {
|
||||||
|
val seasontext = meta.select("ul.slide-top > li:last-child > b:last-child").text()
|
||||||
title = title.replace("Saison", "").replace("saison", "").replace("SAISON", "")
|
title = title.replace("Saison", "").replace("saison", "").replace("SAISON", "")
|
||||||
title =title.replace("Season","").replace("season","").replace("SEASON","")
|
.replace("Season", "").replace("season", "").replace("SEASON", "")
|
||||||
var index = seasontext?.indexOf('0')
|
var index = seasontext?.indexOf('0')
|
||||||
var no = seasontext
|
var no = seasontext
|
||||||
while (index == 0) {no = seasontext?.drop(1).toString()
|
while (index == 0) {
|
||||||
index = no?.indexOf('0')}
|
no = seasontext?.drop(1).toString()
|
||||||
|
index = no?.indexOf('0')
|
||||||
|
}
|
||||||
season = no.toInt()
|
season = no.toInt()
|
||||||
} else {
|
} else {
|
||||||
season = null}
|
season = null
|
||||||
|
}
|
||||||
val listEpisode = document.select(" select.new_player_selector > option").forEach {
|
val listEpisode = document.select(" select.new_player_selector > option").forEach {
|
||||||
|
|
||||||
if (it.text() != "Film") {
|
if (it.text() != "Film") {
|
||||||
|
@ -175,7 +200,8 @@ class VostfreeProvider : MainAPI() {
|
||||||
url,
|
url,
|
||||||
it.text().replace("Episode ", ""),
|
it.text().replace("Episode ", ""),
|
||||||
).toJson()
|
).toJson()
|
||||||
episodes.add( Episode(
|
episodes.add(
|
||||||
|
Episode(
|
||||||
link,
|
link,
|
||||||
episode = it.text().replace("Episode ", "").toInt(),
|
episode = it.text().replace("Episode ", "").toInt(),
|
||||||
season = season,
|
season = season,
|
||||||
|
@ -183,7 +209,9 @@ class VostfreeProvider : MainAPI() {
|
||||||
//description= description,
|
//description= description,
|
||||||
posterUrl = poster
|
posterUrl = poster
|
||||||
|
|
||||||
) )}else{
|
)
|
||||||
|
)
|
||||||
|
} else {
|
||||||
|
|
||||||
mediaType = TvType.AnimeMovie
|
mediaType = TvType.AnimeMovie
|
||||||
}
|
}
|
||||||
|
@ -191,7 +219,12 @@ class VostfreeProvider : MainAPI() {
|
||||||
|
|
||||||
|
|
||||||
if (mediaType == TvType.AnimeMovie) {
|
if (mediaType == TvType.AnimeMovie) {
|
||||||
return newMovieLoadResponse(title, url, mediaType,url) { // retourne les informations du film
|
return newMovieLoadResponse(
|
||||||
|
title,
|
||||||
|
url,
|
||||||
|
mediaType,
|
||||||
|
url
|
||||||
|
) { // retourne les informations du film
|
||||||
this.posterUrl = poster
|
this.posterUrl = poster
|
||||||
this.plot = description
|
this.plot = description
|
||||||
}
|
}
|
||||||
|
@ -204,7 +237,10 @@ class VostfreeProvider : MainAPI() {
|
||||||
) {
|
) {
|
||||||
this.posterUrl = poster
|
this.posterUrl = poster
|
||||||
this.plot = description
|
this.plot = description
|
||||||
addEpisodes(if(title.contains("VF")) DubStatus.Dubbed else DubStatus.Subbed, episodes)
|
addEpisodes(
|
||||||
|
if (title.contains("VF")) DubStatus.Dubbed else DubStatus.Subbed,
|
||||||
|
episodes
|
||||||
|
)
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -218,53 +254,61 @@ class VostfreeProvider : MainAPI() {
|
||||||
subtitleCallback: (SubtitleFile) -> Unit,
|
subtitleCallback: (SubtitleFile) -> Unit,
|
||||||
callback: (ExtractorLink) -> Unit,
|
callback: (ExtractorLink) -> Unit,
|
||||||
): Boolean {
|
): Boolean {
|
||||||
val parsedInfo = tryParseJson<EpisodeData>(data)//?:throw ErrorLoadingException("Invalid url")
|
val parsedInfo =
|
||||||
val url = if(parsedInfo?.url !=null){parsedInfo.url}else{data}
|
tryParseJson<EpisodeData>(data)//?:throw ErrorLoadingException("Invalid url")
|
||||||
val noEpisode = if(parsedInfo?.episodeNumber !=null){parsedInfo.episodeNumber}else{"1"} // if is not a movie then take the episode number else 1
|
val url = if (parsedInfo?.url != null) {
|
||||||
|
parsedInfo.url
|
||||||
|
} else {
|
||||||
|
data
|
||||||
|
}
|
||||||
|
val noEpisode = if (parsedInfo?.episodeNumber != null) {
|
||||||
|
parsedInfo.episodeNumber
|
||||||
|
} else {
|
||||||
|
"1"
|
||||||
|
} // if is not a movie then take the episode number else 1
|
||||||
|
|
||||||
val document = app.get(url).document
|
val document = app.get(url).document
|
||||||
document.select("div.new_player_bottom").apmap { player_bottom -> // séléctione tous les players
|
document.select("div.new_player_bottom")
|
||||||
|
.apmap { player_bottom -> // séléctione tous les players
|
||||||
|
|
||||||
// supprimer les zéro de 0015 pour obtenir l'episode 15
|
// supprimer les zéro de 0015 pour obtenir l'episode 15
|
||||||
var index = noEpisode?.indexOf('0')
|
var index = noEpisode?.indexOf('0')
|
||||||
var no = noEpisode
|
var no = noEpisode
|
||||||
while (index == 0) {no = noEpisode?.drop(1).toString()
|
while (index == 0) {
|
||||||
index = no?.indexOf('0')}
|
no = noEpisode?.drop(1).toString()
|
||||||
|
index = no?.indexOf('0')
|
||||||
|
}
|
||||||
|
|
||||||
var cssQuery = " div#buttons_$no" // no numéro épisode
|
var cssQuery = " div#buttons_$no" // no numéro épisode
|
||||||
val buttonsNepisode = player_bottom?.select(cssQuery)?:throw ErrorLoadingException("Non player") //séléctione tous les players pour l'episode NoEpisode
|
val buttonsNepisode = player_bottom?.select(cssQuery)
|
||||||
|
?: throw ErrorLoadingException("Non player") //séléctione tous les players pour l'episode NoEpisode
|
||||||
buttonsNepisode.select("> div").forEach {
|
buttonsNepisode.select("> div").forEach {
|
||||||
val player = it.attr("id")?.toString()?: throw ErrorLoadingException("Player No found") //prend tous les players resultat : "player_2140" et "player_6521"
|
val player = it.attr("id")?.toString()
|
||||||
val playerName = it.select("div#$player").text() // prend le nom du player ex : "Uqload" et "Sibnet"
|
?: throw ErrorLoadingException("Player No found") //prend tous les players resultat : "player_2140" et "player_6521"
|
||||||
|
val playerName = it.select("div#$player")
|
||||||
|
.text() // prend le nom du player ex : "Uqload" et "Sibnet"
|
||||||
//for(i in playerName.indices){
|
//for(i in playerName.indices){
|
||||||
var codePlayload =
|
var codePlayload =
|
||||||
document.selectFirst("div#content_$player")?.text().toString() // resultat : "325544" ou "https:..." peut être lorsque playerName = VIP ou Upvid DStream
|
document.selectFirst("div#content_$player")?.text()
|
||||||
|
.toString() // resultat : "325544" ou "https:..." peut être lorsque playerName = VIP ou Upvid DStream
|
||||||
var playerUrl = ""
|
var playerUrl = ""
|
||||||
when (playerName) {
|
playerUrl = when (playerName) {
|
||||||
"VIP" -> playerUrl = codePlayload
|
"VIP", "Upvid", "Dstream", "Streamsb", "Vudeo", "NinjaS" -> codePlayload
|
||||||
"Upvid" -> playerUrl = codePlayload // extractor à faire
|
"Uqload" -> "https://uqload.com/embed-$codePlayload.html"
|
||||||
"Uqload" -> // film_iframe
|
"Mytv" -> "https://www.myvi.tv/embed/$codePlayload"
|
||||||
playerUrl = "https://uqload.com/embed-$codePlayload.html" // OK
|
"Sibnet" -> "https://video.sibnet.ru/shell.php?videoid=$codePlayload"
|
||||||
"Dstream" -> playerUrl = codePlayload
|
"Stream" -> "https://myvi.ru/player/embed/html/$codePlayload"
|
||||||
"Streamsb" -> playerUrl = codePlayload // OK
|
else -> ""
|
||||||
"Vudeo" -> playerUrl = codePlayload // OK
|
|
||||||
"Mytv" -> // film_iframe
|
|
||||||
playerUrl = "https://www.myvi.tv/embed/$codePlayload" //OK
|
|
||||||
"Sibnet" -> // film_iframe
|
|
||||||
playerUrl = "https://video.sibnet.ru/shell.php?videoid=$codePlayload" // OK
|
|
||||||
|
|
||||||
"NinjaS" -> // film_iframe
|
|
||||||
playerUrl = codePlayload
|
|
||||||
"Stream" -> // == myTv extractor + security
|
|
||||||
playerUrl = "https://myvi.ru/player/embed/html/$codePlayload" //OK
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (playerUrl != "")
|
if (playerUrl != "")
|
||||||
loadExtractor(httpsify(playerUrl), playerUrl, subtitleCallback) { link -> // charge un extracteur d'extraire le lien direct .mp4
|
loadExtractor(
|
||||||
callback.invoke(ExtractorLink( // ici je modifie le callback pour ajouter des informations, normalement ce n'est pas nécessaire
|
httpsify(playerUrl),
|
||||||
|
playerUrl,
|
||||||
|
subtitleCallback
|
||||||
|
) { link -> // charge un extracteur d'extraire le lien direct .mp4
|
||||||
|
callback.invoke(
|
||||||
|
ExtractorLink( // ici je modifie le callback pour ajouter des informations, normalement ce n'est pas nécessaire
|
||||||
link.source,
|
link.source,
|
||||||
link.name + "",
|
link.name + "",
|
||||||
link.url,
|
link.url,
|
||||||
|
@ -273,7 +317,8 @@ class VostfreeProvider : MainAPI() {
|
||||||
link.isM3u8,
|
link.isM3u8,
|
||||||
link.headers,
|
link.headers,
|
||||||
link.extractorData
|
link.extractorData
|
||||||
))
|
)
|
||||||
|
)
|
||||||
}
|
}
|
||||||
// }
|
// }
|
||||||
|
|
||||||
|
@ -291,50 +336,38 @@ class VostfreeProvider : MainAPI() {
|
||||||
request: MainPageRequest
|
request: MainPageRequest
|
||||||
): HomePageResponse {
|
): HomePageResponse {
|
||||||
val list = ArrayList<HomePageList>()
|
val list = ArrayList<HomePageList>()
|
||||||
val animeDubStatus = ArrayList<String>(15)
|
val animeDubStatus = ArrayList<String>(1)
|
||||||
|
|
||||||
animeDubStatus.add("/animes-vf/")
|
animeDubStatus.add("/animes-vf/")
|
||||||
animeDubStatus.add("/animes-vostfr/")
|
animeDubStatus.add("/animes-vostfr/")
|
||||||
animeDubStatus.add("/films-vf-vostfr/")
|
animeDubStatus.add("/films-vf-vostfr/")
|
||||||
animeDubStatus.add("/genre/Action/")
|
|
||||||
animeDubStatus.add("/genre/Aventure/")
|
|
||||||
animeDubStatus.add("/genre/Comédie/")
|
|
||||||
animeDubStatus.add("/genre/Tranche+de+vie/")
|
|
||||||
animeDubStatus.add("/genre/Drame/")
|
|
||||||
animeDubStatus.add("/genre/Fantasy/")
|
|
||||||
animeDubStatus.add("/genre/Surnaturel/")
|
|
||||||
animeDubStatus.add("/genre/Mystère/")
|
|
||||||
animeDubStatus.add("/genre/Shonen/")
|
|
||||||
animeDubStatus.add("/genre/Psychologique/")
|
|
||||||
animeDubStatus.add("/genre/Romance/")
|
|
||||||
animeDubStatus.add("/genre/Sci-Fi/")
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
animeDubStatus.forEach {
|
animeDubStatus.forEach {
|
||||||
val documentZero = app.get("$mainUrl$it").document
|
val documentZero = app.get("$mainUrl$it").document
|
||||||
val numberOFpage = documentZero.select("div.navigation > div.pages > a").text()
|
val numberOFpage = documentZero.select("div.navigation > div.pages > a").text()
|
||||||
var lastpage = if(numberOFpage !="")numberOFpage.substringAfterLast(" ").toString().toInt() else 1
|
var lastpage = if (numberOFpage != "") numberOFpage.substringAfterLast(" ").toString()
|
||||||
|
.toInt() else 1
|
||||||
val openPageMax = 2 // prendre uniquement les n pages
|
val openPageMax = 2 // prendre uniquement les n pages
|
||||||
lastpage =if(lastpage>openPageMax){openPageMax}else{ lastpage}
|
lastpage = if (lastpage > openPageMax) {
|
||||||
|
openPageMax
|
||||||
|
} else {
|
||||||
|
lastpage
|
||||||
|
}
|
||||||
var categoryTitle = ""
|
var categoryTitle = ""
|
||||||
for (i in 1..lastpage) {
|
for (i in 1..lastpage) {
|
||||||
var page = "/page/$i"
|
var page = "/page/$i"
|
||||||
val document = app.get("$mainUrl$it$page").document
|
val document = app.get("$mainUrl$it$page").document
|
||||||
|
|
||||||
val movies = document.select("div#content > div#dle-content > div.movie-poster")
|
val movies = document.select("div#content > div#dle-content > div.movie-poster")
|
||||||
|
|
||||||
if (it.contains("genre", true)) {
|
|
||||||
categoryTitle = it.replace("/genre/", "").replace("/", " (page $i)").replace("+", " ")
|
|
||||||
categoryTitle = "Catégorie : $categoryTitle"
|
|
||||||
} else {
|
|
||||||
categoryTitle =
|
categoryTitle =
|
||||||
document.select("div#left-movies-block > ul#left-movies-tabs > li").text().replace("Animes VF", " Animes EN FRANÇAIS (page $i)").replace("Animes VOSTFR", " Animes VOSTFR (page $i)")
|
document.select("div#left-movies-block > ul#left-movies-tabs > li").text()
|
||||||
.replace("Films VF et VOSTFR", "FILMS EN FRANÇAIS OU EN VOSTFR (page $i)").replace("Liste","").replace("La liste des","")
|
.replace("Animes VF", " Animes EN FRANÇAIS (page $i)")
|
||||||
}
|
.replace("Animes VOSTFR", " Animes VOSTFR (page $i)")
|
||||||
|
.replace("Films VF et VOSTFR", "FILMS EN FRANÇAIS OU EN VOSTFR (page $i)")
|
||||||
|
.replace("Liste", "").replace("La liste des", "")
|
||||||
|
|
||||||
val returnList = movies.mapNotNull { article ->
|
val returnList = movies.mapNotNull { article ->
|
||||||
// map est la même chose que apmap (mais apmap est plus rapide)
|
// map est la même chose que apmap (mais apmap est plus rapide)
|
||||||
// ici si un élément est null, il sera automatiquement enlevé de la liste
|
// ici si un élément est null, il sera automatiquement enlevé de la liste
|
||||||
|
@ -368,7 +401,8 @@ class VostfreeProvider : MainAPI() {
|
||||||
this.posterUrl = posterUrl
|
this.posterUrl = posterUrl
|
||||||
if (subdub == "VF") DubStatus.Dubbed else DubStatus.Subbed
|
if (subdub == "VF") DubStatus.Dubbed else DubStatus.Subbed
|
||||||
//this.quality = quality
|
//this.quality = quality
|
||||||
} }
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
if (returnList.isEmpty()) throw ErrorLoadingException()
|
if (returnList.isEmpty()) throw ErrorLoadingException()
|
||||||
|
@ -378,7 +412,8 @@ class VostfreeProvider : MainAPI() {
|
||||||
}
|
}
|
||||||
if (list.isEmpty()) throw ErrorLoadingException()
|
if (list.isEmpty()) throw ErrorLoadingException()
|
||||||
return HomePageResponse(
|
return HomePageResponse(
|
||||||
list)
|
list
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,13 +1,14 @@
|
||||||
|
|
||||||
package com.lagradost
|
package com.lagradost
|
||||||
import com.lagradost.cloudstream3.utils.*
|
import com.lagradost.cloudstream3.utils.*
|
||||||
import com.lagradost.cloudstream3.app
|
import com.lagradost.cloudstream3.app
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
open class VudeoExtractor : ExtractorApi() {
|
open class VudeoExtractor : ExtractorApi() {
|
||||||
override val name: String = "Vudeo"
|
override val name: String = "Vudeo"
|
||||||
override val mainUrl: String = "https://vudeo.io/"
|
override val mainUrl: String = "https://vudeo.io/"
|
||||||
private val srcRegex = Regex("""sources\: \[\"(.*)\"""") // would be possible to use the parse and find src attribute
|
private val srcRegex =
|
||||||
|
Regex("""sources\: \[\"(.*)\"""") // would be possible to use the parse and find src attribute
|
||||||
override val requiresReferer = false
|
override val requiresReferer = false
|
||||||
|
|
||||||
|
|
||||||
|
@ -29,3 +30,5 @@ open class VudeoExtractor : ExtractorApi() {
|
||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue