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,7 +1,6 @@
version = 7
cloudstream {
description = ""
authors = listOf( "ImZaw" )
language = "ar"

View file

@ -1,63 +0,0 @@
package com.shahid4u
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
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("'", "\"")
} else if (script.data().contains("otakudesu('")) {
script.data().substringAfter("otakudesu('")
.substringBefore("');")
} else {
null
}
}
tryParseJson<List<ResponseSource>>("$data")?.map {
sources.add(
ExtractorLink(
name,
name,
it.file,
referer = url,
quality = getQualityFromName(
Regex("(\\d{3,4}p)").find(it.file)?.groupValues?.get(
1
)
)
)
)
}
}
return sources
}
private data class ResponseSource(
@JsonProperty("file") val file: String,
@JsonProperty("type") val type: String?,
@JsonProperty("label") val label: String?
)
}
class VidHDJW : JWPlayer() {
override val name = "VidHD"
override val mainUrl = "https://vidhd.fun"
}
class Vidbom : JWPlayer() {
override val name = "Vidbom"
override val mainUrl = "https://vidbom.com"
}

View file

@ -7,8 +7,5 @@ import android.content.Context
class Shahid4uPlugin: Plugin() {
override fun load(context: Context) {
registerMainAPI(Shahid4u())
registerExtractorAPI(VidHDJW())
registerExtractorAPI(VidHD())
registerExtractorAPI(GoStream())
}
}

View file

@ -1,33 +0,0 @@
package com.shahid4u
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 GoStream : ExtractorApi() {
override val name = "GoStream"
override val mainUrl = "https://gostream.pro"
override val requiresReferer = false
override suspend fun getUrl(url: String, referer: String?): List<ExtractorLink> {
val sources = mutableListOf<ExtractorLink>()
val text = app.get(url).document.select("#player_code > script:nth-child(4)").html() ?: ""
val a = text.split("|")
val b = a[0].substring(a[0].lastIndexOf("http"))
val link = "$b://${a[5]}.${a[4]}-${a[3]}.${a[2]}:${a[11]}/d/${a[10]}/${a[9]}.${a[8]}"
if (link.isNotBlank()) {
sources.add(
ExtractorLink(
name = name,
source = name,
url = link,
isM3u8 = false,
quality = Qualities.Unknown.value,
referer = "$mainUrl/"
)
)
}
return sources
}
}

View file

@ -1,46 +0,0 @@
package com.shahid4u
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 VidHD : ExtractorApi() {
override val name = "VidHD"
override val mainUrl = "https://vidhd.fun"
override val requiresReferer = false
private fun String.getIntFromText(): Int? {
return Regex("""\d+""").find(this)?.groupValues?.firstOrNull()?.toIntOrNull()
}
override suspend fun getUrl(url: String, referer: String?): List<ExtractorLink> {
val sources = mutableListOf<ExtractorLink>()
app.get(url).document.select("body > script:nth-child(2)").html().substringAfter("||||").let{ c->
val a = c.split("|")
val b = c.substringAfter("|image|").split("|")
val f = c.substringAfter("|label|").substringBefore("|file|")
val e = "${a[6]}://${a[21]}.e-${a[20]}-${a[19]}.${a[18]}/${b[1]}/v.$f"
val d = e.replace(b[1],b[3])
val links: MutableMap<String, Int?> = mutableMapOf(
e to b[0].getIntFromText(),
d to b[2].getIntFromText(),
)
links.forEach { (watchlink, quality) ->
if(watchlink.isNotBlank()){
sources.add(
ExtractorLink(
name = name,
source = name,
url = watchlink,
isM3u8 = false,
quality = quality ?: Qualities.Unknown.value,
referer = "$mainUrl/"
)
)
}
}
}
return sources
}
}