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
4 changes: 0 additions & 4 deletions library/api/jvm/library.api
Original file line number Diff line number Diff line change
Expand Up @@ -8072,8 +8072,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 +8090,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
@@ -0,0 +1,86 @@
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.ExtractorApi
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 : ExtractorApi() {
override var name = "StreamRuby"
override open var mainUrl = "https://rubyvidhub.com"
override val requiresReferer = true

override suspend fun getUrl(
url: String,
referer: String?,
subtitleCallback: (SubtitleFile) -> Unit,
callback: (ExtractorLink) -> Unit
) {
val embedUrl = url.trim().trimEnd('/')
val fileCode = embedUrl.substringAfterLast("/")
.removeSuffix(".html")
.substringAfterLast("-")
if (fileCode.isBlank()) return

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

val dlText = 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) {
return
}

val unpacked = JsUnpacker(dlText).unpack() ?: dlText

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