diff --git a/app/src/main/java/com/lagradost/cloudstream3/extractors/SBPlay.kt b/app/src/main/java/com/lagradost/cloudstream3/extractors/SBPlay.kt index e8ab4090..df4211b7 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/extractors/SBPlay.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/extractors/SBPlay.kt @@ -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 diff --git a/app/src/main/java/com/lagradost/cloudstream3/extractors/Vidstream.kt b/app/src/main/java/com/lagradost/cloudstream3/extractors/Vidstream.kt index d4ee9da2..3cbdfdd7 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/extractors/Vidstream.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/extractors/Vidstream.kt @@ -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") + ) ) - ) + } } } diff --git a/app/src/main/java/com/lagradost/cloudstream3/utils/ExtractorApi.kt b/app/src/main/java/com/lagradost/cloudstream3/utils/ExtractorApi.kt index 9b6ddaa1..541a2c36 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/utils/ExtractorApi.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/utils/ExtractorApi.kt @@ -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 = arrayOf( XStreamCdn(), StreamSB(), Streamhub(), - SBPlay(), + FEmbed(), WatchSB(), VoeExtractor(), @@ -91,7 +90,10 @@ val extractorApis: Array = arrayOf( DoodSoExtractor(), DoodLaExtractor(), - AsianLoad() + AsianLoad(), + + SBPlay(), + SBPlay2(), ) fun getExtractorApiFromName(name: String): ExtractorApi {