mirror of
https://github.com/yoyzo/arab
synced 2024-08-15 03:15:00 +00:00
Build a27d8587c0
This commit is contained in:
commit
9ea7b9e5cd
87 changed files with 4255 additions and 0 deletions
14
Shahid4uProvider/build.gradle.kts
Normal file
14
Shahid4uProvider/build.gradle.kts
Normal file
|
@ -0,0 +1,14 @@
|
|||
version = 6
|
||||
|
||||
cloudstream {
|
||||
description = ""
|
||||
authors = listOf( "ImZaw" )
|
||||
|
||||
language = "ar"
|
||||
|
||||
status = 1
|
||||
|
||||
tvTypes = listOf( "TvSeries" , "Movie" , "Anime" , "AsianDrama" )
|
||||
|
||||
iconUrl = "https://www.google.com/s2/favicons?domain=shahid4u.cc&sz=%size%"
|
||||
}
|
2
Shahid4uProvider/src/main/AndroidManifest.xml
Normal file
2
Shahid4uProvider/src/main/AndroidManifest.xml
Normal file
|
@ -0,0 +1,2 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest package="com.shahid4u"/>
|
|
@ -0,0 +1,67 @@
|
|||
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 VidHD : JWPlayer() {
|
||||
override val name = "VidHD"
|
||||
override val mainUrl = "https://vidhd.fun"
|
||||
}
|
||||
class GoStream : JWPlayer() {
|
||||
override val name = "GoStream"
|
||||
override val mainUrl = "https://gostream.pro"
|
||||
}
|
||||
class Vidbom : JWPlayer() {
|
||||
override val name = "Vidbom"
|
||||
override val mainUrl = "https://vidbom.com"
|
||||
}
|
|
@ -0,0 +1,14 @@
|
|||
package com.shahid4u
|
||||
import com.lagradost.cloudstream3.plugins.CloudstreamPlugin
|
||||
import com.lagradost.cloudstream3.plugins.Plugin
|
||||
import android.content.Context
|
||||
|
||||
@CloudstreamPlugin
|
||||
class Shahid4uPlugin: Plugin() {
|
||||
override fun load(context: Context) {
|
||||
registerMainAPI(Shahid4u())
|
||||
registerExtractorAPI(VidHD())
|
||||
registerExtractorAPI(GoStream())
|
||||
registerExtractorAPI(Vidbom())
|
||||
}
|
||||
}
|
|
@ -0,0 +1,177 @@
|
|||
package com.shahid4u
|
||||
|
||||
|
||||
import com.lagradost.cloudstream3.*
|
||||
import com.lagradost.cloudstream3.utils.ExtractorLink
|
||||
import com.lagradost.cloudstream3.utils.loadExtractor
|
||||
import org.jsoup.nodes.Element
|
||||
|
||||
class Shahid4u : MainAPI() {
|
||||
override var lang = "ar"
|
||||
override var mainUrl = "https://shahed4u.vip"
|
||||
override var name = "Shahid4u"
|
||||
override val usesWebView = false
|
||||
override val hasMainPage = true
|
||||
override val supportedTypes =
|
||||
setOf(TvType.TvSeries, TvType.Movie, TvType.Anime, TvType.AsianDrama)
|
||||
|
||||
private fun String.getDomainFromUrl(): String? {
|
||||
return Regex("""^(?:https?:\/\/)?(?:[^@\n]+@)?(?:www\.)?([^:\/\n\?\=]+)""").find(this)?.groupValues?.firstOrNull()
|
||||
}
|
||||
private fun Element.toSearchResponse(): SearchResponse? {
|
||||
val urlElement = select("a.fullClick")
|
||||
val posterUrl =
|
||||
select("a.image img").let { it.attr("data-src").ifEmpty { it.attr("data-image") } }
|
||||
val quality = select("span.quality").text().replace("1080p |-".toRegex(), "")
|
||||
val type =
|
||||
if (select(".category").text().contains("افلام")) TvType.Movie else TvType.TvSeries
|
||||
return MovieSearchResponse(
|
||||
urlElement.attr("title")
|
||||
.replace("برنامج|فيلم|مترجم|اون لاين|مسلسل|مشاهدة|انمي|أنمي".toRegex(), ""),
|
||||
urlElement.attr("href") ?: return null,
|
||||
this@Shahid4u.name,
|
||||
type,
|
||||
posterUrl,
|
||||
null,
|
||||
null,
|
||||
quality = getQualityFromString(quality)
|
||||
)
|
||||
}
|
||||
override val mainPage = mainPageOf(
|
||||
"$mainUrl/movies-3/page/" to "Movies",
|
||||
"$mainUrl/netflix/page/" to "Series & Anime",
|
||||
)
|
||||
|
||||
override suspend fun getMainPage(page: Int, request: MainPageRequest): HomePageResponse {
|
||||
val doc = app.get(request.data + page).document
|
||||
val list = doc.select("div.content-box")
|
||||
.mapNotNull { element ->
|
||||
element.toSearchResponse()
|
||||
}
|
||||
return newHomePageResponse(request.name, list)
|
||||
}
|
||||
|
||||
override suspend fun search(query: String): List<SearchResponse> {
|
||||
val finalResult = arrayListOf<SearchResponse>()
|
||||
listOf(
|
||||
"$mainUrl/?s=$query&category=&type=movie",
|
||||
"$mainUrl/?s=$query&type=series"
|
||||
).apmap { url ->
|
||||
app.get(url).document.select("div.content-box").mapNotNull {
|
||||
finalResult.add(it.toSearchResponse() ?: return@mapNotNull null)
|
||||
}
|
||||
}
|
||||
return finalResult
|
||||
}
|
||||
|
||||
override suspend fun load(url: String): LoadResponse {
|
||||
val doc = app.get(url).document
|
||||
val isMovie =
|
||||
doc.select("ul.half-tags:contains(القسم) li:nth-child(2)").text().contains("افلام")
|
||||
val posterUrl =
|
||||
doc.select("a.poster-image").attr("style").replace(".*url\\(|\\);".toRegex(), "")
|
||||
|
||||
val year = doc.select("ul.half-tags:contains(السنة) li:nth-child(2)").text().toIntOrNull()
|
||||
|
||||
val title =
|
||||
doc.select("div.breadcrumb a:nth-child(3)").text()
|
||||
.replace(
|
||||
"الموسم الأول|برنامج|فيلم|مترجم|اون لاين|مسلسل|مشاهدة|انمي|أنمي|$year".toRegex(),
|
||||
""
|
||||
)
|
||||
|
||||
val tags = doc.select("ul.half-tags:contains(النوع) li").not(":nth-child(1)").map {
|
||||
it.text()
|
||||
}
|
||||
val recommendations =
|
||||
doc.select("div.MediaGrid").first()?.select("div.content-box")?.mapNotNull {
|
||||
it.toSearchResponse()
|
||||
}
|
||||
val synopsis = doc.select("div.post-story:contains(قصة) p").text()
|
||||
|
||||
val rating = doc.select("div.imdbR div span").text().toRatingInt()
|
||||
return if (isMovie) {
|
||||
newMovieLoadResponse(
|
||||
title,
|
||||
url,
|
||||
TvType.Movie,
|
||||
url
|
||||
) {
|
||||
this.posterUrl = posterUrl
|
||||
this.year = year
|
||||
this.plot = synopsis
|
||||
this.tags = tags
|
||||
this.recommendations = recommendations
|
||||
this.rating = rating
|
||||
}
|
||||
} else {
|
||||
val episodes = ArrayList<Episode>()
|
||||
val episodeElement = doc.select("div.MediaGrid")
|
||||
val allEpisodesUrl = doc.select("div.btns:contains(جميع الحلقات) a").attr("href")
|
||||
if(allEpisodesUrl.isNotEmpty()) {
|
||||
app.get(allEpisodesUrl).document.select("div.row > div").let {
|
||||
it.mapIndexedNotNull { index, element ->
|
||||
episodes.add(
|
||||
Episode(
|
||||
element.select("a.fullClick").attr("href"),
|
||||
element.select("a.fullClick").attr("title"),
|
||||
1,
|
||||
it.size - index
|
||||
)
|
||||
)
|
||||
}
|
||||
}
|
||||
} else {
|
||||
episodeElement[1].select("div.content-box").apmap {
|
||||
val seasonNumber = it.select("div.number em").text().toIntOrNull()
|
||||
val seasonUrl = it.select("a.fullClick").attr("href")
|
||||
app.get(seasonUrl).document.select(".episode-block").map { episode ->
|
||||
episodes.add(
|
||||
Episode(
|
||||
episode.select("a").attr("href"),
|
||||
episode.select("div.title").text(),
|
||||
seasonNumber,
|
||||
episode.select("div.number em").text().toIntOrNull(),
|
||||
episode.select("div.poster img").attr("data-image")
|
||||
)
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
newTvSeriesLoadResponse(
|
||||
title,
|
||||
url,
|
||||
TvType.TvSeries,
|
||||
episodes.distinct().sortedBy { it.episode }) {
|
||||
this.posterUrl = posterUrl
|
||||
this.year = year
|
||||
this.plot = synopsis
|
||||
this.tags = tags
|
||||
this.recommendations = recommendations
|
||||
this.rating = rating
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override suspend fun loadLinks(
|
||||
data: String,
|
||||
isCasting: Boolean,
|
||||
subtitleCallback: (SubtitleFile) -> Unit,
|
||||
callback: (ExtractorLink) -> Unit
|
||||
): Boolean {
|
||||
val watchUrl = "$data/watch"
|
||||
app.get(watchUrl).document.select(
|
||||
".servers-list li:contains(ok), li:contains(Streamtape), li:contains(DoodStream), li:contains(Uqload), li:contains(Voe), li:contains(VIDBOM), li:contains(Upstream), li:contains(السيرفر الخاص), li:contains(GoStream), li:contains(الخاص 1080p), li:contains(vidbom), li:contains(Vidbom)"
|
||||
).apmap {
|
||||
val id = it.attr("data-id")
|
||||
val i = it.attr("data-i")
|
||||
val sourceUrl = app.post(
|
||||
"${data.getDomainFromUrl()}/wp-content/themes/Shahid4u-WP_HOME/Ajaxat/Single/Server.php",
|
||||
headers = mapOf("referer" to watchUrl, "x-requested-with" to "XMLHttpRequest"),
|
||||
data = mapOf("id" to id, "i" to i)
|
||||
).document.select("iframe").attr("src").replace(" ", "")
|
||||
loadExtractor(sourceUrl, watchUrl, subtitleCallback, callback)
|
||||
}
|
||||
return true
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue