diff --git a/library/src/commonMain/kotlin/com/lagradost/cloudstream3/extractors/GamoVideo.kt b/library/src/commonMain/kotlin/com/lagradost/cloudstream3/extractors/GamoVideo.kt new file mode 100644 index 000000000..11d3e42dc --- /dev/null +++ b/library/src/commonMain/kotlin/com/lagradost/cloudstream3/extractors/GamoVideo.kt @@ -0,0 +1,30 @@ +package com.lagradost.cloudstream3.extractors + +import com.lagradost.cloudstream3.app +import com.lagradost.cloudstream3.utils.* + + +open class GamoVideo : ExtractorApi() { + override val name = "GamoVideo" + override val mainUrl = "https://gamovideo.com" + override val requiresReferer = true + + override suspend fun getUrl( + url: String, + referer: String? + ): List? { + return app.get(url, referer = referer).document.select("script") + .firstOrNull { it.html().contains("sources:") }!!.html().substringAfter("file: \"") + .substringBefore("\",").let { + listOf( + ExtractorLink( + name, + name, + it, + url, + Qualities.Unknown.value, + ) + ) + } + } +} diff --git a/library/src/commonMain/kotlin/com/lagradost/cloudstream3/extractors/MixDrop.kt b/library/src/commonMain/kotlin/com/lagradost/cloudstream3/extractors/MixDrop.kt index cd7e2e26c..60652041c 100644 --- a/library/src/commonMain/kotlin/com/lagradost/cloudstream3/extractors/MixDrop.kt +++ b/library/src/commonMain/kotlin/com/lagradost/cloudstream3/extractors/MixDrop.kt @@ -25,7 +25,7 @@ open class MixDrop : ExtractorApi() { } override suspend fun getUrl(url: String, referer: String?): List? { - with(app.get(url)) { + with(app.get(url.replaceFirst("/f/", "/e/"))) { getAndUnpack(this.text).let { unpackedText -> srcRegex.find(unpackedText)?.groupValues?.get(1)?.let { link -> return listOf( diff --git a/library/src/commonMain/kotlin/com/lagradost/cloudstream3/extractors/StreamTape.kt b/library/src/commonMain/kotlin/com/lagradost/cloudstream3/extractors/StreamTape.kt index 2ee98c652..1b152801c 100644 --- a/library/src/commonMain/kotlin/com/lagradost/cloudstream3/extractors/StreamTape.kt +++ b/library/src/commonMain/kotlin/com/lagradost/cloudstream3/extractors/StreamTape.kt @@ -4,6 +4,7 @@ import com.lagradost.cloudstream3.app import com.lagradost.cloudstream3.utils.ExtractorApi import com.lagradost.cloudstream3.utils.ExtractorLink import com.lagradost.cloudstream3.utils.Qualities +import org.mozilla.javascript.Context class StreamTapeNet : StreamTape() { override var mainUrl = "https://streamtape.net" @@ -13,7 +14,7 @@ class StreamTapeXyz : StreamTape() { override var mainUrl = "https://streamtape.xyz" } -class ShaveTape : StreamTape(){ +class ShaveTape : StreamTape() { override var mainUrl = "https://shavetape.cash" } @@ -22,14 +23,27 @@ open class StreamTape : ExtractorApi() { override var mainUrl = "https://streamtape.com" override val requiresReferer = false - private val linkRegex = - Regex("""'robotlink'\)\.innerHTML = '(.+?)'\+ \('(.+?)'\)""") - override suspend fun getUrl(url: String, referer: String?): List? { with(app.get(url)) { - linkRegex.find(this.text)?.let { - val extractedUrl = - "https:${it.groups[1]!!.value + it.groups[2]!!.value.substring(3)}" + var result = + this.document.select("script").firstOrNull { it.html().contains("botlink').innerHTML") } + ?.html()?.lines()?.firstOrNull{ it.contains("botlink').innerHTML") }?.let { + val scriptContent = + it.substringAfter(").innerHTML").replaceFirst("=", "var url =") + val rhino = Context.enter() + rhino.optimizationLevel = -1 + val scope = rhino.initStandardObjects() + var result = "" + try { + rhino.evaluateString(scope, scriptContent, "url", 1, null) + result = scope.get("url", scope).toString() + }finally { + rhino.close() + } + result + } + if(!result.isNullOrEmpty()){ + val extractedUrl = "https:${result}&stream=1" return listOf( ExtractorLink( name, diff --git a/library/src/commonMain/kotlin/com/lagradost/cloudstream3/extractors/StreamWishExtractor.kt b/library/src/commonMain/kotlin/com/lagradost/cloudstream3/extractors/StreamWishExtractor.kt index 4ddf1a12a..51ad0276e 100644 --- a/library/src/commonMain/kotlin/com/lagradost/cloudstream3/extractors/StreamWishExtractor.kt +++ b/library/src/commonMain/kotlin/com/lagradost/cloudstream3/extractors/StreamWishExtractor.kt @@ -128,6 +128,11 @@ class Wishonly : StreamWishExtractor() { override val mainUrl = "https://wishonly.site" } +class Playerwish : StreamWishExtractor() { + override val name = "Playerwish" + override val mainUrl = "https://playerwish.com" +} + open class StreamWishExtractor : ExtractorApi() { override val name = "Streamwish" override val mainUrl = "https://streamwish.to" diff --git a/library/src/commonMain/kotlin/com/lagradost/cloudstream3/extractors/Vidmoly.kt b/library/src/commonMain/kotlin/com/lagradost/cloudstream3/extractors/Vidmoly.kt index 979fd8c50..6abecf4b1 100644 --- a/library/src/commonMain/kotlin/com/lagradost/cloudstream3/extractors/Vidmoly.kt +++ b/library/src/commonMain/kotlin/com/lagradost/cloudstream3/extractors/Vidmoly.kt @@ -2,9 +2,11 @@ package com.lagradost.cloudstream3.extractors import com.fasterxml.jackson.annotation.JsonProperty import com.lagradost.cloudstream3.SubtitleFile +import com.lagradost.cloudstream3.USER_AGENT import com.lagradost.cloudstream3.app import com.lagradost.cloudstream3.utils.* import com.lagradost.cloudstream3.utils.AppUtils.tryParseJson +import kotlinx.coroutines.delay class Vidmolyme : Vidmoly() { override val mainUrl = "https://vidmoly.me" @@ -26,15 +28,25 @@ open class Vidmoly : ExtractorApi() { callback: (ExtractorLink) -> Unit ) { val headers = mapOf( - "User-Agent" to "Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Mobile Safari/537.36", + "user-agent" to USER_AGENT, "Sec-Fetch-Dest" to "iframe" ) - val script = app.get( - url, - headers = headers, - referer = referer, - ).document.select("script") - .find { it.data().contains("sources:") }?.data() + val newUrl = if(url.contains("/w/")) + url.replaceFirst("/w/", "/embed-")+"-920x360.html" + else url + var script: String? = null; + var attemps = 0 + while (attemps < 10 && script.isNullOrEmpty()){ + attemps++ + script = app.get( + newUrl, + headers = headers, + referer = referer, + ).document.select("script") + .firstOrNull { it.data().contains("sources:") }?.data() + if(script.isNullOrEmpty()) + delay(500) + } val videoData = script?.substringAfter("sources: [") ?.substringBefore("],")?.addMarks("file") val subData = script?.substringAfter("tracks: [")?.substringBefore("]")?.addMarks("file") 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 f8d47eab5..3244f9942 100644 --- a/library/src/commonMain/kotlin/com/lagradost/cloudstream3/utils/ExtractorApi.kt +++ b/library/src/commonMain/kotlin/com/lagradost/cloudstream3/utils/ExtractorApi.kt @@ -283,6 +283,8 @@ import com.lagradost.cloudstream3.extractors.Lulustream3 import com.lagradost.cloudstream3.extractors.Vidguardto3 import com.lagradost.cloudstream3.extractors.Ds2play import com.lagradost.cloudstream3.extractors.Ds2video +import com.lagradost.cloudstream3.extractors.GamoVideo +import com.lagradost.cloudstream3.extractors.Playerwish import com.lagradost.cloudstream3.mvvm.logError import com.lagradost.cloudstream3.mvvm.normalSafeApiCall import kotlinx.coroutines.delay @@ -911,6 +913,7 @@ val extractorApis: MutableList = arrayListOf( Jeniusplay(), StreamoUpload(), + GamoVideo(), Gdriveplayerapi(), Gdriveplayerapp(), Gdriveplayerfun(), @@ -964,6 +967,7 @@ val extractorApis: MutableList = arrayListOf( CdnwishCom(), FlaswishCom(), SfastwishCom(), + Playerwish(), EmturbovidExtractor(), Vtbe(), EPlayExtractor(),