From 3a42ca2f6b2093624d9dab57f5b254807ea42497 Mon Sep 17 00:00:00 2001 From: Stormunblessed <86633626+Stormunblessed@users.noreply.github.com> Date: Mon, 28 Feb 2022 19:52:34 +0000 Subject: [PATCH] Bflix Vidstream server fix (#728) * Bflix vidstream fix * Bflix Vidstream fix * remove dead links vizcloud * Removed print, minor fix for vidstream, and fix for StreamSB --- .../cloudstream3/extractors/StreamSB.kt | 2 +- .../cloudstream3/extractors/WcoStream.kt | 38 +++++++++++++++++++ .../movieproviders/BflixProvider.kt | 3 +- .../cloudstream3/utils/M3u8Helper.kt | 2 +- 4 files changed, 42 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/com/lagradost/cloudstream3/extractors/StreamSB.kt b/app/src/main/java/com/lagradost/cloudstream3/extractors/StreamSB.kt index 73e1932d..034acef7 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/extractors/StreamSB.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/extractors/StreamSB.kt @@ -88,7 +88,7 @@ open class StreamSB : ExtractorApi() { }.first() val bytes = id.toByteArray() val bytesToHex = bytesToHex(bytes) - val master = "$mainUrl/sources40/566d337678566f743674494a7c7c${bytesToHex}7c7c346b6767586d6934774855537c7c73747265616d7362/6565417268755339773461447c7c346133383438333436313335376136323337373433383634376337633465366534393338373136643732373736343735373237613763376334363733353737303533366236333463353333363534366137633763373337343732363536313664373336327c7c6b586c3163614468645a47617c7c73747265616d7362" + val master = "$mainUrl/sources41/566d337678566f743674494a7c7c${bytesToHex}7c7c346b6767586d6934774855537c7c73747265616d7362/6565417268755339773461447c7c346133383438333436313335376136323337373433383634376337633465366534393338373136643732373736343735373237613763376334363733353737303533366236333463353333363534366137633763373337343732363536313664373336327c7c6b586c3163614468645a47617c7c73747265616d7362" val headers = mapOf( "Host" to url.substringAfter("https://").substringBefore("/"), "User-Agent" to USER_AGENT, diff --git a/app/src/main/java/com/lagradost/cloudstream3/extractors/WcoStream.kt b/app/src/main/java/com/lagradost/cloudstream3/extractors/WcoStream.kt index 1a421b43..bbe3fc22 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/extractors/WcoStream.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/extractors/WcoStream.kt @@ -2,6 +2,7 @@ package com.lagradost.cloudstream3.extractors import com.fasterxml.jackson.annotation.JsonProperty import com.fasterxml.jackson.module.kotlin.readValue +import com.lagradost.cloudstream3.apmap import com.lagradost.cloudstream3.app import com.lagradost.cloudstream3.mapper import com.lagradost.cloudstream3.utils.* @@ -51,6 +52,42 @@ open class WcoStream : ExtractorApi() { if (mapped.success) { mapped.media.sources.forEach { + if (mainUrl == "https://vizcloud2.ru") { + if (it.file.contains("vizcloud2.ru")) { + //Had to do this thing 'cause "list.m3u8#.mp4" gives 404 error so no quality is added + val link1080 = it.file.replace("list.m3u8#.mp4","H4/v.m3u8") + val link720 = it.file.replace("list.m3u8#.mp4","H3/v.m3u8") + val link480 = it.file.replace("list.m3u8#.mp4","H2/v.m3u8") + val link360 = it.file.replace("list.m3u8#.mp4","H1/v.m3u8") + val linkauto = it.file.replace("#.mp4","") + listOf( + link1080, + link720, + link480, + link360, + linkauto).apmap { serverurl -> + val testurl = app.get(serverurl, headers = mapOf("Referer" to url)).text + if (testurl.contains("EXTM3")) { + val quality = if (serverurl.contains("H4")) "1080p" + else if (serverurl.contains("H3")) "720p" + else if (serverurl.contains("H2")) "480p" + else if (serverurl.contains("H1")) "360p" + else "Auto" + sources.add( + ExtractorLink( + "VidStream", + "VidStream $quality", + serverurl, + url, + getQualityFromName(quality), + true, + ) + ) + } + } + } + } + if (mainUrl == "https://vidstream.pro" || mainUrl == "https://vidstreamz.online") { if (it.file.contains("m3u8")) { hlsHelper.m3u8Generation(M3u8Helper.M3u8Stream(it.file, null), true) .forEach { stream -> @@ -79,6 +116,7 @@ open class WcoStream : ExtractorApi() { ) ) } + } } } return sources diff --git a/app/src/main/java/com/lagradost/cloudstream3/movieproviders/BflixProvider.kt b/app/src/main/java/com/lagradost/cloudstream3/movieproviders/BflixProvider.kt index 7c4c18ff..22e59bc9 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/movieproviders/BflixProvider.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/movieproviders/BflixProvider.kt @@ -317,10 +317,11 @@ class BflixProvider(providerUrl: String, providerName: String) : MainAPI() { ) .select("html body #episodes").map { val tvType = if (data.contains("movie/")) TvType.Movie else TvType.TvSeries - val cleandata = data.replace(mainUrl,"").replace("/1-full","") + val cleandata = data.replace(mainUrl,"") val servers = if (tvType == TvType.Movie) it.select(".episode a").attr("data-ep") else it.select(".episode a[href=$cleandata]").attr("data-ep") + ?: it.select(".episode a[href=${cleandata.replace("/1-full","")}]").attr("data-ep") val jsonservers = parseJson(servers) ?: return@map listOfNotNull( jsonservers.vidstream, diff --git a/app/src/main/java/com/lagradost/cloudstream3/utils/M3u8Helper.kt b/app/src/main/java/com/lagradost/cloudstream3/utils/M3u8Helper.kt index d1d60f17..88d9a801 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/utils/M3u8Helper.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/utils/M3u8Helper.kt @@ -14,7 +14,7 @@ class M3u8Helper { private val ENCRYPTION_URL_IV_REGEX = Regex("#EXT-X-KEY:METHOD=([^,]+),URI=\"([^\"]+)\"(?:,IV=(.*))?") private val QUALITY_REGEX = Regex("""#EXT-X-STREAM-INF:(?:(?:.*?(?:RESOLUTION=\d+x(\d+)).*?\s+(.*))|(?:.*?\s+(.*)))""") - private val TS_EXTENSION_REGEX = Regex("""(.*\.ts.*)""") + private val TS_EXTENSION_REGEX = Regex("""(.*\.ts.*|.*\.jpg.*)""") //.jpg here 'case vizcloud uses .jpg instead of .ts fun absoluteExtensionDetermination(url: String): String? { val split = url.split("/")