mirror of
https://github.com/recloudstream/cloudstream.git
synced 2024-08-15 01:53:11 +00:00
Fixes on filesim and added filemoon, ztreamhub (#397)
* fix fastream, tomatomatela, and added okrulink * forgot this * sendvid extractor * sendvid extractor * fixes * Filesim fix, added filemoon and ztreamhub
This commit is contained in:
parent
e5834d485b
commit
d6df24eff2
2 changed files with 21 additions and 25 deletions
|
@ -1,13 +1,15 @@
|
||||||
package com.lagradost.cloudstream3.extractors
|
package com.lagradost.cloudstream3.extractors
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonProperty
|
|
||||||
import com.lagradost.cloudstream3.SubtitleFile
|
import com.lagradost.cloudstream3.SubtitleFile
|
||||||
import com.lagradost.cloudstream3.app
|
import com.lagradost.cloudstream3.app
|
||||||
import com.lagradost.cloudstream3.utils.*
|
import com.lagradost.cloudstream3.utils.*
|
||||||
import com.lagradost.cloudstream3.utils.AppUtils.parseJson
|
import com.lagradost.cloudstream3.utils.M3u8Helper.Companion.generateM3u8
|
||||||
import com.lagradost.cloudstream3.utils.AppUtils.tryParseJson
|
|
||||||
import java.net.URI
|
|
||||||
|
|
||||||
|
|
||||||
|
class Ztreamhub : Filesim() {
|
||||||
|
override val mainUrl: String = "https://ztreamhub.com" //Here 'cause works
|
||||||
|
override val name = "Zstreamhub"
|
||||||
|
}
|
||||||
class FileMoon : Filesim() {
|
class FileMoon : Filesim() {
|
||||||
override val mainUrl = "https://filemoon.to"
|
override val mainUrl = "https://filemoon.to"
|
||||||
override val name = "FileMoon"
|
override val name = "FileMoon"
|
||||||
|
@ -29,34 +31,27 @@ open class Filesim : ExtractorApi() {
|
||||||
subtitleCallback: (SubtitleFile) -> Unit,
|
subtitleCallback: (SubtitleFile) -> Unit,
|
||||||
callback: (ExtractorLink) -> Unit
|
callback: (ExtractorLink) -> Unit
|
||||||
) {
|
) {
|
||||||
with(app.get(url).document) {
|
val response = app.get(url, referer = mainUrl).document
|
||||||
this.select("script").forEach { script ->
|
response.select("script[type=text/javascript]").map { script ->
|
||||||
if (script.data().contains("eval(function(p,a,c,k,e,d)")) {
|
if (script.data().contains(Regex("eval\\(function\\(p,a,c,k,e,[rd]"))) {
|
||||||
val data = getAndUnpack(script.data())
|
val unpackedscript = getAndUnpack(script.data())
|
||||||
val foundData = Regex("""sources:\[(.*?)]""").find(data)?.groupValues?.get(1) ?: return@forEach
|
val m3u8Regex = Regex("file.\\\"(.*?m3u8.*?)\\\"")
|
||||||
val fixedData = foundData.replace("file:", """"file":""")
|
val m3u8 = m3u8Regex.find(unpackedscript)?.destructured?.component1() ?: ""
|
||||||
|
if (m3u8.isNotEmpty()) {
|
||||||
parseJson<List<ResponseSource>>("[$fixedData]").forEach {
|
generateM3u8(
|
||||||
callback.invoke(
|
|
||||||
ExtractorLink(
|
|
||||||
name,
|
name,
|
||||||
name,
|
m3u8,
|
||||||
it.file,
|
mainUrl
|
||||||
"$mainUrl/",
|
).forEach(callback)
|
||||||
Qualities.Unknown.value,
|
|
||||||
URI(it.file).path.endsWith(".m3u8")
|
|
||||||
)
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private data class ResponseSource(
|
/* private data class ResponseSource(
|
||||||
@JsonProperty("file") val file: String,
|
@JsonProperty("file") val file: String,
|
||||||
@JsonProperty("type") val type: String?,
|
@JsonProperty("type") val type: String?,
|
||||||
@JsonProperty("label") val label: String?
|
@JsonProperty("label") val label: String?
|
||||||
)
|
) */
|
||||||
|
|
||||||
}
|
}
|
|
@ -370,6 +370,7 @@ val extractorApis: MutableList<ExtractorApi> = arrayListOf(
|
||||||
Cda(),
|
Cda(),
|
||||||
Dailymotion(),
|
Dailymotion(),
|
||||||
ByteShare(),
|
ByteShare(),
|
||||||
|
Ztreamhub()
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue