Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
olivia committed Jan 30, 2024
1 parent 264a427 commit 38416c1
Show file tree
Hide file tree
Showing 5 changed files with 125 additions and 162 deletions.
39 changes: 36 additions & 3 deletions SoraStream/src/main/kotlin/com/hexated/Extractors.kt
Original file line number Diff line number Diff line change
Expand Up @@ -337,14 +337,15 @@ open class Netembed : ExtractorApi() {
val script = getAndUnpack(response.text)
val m3u8 = Regex("((https:|http:)//.*\\.m3u8)").find(script)?.groupValues?.getOrNull(1) ?: return

M3u8Helper.generateM3u8(this.name, m3u8, "$mainUrl/", ).forEach(callback)
M3u8Helper.generateM3u8(this.name, m3u8, "$mainUrl/").forEach(callback)
}
}

open class Ridoo : ExtractorApi() {
override val name = "Ridoo"
override var mainUrl = "https://ridoo.net"
override val requiresReferer = true
open val defaulQuality = Qualities.P1080.value

override suspend fun getUrl(
url: String,
Expand All @@ -359,20 +360,39 @@ open class Ridoo : ExtractorApi() {
response.document.selectFirst("script:containsData(sources:)")?.data()
}
val m3u8 = Regex("file:\\s*\"(.*?m3u8.*?)\"").find(script ?: return)?.groupValues?.getOrNull(1)
val quality = "qualityLabels.*\"(\\d{3,4})[pP]\"".toRegex().find(script)?.groupValues?.get(1)
callback.invoke(
ExtractorLink(
this.name,
this.name,
m3u8 ?: return,
mainUrl,
Qualities.P1080.value,
quality?.toIntOrNull() ?: defaulQuality,
INFER_TYPE
)
)
}

}

open class Gdmirrorbot : ExtractorApi() {
override val name = "Gdmirrorbot"
override val mainUrl = "https://gdmirrorbot.nl"
override val requiresReferer = true

override suspend fun getUrl(
url: String,
referer: String?,
subtitleCallback: (SubtitleFile) -> Unit,
callback: (ExtractorLink) -> Unit
) {
app.get(url, referer = referer).document.select("ul#videoLinks li").apmap {
loadExtractor(it.attr("data-link"), "$mainUrl/", subtitleCallback, callback)
}
}

}

