diff --git a/library/src/commonMain/kotlin/com/lagradost/cloudstream3/extractors/Bigwarp.kt b/library/src/commonMain/kotlin/com/lagradost/cloudstream3/extractors/Bigwarp.kt new file mode 100644 index 000000000..50a68c62f --- /dev/null +++ b/library/src/commonMain/kotlin/com/lagradost/cloudstream3/extractors/Bigwarp.kt @@ -0,0 +1,51 @@ +package com.lagradost.cloudstream3.extractors + +import com.lagradost.cloudstream3.SubtitleFile +import com.lagradost.cloudstream3.app +import com.lagradost.cloudstream3.utils.ExtractorApi +import com.lagradost.cloudstream3.utils.ExtractorLink +import com.lagradost.cloudstream3.utils.Qualities +import com.lagradost.cloudstream3.utils.newExtractorLink + +open class BigwarpIO : ExtractorApi() { + override var name = "Bigwarp" + override var mainUrl = "https://bigwarp.io" + override val requiresReferer = false + + private val sourceRegex = Regex("""file:\s*['"](.*?)['"],label:\s*['"](.*?)['"]""") + private val qualityRegex = Regex("""\d+x(\d+) .*""") + + override suspend fun getUrl( + url: String, + referer: String?, + subtitleCallback: (SubtitleFile) -> Unit, + callback: (ExtractorLink) -> Unit + ) { + val resp = app.get(url).text + + for (sourceMatch in sourceRegex.findAll(resp)) { + val label = sourceMatch.groupValues[2] + + callback.invoke( + newExtractorLink( + name, + "$name ${label.split(" ", limit = 2).getOrNull(1)}", + sourceMatch.groupValues[1], // streams are usually in mp4 format + ) { + this.referer = url + this.quality = + qualityRegex.find(label)?.groupValues?.getOrNull(1)?.toIntOrNull() + ?: Qualities.Unknown.value + } + ) + } + } +} + +class BgwpCC : BigwarpIO() { + override var mainUrl = "https://bgwp.cc" +} + +class BigwarpArt : BigwarpIO() { + override var mainUrl = "https://bigwarp.art" +} diff --git a/library/src/commonMain/kotlin/com/lagradost/cloudstream3/utils/ExtractorApi.kt b/library/src/commonMain/kotlin/com/lagradost/cloudstream3/utils/ExtractorApi.kt index ce92fad20..237850f98 100644 --- a/library/src/commonMain/kotlin/com/lagradost/cloudstream3/utils/ExtractorApi.kt +++ b/library/src/commonMain/kotlin/com/lagradost/cloudstream3/utils/ExtractorApi.kt @@ -16,6 +16,9 @@ import com.lagradost.cloudstream3.extractors.Asnwish import com.lagradost.cloudstream3.extractors.Awish import com.lagradost.cloudstream3.extractors.Beastx import com.lagradost.cloudstream3.extractors.Bestx +import com.lagradost.cloudstream3.extractors.BgwpCC +import com.lagradost.cloudstream3.extractors.BigwarpArt +import com.lagradost.cloudstream3.extractors.BigwarpIO import com.lagradost.cloudstream3.extractors.Blogger import com.lagradost.cloudstream3.extractors.Boltx import com.lagradost.cloudstream3.extractors.Boosterx @@ -1146,6 +1149,9 @@ val extractorApis: MutableList = arrayListOf( Lulustream1(), Lulustream2(), StreamWishExtractor(), + BigwarpIO(), + BigwarpArt(), + BgwpCC(), WishembedPro(), CdnwishCom(), FlaswishCom(),