Fixes on Bflix and Wco (#748)

This commit is contained in:
Stormunblessed 2022-03-05 12:19:50 +00:00 committed by GitHub
parent a2f92d8a26
commit 58bed05a32
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 20 additions and 11 deletions

View file

@ -14,6 +14,9 @@ class Vizcloud : WcoStream() {
override val mainUrl: String = "https://vizcloud2.ru"
}
class Vizcloud2 : WcoStream() {
override val mainUrl: String = "https://vizcloud2.online"
}
open class WcoStream : ExtractorApi() {
override val name = "VidStream" //Cause works for animekisa and wco
@ -87,9 +90,10 @@ open class WcoStream : ExtractorApi() {
}
}
}
if (mainUrl == "https://vidstream.pro" || mainUrl == "https://vidstreamz.online") {
if (mainUrl == "https://vidstream.pro" || mainUrl == "https://vidstreamz.online" || mainUrl == "https://vizcloud2.online") {
if (it.file.contains("m3u8")) {
hlsHelper.m3u8Generation(M3u8Helper.M3u8Stream(it.file, null), true)
hlsHelper.m3u8Generation(M3u8Helper.M3u8Stream(it.file.replace("#.mp4",""), null,
headers = mapOf("Referer" to url)), true)
.forEach { stream ->
val qualityString =
if ((stream.quality ?: 0) == 0) "" else "${stream.quality}p"
@ -98,9 +102,9 @@ open class WcoStream : ExtractorApi() {
name,
"$name $qualityString",
stream.streamUrl,
"",
url,
getQualityFromName(stream.quality.toString()),
true
true,
)
)
}

View file

@ -199,8 +199,6 @@ class BflixProvider(providerUrl: String, providerName: String) : MainAPI() {
val soup = app.get(url).document
val movieid = soup.selectFirst("div#watch").attr("data-id")
val movieidencoded = encode(getVrf(movieid) ?: return null)
val tvType = if (url.contains("/movie/")) TvType.Movie else TvType.TvSeries
val title = soup.selectFirst("div.info h1").text()
val description = soup.selectFirst(".info .desc")?.text()?.trim()
val poster: String? = try {
@ -210,7 +208,7 @@ class BflixProvider(providerUrl: String, providerName: String) : MainAPI() {
}
val tags = soup.select("div.info .meta div:contains(Genre) a").map { it.text() }
val episodes = if (tvType == TvType.TvSeries) Jsoup.parse(
val episodes = Jsoup.parse(
app.get(
"$mainUrl/ajax/film/servers?id=$movieid&vrf=$movieidencoded"
).mapped<Response>().html
@ -225,13 +223,16 @@ class BflixProvider(providerUrl: String, providerName: String) : MainAPI() {
val season = if (isValid) extraData?.getOrNull(0) else null
val eptitle = it.selectFirst(".episode a span.name").text()
val secondtitle = it.selectFirst(".episode a span").text()
.replace(Regex("(Episode (\\d+):|Episode (\\d+)-|Episode (\\d+))"),"") ?: ""
TvSeriesEpisode(
eptitle,
secondtitle+eptitle,
season,
episode,
href,
)
} else null
}
val tvType = if (url.contains("/movie/") && episodes.size == 1) TvType.Movie else TvType.TvSeries
val recommendations =
soup.select("div.bl-2 section.bl div.content div.filmlist div.item")
?.mapNotNull { element ->
@ -263,7 +264,7 @@ class BflixProvider(providerUrl: String, providerName: String) : MainAPI() {
url,
this.name,
tvType,
episodes!!,
episodes,
poster,
year?.toIntOrNull(),
description,
@ -332,8 +333,11 @@ class BflixProvider(providerUrl: String, providerName: String) : MainAPI() {
).html
)
.select("html body #episodes").map {
val tvType = if (data.contains("movie/")) TvType.Movie else TvType.TvSeries
val cleandata = data.replace(mainUrl, "")
val a = it.select("a").map {
it.attr("data-kname")
}
val tvType = if (data.contains("movie/") && a.size == 1) TvType.Movie else TvType.TvSeries
val servers = if (tvType == TvType.Movie) it.select(".episode a").attr("data-ep")
else
it.select(".episode a[href=$cleandata]").attr("data-ep")

View file

@ -96,6 +96,7 @@ val extractorApis: Array<ExtractorApi> = arrayOf(
WcoStream(),
Vidstreamz(),
Vizcloud(),
Vizcloud2(),
Mp4Upload(),
StreamTape(),
MixDrop(),