2
1
Fork 1
mirror of https://github.com/yoyzo/arab synced 2024-08-15 03:15:00 +00:00

So much shit

This commit is contained in:
Zaw 2023-02-16 14:16:57 +03:00
parent a50fcc8cf5
commit 649a4deb27
33 changed files with 181 additions and 226 deletions

View file

@ -1,53 +0,0 @@
package com.movizland
import com.fasterxml.jackson.annotation.JsonProperty
import com.lagradost.cloudstream3.app
import com.lagradost.cloudstream3.utils.AppUtils.tryParseJson
import com.lagradost.cloudstream3.utils.ExtractorApi
import com.lagradost.cloudstream3.utils.ExtractorLink
import com.lagradost.cloudstream3.utils.getQualityFromName
import com.lagradost.cloudstream3.utils.Qualities
open class Govad : ExtractorApi() {
override val name = "Govad"
override val mainUrl = "https://govad.xyz"
override val requiresReferer = false
override suspend fun getUrl(url: String, referer: String?): List<ExtractorLink> {
val sources = mutableListOf<ExtractorLink>()
val regcode = """$mainUrl/embed-(\w+)""".toRegex()
val code = regcode.find(url)?.groupValues?.getOrNull(1)
val link = "$mainUrl/$code"
with(app.get(link).document) {
val data = this.select("script").mapNotNull { script ->
if (script.data().contains("sources: [")) {
script.data().substringAfter("sources: [")
.substringBefore("],").replace("file", "\"file\"").replace("label", "\"label\"").replace("type", "\"type\"")
} else {
null
}
}
tryParseJson<List<ResponseSource>>("$data")?.map {
sources.add(
ExtractorLink(
name,
name,
it.file,
referer = url,
quality = getQualityFromName(it.label) ?: Qualities.Unknown.value,
isM3u8 = if(it.file.endsWith(".m3u8")) true else false
)
)
}
}
return sources
}
private data class ResponseSource(
@JsonProperty("file") val file: String,
@JsonProperty("type") val type: String?,
@JsonProperty("label") val label: String?
)
}

View file

@ -1,59 +0,0 @@
package com.movizland
import com.fasterxml.jackson.annotation.JsonProperty
import com.lagradost.cloudstream3.app
import com.lagradost.cloudstream3.utils.AppUtils.tryParseJson
import com.lagradost.cloudstream3.utils.ExtractorApi
import com.lagradost.cloudstream3.utils.ExtractorLink
import com.lagradost.cloudstream3.utils.getQualityFromName
import com.lagradost.cloudstream3.utils.Qualities
open class JWPlayer : ExtractorApi() {
override val name = "JWPlayer"
override val mainUrl = "https://www.jwplayer.com"
override val requiresReferer = false
override suspend fun getUrl(url: String, referer: String?): List<ExtractorLink>? {
val sources = mutableListOf<ExtractorLink>()
with(app.get(url).document) {
val data = this.select("script").mapNotNull { script ->
if (script.data().contains("sources: [")) {
script.data().substringAfter("sources: [")
.substringBefore("],").replace("file", "\"file\"").replace("label", "\"label\"")
} else {
null
}
}
tryParseJson<List<ResponseSource>>("$data")?.map {
sources.add(
ExtractorLink(
name,
name,
it.file,
referer = url,
quality = getQualityFromName(it.label) ?: Qualities.Unknown.value,
isM3u8 = if(it.file.endsWith(".m3u8")) true else false
)
)
}
}
return sources
}
private data class ResponseSource(
@JsonProperty("file") val file: String,
@JsonProperty("type") val type: String?,
@JsonProperty("label") val label: String?
)
}
class Vadbam : JWPlayer() {
override val name = "Vadbam"
override val mainUrl = "https://vadbam.com/"
}
class Vidshar : JWPlayer() {
override val name = "Vidshar"
override val mainUrl = "https://vidshar.org/"
}

View file

@ -1,40 +0,0 @@
package com.movizland
import com.lagradost.cloudstream3.utils.ExtractorApi
import com.lagradost.cloudstream3.utils.ExtractorLink
import com.lagradost.cloudstream3.utils.Qualities
import com.lagradost.cloudstream3.app
open class Moshahda : ExtractorApi() {
override val name = "Moshahda"
override val mainUrl = "https://moshahda.net"
override val requiresReferer = true
override suspend fun getUrl(url: String, referer: String?): List<ExtractorLink> {
val sources = mutableListOf<ExtractorLink>()
val regcode = """$mainUrl/embed-(\w+)""".toRegex()
val code = regcode.find(url)?.groupValues?.getOrNull(1)
val link = "$mainUrl/$code.html?"
if (code?.length == 12) {
mutableMapOf(
"download_l" to 240,
"download_n" to 360,
"download_h" to 480,
"download_x" to 720,
"download_o" to 1080,
).forEach{ (key,qual) ->
sources.add(
ExtractorLink(
name = name,
source = name,
url = "${link}${key}",
isM3u8 = false,
quality = qual ?: Qualities.Unknown.value,
referer = "$mainUrl/"
)
)
}
}
return sources
}
}

View file

@ -7,9 +7,5 @@ import android.content.Context
class MovizlandPlugin: Plugin() {
override fun load(context: Context) {
registerMainAPI(Movizland())
registerExtractorAPI(Govad())
registerExtractorAPI(Moshahda())
registerExtractorAPI(Vadbam())
registerExtractorAPI(Vidshar())
}
}