Skip to content

Commit 560858e

Browse files
committed
Merge remote-tracking branch 'origin/master'
2 parents 5271567 + 2129c2f commit 560858e

File tree

2 files changed

+45
-0
lines changed

2 files changed

+45
-0
lines changed
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
package com.lagradost.cloudstream3.extractors
2+
3+
import com.fasterxml.jackson.annotation.JsonProperty
4+
import com.lagradost.cloudstream3.SubtitleFile
5+
import com.lagradost.cloudstream3.app
6+
import com.lagradost.cloudstream3.utils.AppUtils.parseJson
7+
import com.lagradost.cloudstream3.utils.ExtractorApi
8+
import com.lagradost.cloudstream3.utils.ExtractorLink
9+
import com.lagradost.cloudstream3.utils.M3u8Helper
10+
11+
open class StreamEmbed : ExtractorApi() {
12+
override var name = "StreamEmbed"
13+
override var mainUrl = "https://watch.gxplayer.xyz"
14+
override val requiresReferer = true
15+
16+
override suspend fun getUrl(
17+
url: String,
18+
referer: String?,
19+
subtitleCallback: (SubtitleFile) -> Unit,
20+
callback: (ExtractorLink) -> Unit
21+
) {
22+
val jsonString = app.get(url, referer = mainUrl).text
23+
.substringAfter("var video = ").substringBefore(";")
24+
val video = parseJson<Details>(jsonString)
25+
26+
M3u8Helper.generateM3u8(
27+
this.name,
28+
"$mainUrl/m3u8/${video.uid}/${video.md5}/master.txt?s=1&id=${video.id}&cache=${video.status}",
29+
referer = "$mainUrl/",
30+
).forEach(callback)
31+
}
32+
33+
private data class Details(
34+
@JsonProperty("id") val id: String,
35+
@JsonProperty("uid") val uid: String,
36+
@JsonProperty("slug") val slug: String,
37+
@JsonProperty("title") val title: String,
38+
@JsonProperty("quality") val quality: String,
39+
@JsonProperty("type") val type: String,
40+
@JsonProperty("status") val status: String,
41+
@JsonProperty("md5") val md5: String,
42+
)
43+
}

library/src/commonMain/kotlin/com/lagradost/cloudstream3/utils/ExtractorApi.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,7 @@ import com.lagradost.cloudstream3.extractors.Smoothpre
191191
import com.lagradost.cloudstream3.extractors.Sobreatsesuyp
192192
import com.lagradost.cloudstream3.extractors.Solidfiles
193193
import com.lagradost.cloudstream3.extractors.Ssbstream
194+
import com.lagradost.cloudstream3.extractors.StreamEmbed
194195
import com.lagradost.cloudstream3.extractors.StreamM4u
195196
import com.lagradost.cloudstream3.extractors.StreamSB
196197
import com.lagradost.cloudstream3.extractors.StreamSB1
@@ -1173,6 +1174,7 @@ val extractorApis: MutableList<ExtractorApi> = arrayListOf(
11731174
SfastwishCom(),
11741175
Playerwish(),
11751176
Vidnest(),
1177+
StreamEmbed(),
11761178
EmturbovidExtractor(),
11771179
Vtbe(),
11781180
EPlayExtractor(),

0 commit comments

Comments
 (0)