Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions library/api/jvm/library.api
Original file line number Diff line number Diff line change
Expand Up @@ -3253,10 +3253,13 @@ public final class com/lagradost/cloudstream3/extractors/Linkbox$Responses$Compa

public class com/lagradost/cloudstream3/extractors/LuluStream : com/lagradost/cloudstream3/utils/ExtractorApi {
public fun <init> ()V
protected fun getFileCode (Ljava/lang/String;)Ljava/lang/String;
public fun getMainUrl ()Ljava/lang/String;
public fun getName ()Ljava/lang/String;
protected fun getPlayerScript (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public fun getRequiresReferer ()Z
public fun getUrl (Ljava/lang/String;Ljava/lang/String;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
protected fun parsePlayerScript (Ljava/lang/String;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
}

public final class com/lagradost/cloudstream3/extractors/Lulustream1 : com/lagradost/cloudstream3/extractors/LuluStream {
Expand Down Expand Up @@ -8072,8 +8075,6 @@ public class com/lagradost/cloudstream3/utils/AtomicList : java/util/List, kotli
public fun add (Ljava/lang/Object;)Z
public fun addAll (ILjava/util/Collection;)Z
public fun addAll (Ljava/util/Collection;)Z
public fun addFirst (Ljava/lang/Object;)V
public fun addLast (Ljava/lang/Object;)V
public fun clear ()V
public fun contains (Ljava/lang/Object;)Z
public fun containsAll (Ljava/util/Collection;)Z
Expand All @@ -8092,8 +8093,6 @@ public class com/lagradost/cloudstream3/utils/AtomicList : java/util/List, kotli
public fun remove (I)Ljava/lang/Object;
public fun remove (Ljava/lang/Object;)Z
public fun removeAll (Ljava/util/Collection;)Z
public fun removeFirst ()Ljava/lang/Object;
public fun removeLast ()Ljava/lang/Object;
public fun replaceAll (Ljava/util/function/UnaryOperator;)V
public fun retainAll (Ljava/util/Collection;)Z
public fun set (ILjava/lang/Object;)Ljava/lang/Object;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,30 +22,50 @@ class Lulustream2 : LuluStream() {
}

open class LuluStream : ExtractorApi() {
override val name = "LuluStream"
override val name = "LuluStream"
override val mainUrl = "https://luluvdo.com"
override val requiresReferer = true

override suspend fun getUrl(
protected open fun getFileCode(url: String): String {
return url.substringAfterLast("/")
}

protected open suspend fun getPlayerScript(
fileCode: String,
url: String,
referer: String?,
subtitleCallback: (SubtitleFile) -> Unit,
callback: (ExtractorLink) -> Unit
) {
val filecode = url.substringAfterLast("/")
val postUrl = "$mainUrl/dl"
val post = app.post(
postUrl,
referer: String?
): String {
return app.post(
"$mainUrl/dl",
data = mapOf(
"op" to "embed",
"file_code" to filecode,
"file_code" to fileCode,
"auto" to "1",
"referer" to (referer ?: "")
)
).document
post.selectFirst("script:containsData(vplayer)")?.data()
?.let { script ->
JwPlayerHelper.extractStreamLinks(script, name, mainUrl, callback, subtitleCallback)
}
.selectFirst("script:containsData(vplayer)")
?.data()
.orEmpty()
}

protected open suspend fun parsePlayerScript(
script: String,
subtitleCallback: (SubtitleFile) -> Unit,
callback: (ExtractorLink) -> Unit
) {
JwPlayerHelper.extractStreamLinks(script, name, mainUrl, callback, subtitleCallback)
}

override suspend fun getUrl(
url: String,
referer: String?,
subtitleCallback: (SubtitleFile) -> Unit,
callback: (ExtractorLink) -> Unit
) {
val fileCode = getFileCode(url)
val script = getPlayerScript(fileCode, url, referer)
if (script.isBlank()) return
parsePlayerScript(script, subtitleCallback, callback)
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
package com.lagradost.cloudstream3.extractors

import com.lagradost.cloudstream3.Prerelease
import com.lagradost.cloudstream3.SubtitleFile
import com.lagradost.cloudstream3.USER_AGENT
import com.lagradost.cloudstream3.app
import com.lagradost.cloudstream3.utils.ExtractorLink
import com.lagradost.cloudstream3.utils.ExtractorLinkType
import com.lagradost.cloudstream3.utils.JsUnpacker
import com.lagradost.cloudstream3.utils.Qualities.Unknown
import com.lagradost.cloudstream3.utils.newExtractorLink

@Prerelease
class StreamRubyCom : StreamRuby() {
override var mainUrl = "https://streamruby.com"
}

@Prerelease
open class StreamRuby : LuluStream() {
override var name = "StreamRuby"
override open var mainUrl = "https://rubyvidhub.com"

override fun getFileCode(url: String): String {
return url.trim().trimEnd('/')
.substringAfterLast("/")
.removeSuffix(".html")
.substringAfterLast("-")
}

override suspend fun getPlayerScript(
fileCode: String,
url: String,
referer: String?
): String {
if (fileCode.isBlank()) return ""

val embedUrl = url.trim().trimEnd('/')

try {
app.get(embedUrl, referer = referer ?: mainUrl)
} catch (_: Exception) {
return ""
}

return try {
app.post(
"$mainUrl/dl",
data = mapOf(
"op" to "embed",
"file_code" to fileCode,
"auto" to "1",
"referer" to embedUrl,
),
headers = mapOf("User-Agent" to USER_AGENT, "Referer" to embedUrl),
referer = embedUrl
).text
} catch (_: Exception) {
""
}
}

override suspend fun parsePlayerScript(
script: String,
subtitleCallback: (SubtitleFile) -> Unit,
callback: (ExtractorLink) -> Unit
) {
val unpacked = JsUnpacker(script).unpack() ?: script

val streamUrl = Regex("""file:\s*["']([^"']+\.m3u8[^"']*)["']""")
.find(unpacked)?.groupValues?.get(1)
?: Regex("""file:\s*["']([^"']+)["']""")
.find(unpacked)?.groupValues?.get(1)
?.takeIf { it.contains("/hls") || it.endsWith(".mp4") }

if (streamUrl.isNullOrBlank()) return

callback.invoke(
newExtractorLink(
source = name,
name = name,
url = streamUrl,
type = ExtractorLinkType.M3U8
) {
this.referer = "$mainUrl/"
this.quality = Unknown.value
this.headers = mapOf(
"User-Agent" to USER_AGENT,
"Origin" to mainUrl,
"Referer" to "$mainUrl/"
)
}
)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,8 @@ import com.lagradost.cloudstream3.extractors.Streamhub2
import com.lagradost.cloudstream3.extractors.Streamlare
import com.lagradost.cloudstream3.extractors.StreamoUpload
import com.lagradost.cloudstream3.extractors.Streamplay
import com.lagradost.cloudstream3.extractors.StreamRuby
import com.lagradost.cloudstream3.extractors.StreamRubyCom
import com.lagradost.cloudstream3.extractors.Streamsss
import com.lagradost.cloudstream3.extractors.Streamwish2
import com.lagradost.cloudstream3.extractors.Strwish
Expand Down Expand Up @@ -1346,6 +1348,8 @@ val extractorApis: AtomicMutableList<ExtractorApi> = atomicListOf(
Vids(),
Playmate(),
Hexload(),
StreamRuby(),
StreamRubyCom(),
)


Expand Down