open class Streamvid : ExtractorApi() {
override val name = "Streamvid"
override val mainUrl = "https://streamvid.net"
Expand Down Expand Up @@ -431,6 +451,18 @@ open class Embedrise : ExtractorApi() {

}

class FilemoonNl : Ridoo() {
override val name = "FilemoonNl"
override var mainUrl = "https://filemoon.nl"
override val defaulQuality = Qualities.Unknown.value
}

class Alions : Ridoo() {
override val name = "Alions"
override var mainUrl = "https://alions.pro"
override val defaulQuality = Qualities.Unknown.value
}

class Streamwish : Filesim() {
override val name = "Streamwish"
override var mainUrl = "https://streamwish.to"
Expand Down Expand Up @@ -484,9 +516,10 @@ class Embedwish : Filesim() {
override val name = "Embedwish"
override var mainUrl = "https://embedwish.com"
}
class Flaswish : Filesim() {
class Flaswish : Ridoo() {
override val name = "Flaswish"
override var mainUrl = "https://flaswish.com"
override val defaulQuality = Qualities.Unknown.value
}

class Comedyshow : Jeniusplay() {
Expand Down
203 changes: 71 additions & 132 deletions SoraStream/src/main/kotlin/com/hexated/SoraExtractor.kt
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,29 @@ object SoraExtractor : SoraStream() {
}
}

suspend fun invokeMoviefiction(
title: String? = null,
season: Int? = null,
episode: Int? = null,
subtitleCallback: (SubtitleFile) -> Unit,
callback: (ExtractorLink) -> Unit
) {
val fixTitle = title?.createSlug()
val url = if (season == null) {
"$moviefictionAPI/movies/$fixTitle"
} else {
"$moviefictionAPI/episode/$fixTitle-${season}x${episode}"
}
val req = app.get(url)
val directUrl = getBaseUrl(req.url)
req.document.select("ul.bx-lst.aa-tbs li a").apmap {
if(!it.select("span.option").text().startsWith("Gdmirrorbot")) return@apmap
val iframe = app.get(base64Decode(it.attr("data-src"))).document.selectFirst("iframe")
?.attr("src")
loadExtractor(iframe ?: return@apmap, "$directUrl/", subtitleCallback, callback)
}
}

suspend fun invokeAoneroom(
title: String? = null,
year: Int? = null,
Expand Down Expand Up @@ -1544,102 +1567,6 @@ object SoraExtractor : SoraStream() {
}
}

suspend fun invokeMoviezAdd(
apiUrl: String? = null,
api: String? = null,
title: String? = null,
year: Int? = null,
season: Int? = null,
episode: Int? = null,
callback: (ExtractorLink) -> Unit
) {
invokeBloginguru(apiUrl, api, title, year, season, episode, callback)
}

suspend fun invokeBollyMaza(
apiUrl: String? = null,
api: String? = null,
title: String? = null,
year: Int? = null,
season: Int? = null,
episode: Int? = null,
callback: (ExtractorLink) -> Unit
) {
invokeBloginguru(apiUrl, api, title, year, season, episode, callback)
}

private suspend fun invokeBloginguru(
apiUrl: String? = null,
api: String? = null,
title: String? = null,
year: Int? = null,
season: Int? = null,
episode: Int? = null,
callback: (ExtractorLink) -> Unit
) {
val fixTitle = title?.createSlug()?.replace("-", " ")
val doc = app.get("$apiUrl/?s=$fixTitle").document

val matchMedia = doc.select("article.mh-loop-item").map {
it.select("a").attr("href") to it.select("a").text()
}.find {
if (season == null) {
it.second.contains(Regex("(?i)($fixTitle)|($title)")) && it.first.contains("$year")
} else {
it.second.contains(Regex("(?i)($fixTitle)|($title)")) && it.second.contains(Regex("(?i)(Season\\s?$season)|(S0?$season)"))
}
}

val mediaLink = app.get(
matchMedia?.first
?: return
).document.selectFirst("a#jake1")?.attr("href")
val detailDoc = app.get(mediaLink ?: return).document
val media = detailDoc.selectFirst("div.entry-content pre span")?.text()?.split("|")
?.map { it.trim() }

val iframe = (if (season == null) {
media?.mapIndexed { index, name ->
detailDoc.select("div.entry-content > h2")[index].selectFirst("a")
?.attr("href") to name
}
} else {
media?.mapIndexed { index, name ->
val linkMedia =
detailDoc.select("div.entry-content > h2")[index].selectFirst("a")?.attr("href")
app.get(
linkMedia
?: return@mapIndexed null
).document.selectFirst("div.entry-content strong:matches((?i)S0?${season}E0?${episode}) a")
?.attr("href") to name
}
})?.filter { it?.first?.startsWith("http") == true }

iframe?.apmap {
val iframeDoc = app.get(it?.first ?: return@apmap).document
val formUrl = iframeDoc.select("form").attr("action")
val formData =
iframeDoc.select("form button").associate { v -> v.attr("name") to v.attr("value") }

val videoUrl = app.post(
formUrl,
data = formData,
referer = it.first
).document.selectFirst("div.d-flex.justify-content-center.flex-wrap a")?.attr("href")
val quality =
Regex("(\\d{3,4})p").find(it.second)?.groupValues?.getOrNull(1)?.toIntOrNull()
val qualityName = it.second.replace("${quality}p", "").trim()

callback.invoke(
ExtractorLink(
"$api", "$api $qualityName", videoUrl
?: return@apmap, "", quality ?: Qualities.Unknown.value
)
)
}

}

suspend fun invokeRStream(
id: Int? = null,
season: Int? = null,
Expand Down Expand Up @@ -1749,6 +1676,7 @@ object SoraExtractor : SoraStream() {
"Player F" -> {
invokeSmashyFfix(it.second, it.first, url, subtitleCallback, callback)
}

"Player SU" -> {
invokeSmashySu(it.second, it.first, url, callback)
}
Expand All @@ -1765,43 +1693,47 @@ object SoraExtractor : SoraStream() {
episode: Int? = null,
callback: (ExtractorLink) -> Unit
) {
val id = (if(season == null) {
val id = (if (season == null) {
"tmdb|movie|$tmdbId"
} else {
"tmdb|series|$tmdbId"
}).let { base64Encode(it.toByteArray()) }

val loaderUrl = "$moflixAPI/api/v1/titles/$id?loader=titlePage"
val url = if(season == null) {
val url = if (season == null) {
loaderUrl
} else {
val mediaId = app.get(loaderUrl, referer = "$moflixAPI/").parsedSafe<MoflixResponse>()?.title?.id
"$moflixAPI/api/v1/titles/$mediaId/seasons/$season/episodes/$episode?loader=episodePage"
}

val res = app.get(url, referer = "$moflixAPI/").parsedSafe<MoflixResponse>()
(res?.episode ?: res?.title)?.videos?.filter { it.category.equals("full", true) }?.apmap { iframe ->
val response = app.get(iframe.src ?: return@apmap, referer = "$moflixAPI/")
val host = getBaseUrl(iframe.src)
val doc = response.document.selectFirst("script:containsData(sources:)")?.data()
val script = if (doc.isNullOrEmpty()) {
getAndUnpack(response.text)
} else {
doc
}
val m3u8 = Regex("file:\\s*\"(.*?m3u8.*?)\"").find(script ?: return@apmap)?.groupValues?.getOrNull(1)
if(m3u8?.haveDub("$host/") == false) return@apmap
callback.invoke(
ExtractorLink(
"Moflix",
"Moflix [${iframe.name}]",
m3u8 ?: return@apmap,
"$host/",
iframe.quality?.filter { it.isDigit() }?.toIntOrNull() ?: Qualities.Unknown.value,
INFER_TYPE
(res?.episode ?: res?.title)?.videos?.filter { it.category.equals("full", true) }
?.apmap { iframe ->
val response = app.get(iframe.src ?: return@apmap, referer = "$moflixAPI/")
val host = getBaseUrl(iframe.src)
val doc = response.document.selectFirst("script:containsData(sources:)")?.data()
val script = if (doc.isNullOrEmpty()) {
getAndUnpack(response.text)
} else {
doc
}
val m3u8 = Regex("file:\\s*\"(.*?m3u8.*?)\"").find(
script ?: return@apmap
)?.groupValues?.getOrNull(1)
if (m3u8?.haveDub("$host/") == false) return@apmap
callback.invoke(
ExtractorLink(
"Moflix",
"Moflix [${iframe.name}]",
m3u8 ?: return@apmap,
"$host/",
iframe.quality?.filter { it.isDigit() }?.toIntOrNull()
?: Qualities.Unknown.value,
INFER_TYPE
)
)
)
}
}

}

Expand Down Expand Up @@ -2270,14 +2202,15 @@ object SoraExtractor : SoraStream() {
subtitleCallback: (SubtitleFile) -> Unit,
callback: (ExtractorLink) -> Unit,
) {
val media = app.get("$cinemaTvAPI/v1/${if (season == null) "movies" else "shows"}?filters[q]=$title")
.parsedSafe<CinemaTvResponse>()?.items?.find {
it.imdb_id?.removePrefix("tt")
.equals(imdbId?.removePrefix("tt")) || (it.title.equals(
title,
true
) && it.year == year)
} ?: return
val media =
app.get("$cinemaTvAPI/v1/${if (season == null) "movies" else "shows"}?filters[q]=$title")
.parsedSafe<CinemaTvResponse>()?.items?.find {
it.imdb_id?.removePrefix("tt")
.equals(imdbId?.removePrefix("tt")) || (it.title.equals(
title,
true
) && it.year == year)
} ?: return

val mediaId = if (season == null) {
media.id_movie
Expand All @@ -2286,7 +2219,9 @@ object SoraExtractor : SoraStream() {
.parsedSafe<CinemaTvResponse>()?.episodes?.find { it.episode == episode && it.season == season }?.id
} ?: return

val sources = app.get("$cinemaTvAPI/v1/${if (season == null) "movies" else "episodes"}/view?expand=streams,subtitles&id=$mediaId").parsedSafe<CinemaTvResponse>()
val sources =
app.get("$cinemaTvAPI/v1/${if (season == null) "movies" else "episodes"}/view?expand=streams,subtitles&id=$mediaId")
.parsedSafe<CinemaTvResponse>()

sources?.streams?.mapKeys { source ->
callback.invoke(
Expand Down Expand Up @@ -2340,11 +2275,13 @@ object SoraExtractor : SoraStream() {
callback: (ExtractorLink) -> Unit,
referer: String = "https://bflix.gs/"
) {
suspend fun String.isSuccess() : Boolean {
suspend fun String.isSuccess(): Boolean {
return app.get(this, referer = referer).isSuccessful
}

val slug = getEpisodeSlug(season, episode)
var url = if (season == null) "$nowTvAPI/$tmdbId.mp4" else "$nowTvAPI/tv/$tmdbId/s${season}e${slug.second}.mp4"
var url =
if (season == null) "$nowTvAPI/$tmdbId.mp4" else "$nowTvAPI/tv/$tmdbId/s${season}e${slug.second}.mp4"
if (!url.isSuccess()) {
url = if (season == null) {
val temp = "$nowTvAPI/$imdbId.mp4"
Expand Down Expand Up @@ -2373,7 +2310,8 @@ object SoraExtractor : SoraStream() {
subtitleCallback: (SubtitleFile) -> Unit,
callback: (ExtractorLink) -> Unit,
) {
val mediaSlug = app.get("$ridomoviesAPI/core/api/search?q=$imdbId").parsedSafe<RidoSearch>()?.data?.items?.find {
val mediaSlug = app.get("$ridomoviesAPI/core/api/search?q=$imdbId")
.parsedSafe<RidoSearch>()?.data?.items?.find {
it.contentable?.tmdbId == tmdbId || it.contentable?.imdbId == imdbId
}?.slug ?: return

Expand All @@ -2382,7 +2320,8 @@ object SoraExtractor : SoraStream() {
app.get(episodeUrl).text.substringAfterLast("""postid\":\"""").substringBefore("""\""")
} ?: mediaSlug

val url = "$ridomoviesAPI/core/api/${if (season == null) "movies" else "episodes"}/$id/videos"
val url =
"$ridomoviesAPI/core/api/${if (season == null) "movies" else "episodes"}/$id/videos"
app.get(url).parsedSafe<RidoResponses>()?.data?.apmap { link ->
val iframe = Jsoup.parse(link.url ?: return@apmap).select("iframe").attr("data-src")
if (iframe.startsWith("https://closeload.top")) {
Expand Down
Loading

0 comments on commit 38416c1

Please sign in to comment.