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

@ -0,0 +1,12 @@
version = 1
cloudstream {
description = "This is required to be downloaded."
authors = listOf( "ImZaw" )
language = "ar"
status = 1
tvTypes = listOf( "TvSeries" , "Movie" , "Anime" , "AsianDrama" )
}

View file

@ -0,0 +1,2 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest package="com.extractors"/>

View file

@ -0,0 +1,22 @@
package com.extractors
import com.lagradost.cloudstream3.plugins.CloudstreamPlugin
import com.lagradost.cloudstream3.plugins.Plugin
import android.content.Context
@CloudstreamPlugin
class ExtractorsPlugin: Plugin() {
override fun load(context: Context) {
registerExtractorAPI(VidHDJW())
registerExtractorAPI(VidHD())
registerExtractorAPI(GoStream())
registerExtractorAPI(MyVid())
registerExtractorAPI(Vidshar())
registerExtractorAPI(Vadbam())
registerExtractorAPI(Vidbom())
registerExtractorAPI(Govad())
registerExtractorAPI(Moshahda())
registerExtractorAPI(VoeSx())
registerExtractorAPI(LinkBox())
registerExtractorAPI(Vidmoly())
}
}

View file

@ -0,0 +1,33 @@
package com.extractors
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

@ -0,0 +1,53 @@
package com.extractors
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

@ -0,0 +1,71 @@
package com.extractors
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"
}
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

@ -0,0 +1,58 @@
package com.extractors
import com.fasterxml.jackson.annotation.JsonProperty
import com.lagradost.cloudstream3.apmap
import com.lagradost.cloudstream3.utils.ExtractorApi
import com.lagradost.cloudstream3.utils.ExtractorLink
import com.lagradost.cloudstream3.app
import com.lagradost.cloudstream3.utils.Qualities
import java.net.URI
open class LinkBox : ExtractorApi() {
override val name = "LinkBox"
override val mainUrl = "https://www.linkbox.to"
override val requiresReferer = false
data class LinkBox (
@JsonProperty("data" ) var data : Data? = Data(),
)
data class Data (
@JsonProperty("itemInfo" ) var itemInfo : ItemInfo? = ItemInfo(),
)
data class ItemInfo (
@JsonProperty("resolutionList" ) var resolutionList : ArrayList<ResolutionList> = arrayListOf(),
)
data class ResolutionList (
@JsonProperty("resolution" ) var resolution : String? = null,
@JsonProperty("size" ) var size : Double? = null,
@JsonProperty("sub_type" ) var subType : String? = null,
@JsonProperty("url" ) var url : String? = null,
)
private fun bytesToHumanReadableSize(bytes: Double) = when {
bytes >= 1 shl 30 -> "%.1f GB".format(bytes / (1 shl 30))
bytes >= 1 shl 20 -> "%.1f MB".format(bytes / (1 shl 20))
bytes >= 1 shl 10 -> "%.0f kB".format(bytes / (1 shl 10))
else -> "$bytes bytes"
}
override suspend fun getUrl(url: String, referer: String?): List<ExtractorLink> {
println("LinkBox extractor started")
val sources = mutableListOf<ExtractorLink>()
val apiUrl = "https://" + URI(url).host + "/api/file/detail?itemId=" + url.substringAfter("/file/")
val json = app.get(apiUrl).parsed<LinkBox>()
json.data?.itemInfo?.resolutionList?.forEach {
sources.add(ExtractorLink(
this.name,
"LinkBox " + bytesToHumanReadableSize(it.size ?: 0.0),
it.url ?: return@forEach,
mainUrl,
it.resolution?.replace("p","")?.toInt() ?: Qualities.Unknown.value,
false
))
}
println(sources)
return sources
}
}

View file

@ -0,0 +1,39 @@
package com.extractors
import com.lagradost.cloudstream3.utils.ExtractorApi
import com.lagradost.cloudstream3.utils.ExtractorLink
import com.lagradost.cloudstream3.utils.Qualities
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

@ -0,0 +1,32 @@
package com.extractors
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 MyVid : ExtractorApi() {
override val name = "MyVid"
override val mainUrl = "https://myviid.com"
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("body > script:nth-child(2)").html() ?: ""
val a = text.substringAfter("||||").substringBefore("'.split").split("|")
val link = "${a[7]}://${a[24]}.${a[6]}.${a[5]}/${a[83]}/v.${a[82]}"
if (link.isNotBlank()) {
sources.add(
ExtractorLink(
name = name,
source = name,
url = link,
isM3u8 = false,
quality = "${a[80]}".replace("p","").toInt() ?: Qualities.Unknown.value,
referer = "$mainUrl/"
)
)
}
return sources
}
}

View file

@ -0,0 +1,46 @@
package com.extractors
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
}
}

View file

@ -0,0 +1,25 @@
package com.extractors
import com.lagradost.cloudstream3.utils.ExtractorApi
import com.lagradost.cloudstream3.utils.ExtractorLink
import com.lagradost.cloudstream3.app
import com.lagradost.cloudstream3.utils.Qualities
open class Vidmoly : ExtractorApi() {
override val name = "Vidmoly"
override val mainUrl = "https://vidmoly.to"
override val requiresReferer = false
override suspend fun getUrl(url: String, referer: String?): List<ExtractorLink> {
val doc = app.get(url).document
val m3u8 = doc.select("body > script").map { it.data() }.first { it.contains("sources") }.substringAfter("sources: [{file:\"").substringBefore("\"}],")
return mutableListOf(ExtractorLink(
this.name,
"Vidmoly",
m3u8,
referer ?: mainUrl,
Qualities.Unknown.value,
m3u8.contains(".m3u8")
))
}
}

View file

@ -0,0 +1,33 @@
package com.extractors
import com.lagradost.cloudstream3.utils.ExtractorApi
import com.lagradost.cloudstream3.utils.ExtractorLink
import com.lagradost.cloudstream3.app
open class VoeSx : ExtractorApi() {
override val name = "VoeSx"
override val mainUrl = "https://voe.sx"
override val requiresReferer = false
override suspend fun getUrl(url: String, referer: String?): List<ExtractorLink> {
val doc = app.get(url).document
val script = doc.select("script").map { it.data() }.first { it.contains("sources") }
val m3u8 = script.substringAfter("'hls': '").substringBefore("'")
val mp4 = script.substringAfter("'mp4': '").substringBefore("'")
val quality = script.substringAfter("'video_height': ").substringBefore(",").toInt()
return mutableListOf(ExtractorLink(
this.name,
"Voe.sx m3u8",
m3u8,
referer ?: mainUrl,
quality,
true
), ExtractorLink(
this.name,
"Voe.sx mp4",
mp4,
referer ?: mainUrl,
quality,
))
}
}