Skip to content

Commit

Permalink
sora: fix m4uhd
Browse files Browse the repository at this point in the history
  • Loading branch information
samantha committed Feb 29, 2024
1 parent 179b268 commit c51cfb4
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 52 deletions.
2 changes: 1 addition & 1 deletion SoraStream/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import org.jetbrains.kotlin.konan.properties.Properties

// use an integer for version numbers
version = 225
version = 226

android {
defaultConfig {
Expand Down
56 changes: 8 additions & 48 deletions SoraStream/src/main/kotlin/com/hexated/SoraExtractor.kt
Original file line number Diff line number Diff line change
Expand Up @@ -202,48 +202,6 @@ 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 {
val iframe = app.get(base64Decode(it.attr("data-src"))).document.selectFirst("iframe")
?.attr("src") ?: return@apmap
loadExtractor(iframe, "$directUrl/", subtitleCallback) { link ->
when {
link.name == "Bestx" && link.quality == Qualities.Unknown.value -> {
callback.invoke(
ExtractorLink(
"Moviefiction",
"Moviefiction",
link.url,
link.referer,
Qualities.P1080.value,
link.type,
link.headers,
link.extractorData
)
)
}
link.name != "Bestx" -> {
callback.invoke(link)
}
}
}
}
}

suspend fun invokeAoneroom(
title: String? = null,
year: Int? = null,
Expand Down Expand Up @@ -1377,14 +1335,16 @@ object SoraExtractor : SoraStream() {
) {
val slugTitle = title?.createSlug()
val (seasonSlug, episodeSlug) = getEpisodeSlug(season, episode)
val req = app.get("$m4uhdAPI/search/$slugTitle.html", timeout = 20)
val req = app.get("$m4uhdAPI/search/$slugTitle", timeout = 20)
val referer = getBaseUrl(req.url)

val media = req.document.select("div.row div.item > a").map { it.attr("href") }
val mediaUrl = if(media.size == 1) {
val media = req.document.select("div.row div.item a").map { it.attr("href") }
val mediaUrl = if (media.size == 1) {
media.first()
} else {
media.find { it.contains("-$slugTitle-") && it.contains("-$year-") }
media.find {
if(season == null) it.startsWith("movies/$slugTitle-$year.") else it.startsWith("tv-series/$slugTitle-$year.")
}
}

val link = fixUrl(mediaUrl ?: return, referer)
Expand All @@ -1398,7 +1358,7 @@ object SoraExtractor : SoraStream() {
doc.select("div.le-server span").map { it.attr("data") }
} else {
val idepisode =
doc.selectFirst("div.season > p:matches((?i)S$seasonSlug-E$episodeSlug) button")
doc.selectFirst("button[class=episode]:matches(S$seasonSlug-E$episodeSlug)")
?.attr("idepisode")
?: return
val requestEmbed = app.post(
Expand Down Expand Up @@ -2420,7 +2380,7 @@ object SoraExtractor : SoraStream() {
season: Int? = null,
episode: Int? = null,
callback: (ExtractorLink) -> Unit,
host: String = "https://dozzlegram-duj-i-280.site",
host: String = "https://guinsters286nedril.com",
) {
val res = app.get(
"$host/play/$imdbId",
Expand Down
4 changes: 2 additions & 2 deletions SoraStream/src/main/kotlin/com/hexated/SoraStream.kt
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ open class SoraStream : TmdbProvider() {
const val crunchyrollAPI = "https://beta-api.crunchyroll.com"
const val kissKhAPI = "https://kisskh.co"
const val lingAPI = "https://ling-online.net"
const val m4uhdAPI = "https://m4umv.org"
const val m4uhdAPI = "https://ww1.streamm4u.ws"
const val rStreamAPI = "https://remotestream.cc"
const val flixonAPI = "https://flixon.lol"
const val smashyStreamAPI = "https://embed.smashystream.com"
Expand All @@ -115,9 +115,9 @@ open class SoraStream : TmdbProvider() {
const val mMoviesAPI = "https://multimovies.uno"
const val watchCartoonAPI = "https://www1.watchcartoononline.bz"
const val moflixAPI = "https://moflix-stream.xyz"
const val moviefictionAPI = "https://moviefiction.com"
const val zoechipAPI = "https://zoechip.org"
const val nepuAPI = "https://nepu.to"

const val fdMoviesAPI = "https://freedrivemovie.com"
const val uhdmoviesAPI = "https://uhdmovies.asia"
const val hdmovies4uAPI = "https://hdmovies4u.day"
Expand Down
2 changes: 1 addition & 1 deletion settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ rootProject.name = "CloudstreamPlugins"

// This file sets what projects are included. All new projects should get automatically included unless specified in "disabled" variable.

val disabled = listOf<String>("Animixplay","Kickassanime")
val disabled = listOf<String>("Animixplay","Kickassanime","Hdfilmcehennemi")

File(rootDir, ".").eachDir { dir ->
if (!disabled.contains(dir.name) && File(dir, "build.gradle.kts").exists()) {
Expand Down

0 comments on commit c51cfb4

Please sign in to comment.