mirror of
https://github.com/hexated/cloudstream-extensions-hexated.git
synced 2024-08-15 00:03:22 +00:00
close #547
This commit is contained in:
parent
5982deb684
commit
e3681935de
5 changed files with 69 additions and 11 deletions
|
@ -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")
|
||||
|
||||
/**
|
||||
|
|
14
Moflix/src/main/kotlin/com/hexated/Cineclix.kt
Normal file
14
Moflix/src/main/kotlin/com/hexated/Cineclix.kt
Normal file
|
@ -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",
|
||||
)
|
||||
}
|
|
@ -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("<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}"
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -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<Responses>()?.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()
|
||||
)
|
||||
}
|
||||
|
||||
|
|
|
@ -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())
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue