From e3681935de2c70e3c07fde1a571c1de2d5bdc55a Mon Sep 17 00:00:00 2001 From: Olivia Date: Tue, 30 Jan 2024 23:08:30 +0700 Subject: [PATCH] close #547 --- Moflix/build.gradle.kts | 4 +- .../src/main/kotlin/com/hexated/Cineclix.kt | 14 ++++++ .../src/main/kotlin/com/hexated/Extractors.kt | 44 ++++++++++++++++++- Moflix/src/main/kotlin/com/hexated/Moflix.kt | 16 +++---- .../main/kotlin/com/hexated/MoflixPlugin.kt | 2 + 5 files changed, 69 insertions(+), 11 deletions(-) create mode 100644 Moflix/src/main/kotlin/com/hexated/Cineclix.kt diff --git a/Moflix/build.gradle.kts b/Moflix/build.gradle.kts index cc650970..738f38de 100644 --- a/Moflix/build.gradle.kts +++ b/Moflix/build.gradle.kts @@ -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") /** diff --git a/Moflix/src/main/kotlin/com/hexated/Cineclix.kt b/Moflix/src/main/kotlin/com/hexated/Cineclix.kt new file mode 100644 index 00000000..59a65732 --- /dev/null +++ b/Moflix/src/main/kotlin/com/hexated/Cineclix.kt @@ -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", + ) +} \ No newline at end of file diff --git a/Moflix/src/main/kotlin/com/hexated/Extractors.kt b/Moflix/src/main/kotlin/com/hexated/Extractors.kt index 7100f24f..e2a67320 100644 --- a/Moflix/src/main/kotlin/com/hexated/Extractors.kt +++ b/Moflix/src/main/kotlin/com/hexated/Extractors.kt @@ -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" @@ -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, @@ -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("").substringBefore("") + )?.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}" + } + } + } \ No newline at end of file diff --git a/Moflix/src/main/kotlin/com/hexated/Moflix.kt b/Moflix/src/main/kotlin/com/hexated/Moflix.kt index 247950d3..a8547ae8 100644 --- a/Moflix/src/main/kotlin/com/hexated/Moflix.kt +++ b/Moflix/src/main/kotlin/com/hexated/Moflix.kt @@ -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" @@ -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()?.pagination?.data?.mapNotNull { it.toSearchResponse() } ?: emptyList() @@ -194,7 +194,7 @@ class Moflix : MainAPI() { "$mainUrl/", subtitleCallback, callback, - iframe.quality?.filter { it.isDigit() }?.toIntOrNull() + iframe.quality?.substringBefore("/")?.filter { it.isDigit() }?.toIntOrNull() ) } diff --git a/Moflix/src/main/kotlin/com/hexated/MoflixPlugin.kt b/Moflix/src/main/kotlin/com/hexated/MoflixPlugin.kt index 7e15db0a..42ade584 100644 --- a/Moflix/src/main/kotlin/com/hexated/MoflixPlugin.kt +++ b/Moflix/src/main/kotlin/com/hexated/MoflixPlugin.kt @@ -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()) } } \ No newline at end of file