mirror of
				https://github.com/recloudstream/cloudstream.git
				synced 2024-08-15 01:53:11 +00:00 
			
		
		
		
	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
This commit is contained in:
		
							parent
							
								
									391215d76f
								
							
						
					
					
						commit
						3a42ca2f6b
					
				
					 4 changed files with 42 additions and 3 deletions
				
			
		| 
						 | 
				
			
			@ -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,
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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?>(servers) ?: return@map
 | 
			
		||||
                listOfNotNull(
 | 
			
		||||
                    jsonservers.vidstream,
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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("/")
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue