Skip to content

Commit

Permalink
close #547
Browse files Browse the repository at this point in the history
  • Loading branch information
olivia committed Jan 30, 2024
1 parent 5982deb commit e368193
Show file tree
Hide file tree
Showing 5 changed files with 69 additions and 11 deletions.
4 changes: 2 additions & 2 deletions Moflix/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
// use an integer for version numbers
version = 2
version = 3


cloudstream {
language = "de"
// All of these properties are optional, you can safely remove them

// description = "Lorem Ipsum"
description = "Include: Cineclix"
authors = listOf("Hexated")

/**
Expand Down
14 changes: 14 additions & 0 deletions Moflix/src/main/kotlin/com/hexated/Cineclix.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package com.hexated

import com.lagradost.cloudstream3.mainPageOf

class Cineclix : Moflix() {
override var name = "Cineclix"
override var mainUrl = "https://cineclix.in"
override val mainPage = mainPageOf(
"77/created_at:desc" to "Neuerscheinungen Filme",
"82/created_at:desc" to "Neuerscheinungen Serien",
"77/popularity:desc" to "Filme",
"82/popularity:desc" to "Serien",
)
}
44 changes: 43 additions & 1 deletion Moflix/src/main/kotlin/com/hexated/Extractors.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package com.hexated
import com.lagradost.cloudstream3.SubtitleFile
import com.lagradost.cloudstream3.app
import com.lagradost.cloudstream3.utils.*
import java.net.URI

class MoflixLink : MoflixClick() {
override val name = "MoflixLink"
Expand Down Expand Up @@ -36,7 +37,8 @@ open class MoflixClick : ExtractorApi() {
} else {
response.document.selectFirst("script:containsData(sources:)")?.data()
}
val m3u8 = Regex("file:\\s*\"(.*?m3u8.*?)\"").find(script ?: return)?.groupValues?.getOrNull(1)
val m3u8 =
Regex("file:\\s*\"(.*?m3u8.*?)\"").find(script ?: return)?.groupValues?.getOrNull(1)
callback.invoke(
ExtractorLink(
name,
Expand All @@ -49,4 +51,44 @@ open class MoflixClick : ExtractorApi() {
)
}

}

open class Doodstream : ExtractorApi() {
override val name = "Doodstream"
override val mainUrl = "https://doodstream.com"
override val requiresReferer = false

override suspend fun getUrl(
url: String,
referer: String?,
subtitleCallback: (SubtitleFile) -> Unit,
callback: (ExtractorLink) -> Unit
) {
val req = app.get(url)
val host = getBaseUrl(req.url)
val response0 = req.text
val md5 = host + (Regex("/pass_md5/[^']*").find(response0)?.value ?: return)
val trueUrl =
app.get(md5, referer = req.url).text + "qWMG3yc6F5?token=" + md5.substringAfterLast("/")
val quality = Regex("\\d{3,4}p").find(
response0.substringAfter("<title>").substringBefore("</title>")
)?.groupValues?.get(0)
callback.invoke(
ExtractorLink(
this.name,
this.name,
trueUrl,
mainUrl,
getQualityFromName(quality),
false
)
)
}

private fun getBaseUrl(url: String): String {
return URI(url).let {
"${it.scheme}://${it.host}"
}
}

}
16 changes: 8 additions & 8 deletions Moflix/src/main/kotlin/com/hexated/Moflix.kt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import com.lagradost.cloudstream3.utils.AppUtils.toJson
import org.jsoup.Jsoup
import kotlin.math.roundToInt

class Moflix : MainAPI() {
open class Moflix : MainAPI() {
override var name = "Moflix"
override var mainUrl = "https://moflix-stream.xyz"
override var lang = "de"
Expand All @@ -36,16 +36,16 @@ class Moflix : MainAPI() {
}

override val mainPage = mainPageOf(
"351" to "Kürzlich hinzugefügt",
"345" to "Movie-Datenbank",
"352" to "Angesagte Serien",
"358" to "Kinder & Familien",
"351/channelables.order:asc" to "Kürzlich hinzugefügt",
"345/popularity:desc" to "Movie-Datenbank",
"352/channelables.order:asc" to "Angesagte Serien",
"358/channelables.order:asc" to "Kinder & Familien",
)

override suspend fun getMainPage(page: Int, request: MainPageRequest): HomePageResponse {
val order = if (request.data == "345") "popularity:desc" else "channelables.order:asc"
val query = request.data.split("/")
val home = app.get(
"$mainUrl/api/v1/channel/${request.data}?returnContentOnly=true&restriction=&order=$order&paginate=simple&perPage=50&query=&page=$page",
"$mainUrl/api/v1/channel/${query.first()}?returnContentOnly=true&restriction=&order=${query.last()}&paginate=simple&perPage=50&query=&page=$page",
referer = "$mainUrl/"
).parsedSafe<Responses>()?.pagination?.data?.mapNotNull { it.toSearchResponse() }
?: emptyList()
Expand Down Expand Up @@ -194,7 +194,7 @@ class Moflix : MainAPI() {
"$mainUrl/",
subtitleCallback,
callback,
iframe.quality?.filter { it.isDigit() }?.toIntOrNull()
iframe.quality?.substringBefore("/")?.filter { it.isDigit() }?.toIntOrNull()
)
}

Expand Down
2 changes: 2 additions & 0 deletions Moflix/src/main/kotlin/com/hexated/MoflixPlugin.kt
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,11 @@ class MoflixPlugin: Plugin() {
override fun load(context: Context) {
// All providers should be added in this manner. Please don't edit the providers list directly.
registerMainAPI(Moflix())
registerMainAPI(Cineclix())
registerExtractorAPI(MoflixClick())
registerExtractorAPI(Highstream())
registerExtractorAPI(MoflixFans())
registerExtractorAPI(MoflixLink())
registerExtractorAPI(Doodstream())
}
}

0 comments on commit e368193

Please sign in to comment.