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:
Stormunblessed 2023-02-27 14:05:42 -06:00 committed by GitHub
parent e5834d485b
commit d6df24eff2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 21 additions and 25 deletions

View File

@ -1,13 +1,15 @@
package com.lagradost.cloudstream3.extractors
import com.fasterxml.jackson.annotation.JsonProperty
import com.lagradost.cloudstream3.SubtitleFile
import com.lagradost.cloudstream3.app
import com.lagradost.cloudstream3.utils.*
import com.lagradost.cloudstream3.utils.AppUtils.parseJson
import com.lagradost.cloudstream3.utils.AppUtils.tryParseJson
import java.net.URI
import com.lagradost.cloudstream3.utils.M3u8Helper.Companion.generateM3u8
class Ztreamhub : Filesim() {
override val mainUrl: String = "https://ztreamhub.com" //Here 'cause works
override val name = "Zstreamhub"
}
class FileMoon : Filesim() {
override val mainUrl = "https://filemoon.to"
override val name = "FileMoon"
@ -29,34 +31,27 @@ open class Filesim : ExtractorApi() {
subtitleCallback: (SubtitleFile) -> Unit,
callback: (ExtractorLink) -> Unit
) {
with(app.get(url).document) {
this.select("script").forEach { script ->
if (script.data().contains("eval(function(p,a,c,k,e,d)")) {
val data = getAndUnpack(script.data())
val foundData = Regex("""sources:\[(.*?)]""").find(data)?.groupValues?.get(1) ?: return@forEach
val fixedData = foundData.replace("file:", """"file":""")
parseJson<List<ResponseSource>>("[$fixedData]").forEach {
callback.invoke(
ExtractorLink(
name,
name,
it.file,
"$mainUrl/",
Qualities.Unknown.value,
URI(it.file).path.endsWith(".m3u8")
)
)
}
val response = app.get(url, referer = mainUrl).document
response.select("script[type=text/javascript]").map { script ->
if (script.data().contains(Regex("eval\\(function\\(p,a,c,k,e,[rd]"))) {
val unpackedscript = getAndUnpack(script.data())
val m3u8Regex = Regex("file.\\\"(.*?m3u8.*?)\\\"")
val m3u8 = m3u8Regex.find(unpackedscript)?.destructured?.component1() ?: ""
if (m3u8.isNotEmpty()) {
generateM3u8(
name,
m3u8,
mainUrl
).forEach(callback)
}
}
}
}
private data class ResponseSource(
/* private data class ResponseSource(
@JsonProperty("file") val file: String,
@JsonProperty("type") val type: String?,
@JsonProperty("label") val label: String?
)
) */
}

View File

@ -370,6 +370,7 @@ val extractorApis: MutableList<ExtractorApi> = arrayListOf(
Cda(),
Dailymotion(),
ByteShare(),
Ztreamhub()
)