forked from recloudstream/cloudstream
fixed Vidstream extractor
This commit is contained in:
parent
251da7d157
commit
9d2e924ac1
3 changed files with 27 additions and 18 deletions
|
@ -9,7 +9,11 @@ import com.lagradost.cloudstream3.utils.Qualities
|
||||||
import com.lagradost.cloudstream3.utils.getPostForm
|
import com.lagradost.cloudstream3.utils.getPostForm
|
||||||
import org.jsoup.Jsoup
|
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 mainUrl = "https://sbplay.one"
|
||||||
override val name = "SBPlay"
|
override val name = "SBPlay"
|
||||||
override val requiresReferer = false
|
override val requiresReferer = false
|
||||||
|
|
|
@ -2,12 +2,11 @@ package com.lagradost.cloudstream3.extractors
|
||||||
|
|
||||||
import com.lagradost.cloudstream3.app
|
import com.lagradost.cloudstream3.app
|
||||||
import com.lagradost.cloudstream3.mvvm.normalSafeApiCall
|
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.pmap
|
||||||
import com.lagradost.cloudstream3.utils.ExtractorLink
|
import com.lagradost.cloudstream3.utils.ExtractorLink
|
||||||
import com.lagradost.cloudstream3.utils.extractorApis
|
import com.lagradost.cloudstream3.utils.extractorApis
|
||||||
import com.lagradost.cloudstream3.utils.getQualityFromName
|
import com.lagradost.cloudstream3.utils.getQualityFromName
|
||||||
|
import com.lagradost.cloudstream3.utils.loadExtractor
|
||||||
import org.jsoup.Jsoup
|
import org.jsoup.Jsoup
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -46,21 +45,25 @@ class Vidstream(val mainUrl: String) {
|
||||||
val pageDoc = Jsoup.parse(page.text)
|
val pageDoc = Jsoup.parse(page.text)
|
||||||
val qualityRegex = Regex("(\\d+)P")
|
val qualityRegex = Regex("(\\d+)P")
|
||||||
|
|
||||||
pageDoc.select(".dowload > a[download]").forEach {
|
//a[download]
|
||||||
val qual = if (it.text()
|
pageDoc.select(".dowload > a")?.pmap { element ->
|
||||||
|
val href = element.attr("href") ?: return@pmap
|
||||||
|
val qual = if (element.text()
|
||||||
.contains("HDP")
|
.contains("HDP")
|
||||||
) "1080" else qualityRegex.find(it.text())?.destructured?.component1().toString()
|
) "1080" else qualityRegex.find(element.text())?.destructured?.component1().toString()
|
||||||
|
|
||||||
callback.invoke(
|
if (!loadExtractor(href, link, callback)) {
|
||||||
ExtractorLink(
|
callback.invoke(
|
||||||
this.name,
|
ExtractorLink(
|
||||||
if (qual == "null") this.name else "${this.name} - " + qual + "p",
|
this.name,
|
||||||
it.attr("href"),
|
if (qual == "null") this.name else "${this.name} - " + qual + "p",
|
||||||
page.url,
|
href,
|
||||||
getQualityFromName(qual),
|
page.url,
|
||||||
it.attr("href").contains(".m3u8")
|
getQualityFromName(qual),
|
||||||
|
element.attr("href").contains(".m3u8")
|
||||||
|
)
|
||||||
)
|
)
|
||||||
)
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,6 @@ import com.lagradost.cloudstream3.USER_AGENT
|
||||||
import com.lagradost.cloudstream3.app
|
import com.lagradost.cloudstream3.app
|
||||||
import com.lagradost.cloudstream3.extractors.*
|
import com.lagradost.cloudstream3.extractors.*
|
||||||
import com.lagradost.cloudstream3.mvvm.normalSafeApiCall
|
import com.lagradost.cloudstream3.mvvm.normalSafeApiCall
|
||||||
import com.lagradost.cloudstream3.network.text
|
|
||||||
import org.jsoup.Jsoup
|
import org.jsoup.Jsoup
|
||||||
|
|
||||||
data class ExtractorLink(
|
data class ExtractorLink(
|
||||||
|
@ -80,7 +79,7 @@ val extractorApis: Array<ExtractorApi> = arrayOf(
|
||||||
XStreamCdn(),
|
XStreamCdn(),
|
||||||
StreamSB(),
|
StreamSB(),
|
||||||
Streamhub(),
|
Streamhub(),
|
||||||
SBPlay(),
|
|
||||||
FEmbed(),
|
FEmbed(),
|
||||||
WatchSB(),
|
WatchSB(),
|
||||||
VoeExtractor(),
|
VoeExtractor(),
|
||||||
|
@ -91,7 +90,10 @@ val extractorApis: Array<ExtractorApi> = arrayOf(
|
||||||
DoodSoExtractor(),
|
DoodSoExtractor(),
|
||||||
DoodLaExtractor(),
|
DoodLaExtractor(),
|
||||||
|
|
||||||
AsianLoad()
|
AsianLoad(),
|
||||||
|
|
||||||
|
SBPlay(),
|
||||||
|
SBPlay2(),
|
||||||
)
|
)
|
||||||
|
|
||||||
fun getExtractorApiFromName(name: String): ExtractorApi {
|
fun getExtractorApiFromName(name: String): ExtractorApi {
|
||||||
|
|
Loading…
Reference in a new issue