fixed Vidstream extractor

This commit is contained in:
LagradOst 2021-12-25 19:54:44 +01:00
parent 251da7d157
commit 9d2e924ac1
3 changed files with 27 additions and 18 deletions

View file

@ -9,7 +9,11 @@ import com.lagradost.cloudstream3.utils.Qualities
import com.lagradost.cloudstream3.utils.getPostForm
import org.jsoup.Jsoup
class SBPlay : ExtractorApi() {
class SBPlay2 : SBPlay() {
override val mainUrl = "https://sbplay2.com"
}
open class SBPlay : ExtractorApi() {
override val mainUrl = "https://sbplay.one"
override val name = "SBPlay"
override val requiresReferer = false

View file

@ -2,12 +2,11 @@ package com.lagradost.cloudstream3.extractors
import com.lagradost.cloudstream3.app
import com.lagradost.cloudstream3.mvvm.normalSafeApiCall
import com.lagradost.cloudstream3.network.text
import com.lagradost.cloudstream3.network.url
import com.lagradost.cloudstream3.pmap
import com.lagradost.cloudstream3.utils.ExtractorLink
import com.lagradost.cloudstream3.utils.extractorApis
import com.lagradost.cloudstream3.utils.getQualityFromName
import com.lagradost.cloudstream3.utils.loadExtractor
import org.jsoup.Jsoup
/**
@ -46,21 +45,25 @@ class Vidstream(val mainUrl: String) {
val pageDoc = Jsoup.parse(page.text)
val qualityRegex = Regex("(\\d+)P")
pageDoc.select(".dowload > a[download]").forEach {
val qual = if (it.text()
//a[download]
pageDoc.select(".dowload > a")?.pmap { element ->
val href = element.attr("href") ?: return@pmap
val qual = if (element.text()
.contains("HDP")
) "1080" else qualityRegex.find(it.text())?.destructured?.component1().toString()
) "1080" else qualityRegex.find(element.text())?.destructured?.component1().toString()
callback.invoke(
ExtractorLink(
this.name,
if (qual == "null") this.name else "${this.name} - " + qual + "p",
it.attr("href"),
page.url,
getQualityFromName(qual),
it.attr("href").contains(".m3u8")
if (!loadExtractor(href, link, callback)) {
callback.invoke(
ExtractorLink(
this.name,
if (qual == "null") this.name else "${this.name} - " + qual + "p",
href,
page.url,
getQualityFromName(qual),
element.attr("href").contains(".m3u8")
)
)
)
}
}
}

View file

@ -4,7 +4,6 @@ import com.lagradost.cloudstream3.USER_AGENT
import com.lagradost.cloudstream3.app
import com.lagradost.cloudstream3.extractors.*
import com.lagradost.cloudstream3.mvvm.normalSafeApiCall
import com.lagradost.cloudstream3.network.text
import org.jsoup.Jsoup
data class ExtractorLink(
@ -80,7 +79,7 @@ val extractorApis: Array<ExtractorApi> = arrayOf(
XStreamCdn(),
StreamSB(),
Streamhub(),
SBPlay(),
FEmbed(),
WatchSB(),
VoeExtractor(),
@ -91,7 +90,10 @@ val extractorApis: Array<ExtractorApi> = arrayOf(
DoodSoExtractor(),
DoodLaExtractor(),
AsianLoad()
AsianLoad(),
SBPlay(),
SBPlay2(),
)
fun getExtractorApiFromName(name: String): ExtractorApi {