mirror of
https://github.com/recloudstream/cloudstream.git
synced 2024-08-15 01:53:11 +00:00
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 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
|
||||
|
|
|
@ -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,23 +45,27 @@ 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()
|
||||
|
||||
if (!loadExtractor(href, link, callback)) {
|
||||
callback.invoke(
|
||||
ExtractorLink(
|
||||
this.name,
|
||||
if (qual == "null") this.name else "${this.name} - " + qual + "p",
|
||||
it.attr("href"),
|
||||
href,
|
||||
page.url,
|
||||
getQualityFromName(qual),
|
||||
it.attr("href").contains(".m3u8")
|
||||
element.attr("href").contains(".m3u8")
|
||||
)
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
with(app.get(extractorUrl)) {
|
||||
val document = Jsoup.parse(this.text)
|
||||
|
|
|
@ -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 {
|
||||
|
|
Loading…
Reference in a new issue