Remove Arabic providers from English repository

This commit is contained in:
Blatzar 2022-08-17 14:12:09 +02:00
parent d6f89c399b
commit a9190fa268
16 changed files with 0 additions and 1120 deletions

View File

@ -1,26 +0,0 @@
// use an integer for version numbers
version = 1
cloudstream {
// All of these properties are optional, you can safely remove them
// description = "Lorem Ipsum"
// authors = listOf("Cloudburst")
/**
* Status int as the following:
* 0: Down
* 1: Ok
* 2: Slow
* 3: Beta only
* */
status = 1 // will be 3 if unspecified
tvTypes = listOf(
"Anime",
"Cartoon",
"TvSeries",
"Movie",
)
iconUrl = "https://www.google.com/s2/favicons?domain=akwam.to&sz=24"
}

View File

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

View File

@ -1,224 +0,0 @@
package com.lagradost
import com.lagradost.cloudstream3.*
import com.lagradost.cloudstream3.LoadResponse.Companion.addActors
import com.lagradost.cloudstream3.utils.ExtractorLink
import com.lagradost.cloudstream3.utils.Qualities
import org.jsoup.nodes.Element
class AkwamProvider : MainAPI() {
override var lang = "ar"
override var mainUrl = "https://akwam.to"
override var name = "Akwam"
override val usesWebView = false
override val hasMainPage = true
override val supportedTypes = setOf(TvType.TvSeries, TvType.Movie, TvType.Anime, TvType.Cartoon)
private fun Element.toSearchResponse(): SearchResponse? {
val url = select("a.box").attr("href") ?: return null
if (url.contains("/games/") || url.contains("/programs/")) return null
val poster = select("picture > img")
val title = poster.attr("alt")
val posterUrl = poster.attr("data-src")
val year = select(".badge-secondary").text().toIntOrNull()
// If you need to differentiate use the url.
return MovieSearchResponse(
title,
url,
this@AkwamProvider.name,
TvType.TvSeries,
posterUrl,
year,
null,
)
}
override suspend fun getMainPage(page: Int, request : MainPageRequest): HomePageResponse {
// Title, Url
val moviesUrl = listOf(
"Movies" to "$mainUrl/movies",
"Series" to "$mainUrl/series",
"Shows" to "$mainUrl/shows"
)
val pages = moviesUrl.apmap {
val doc = app.get(it.second).document
val list = doc.select("div.col-lg-auto.col-md-4.col-6.mb-12").mapNotNull { element ->
element.toSearchResponse()
}
HomePageList(it.first, list)
}.sortedBy { it.name }
return HomePageResponse(pages)
}
override suspend fun search(query: String): List<SearchResponse> {
val url = "$mainUrl/search?q=$query"
val doc = app.get(url).document
return doc.select("div.col-lg-auto").mapNotNull {
it.toSearchResponse()
}
}
private fun String.getIntFromText(): Int? {
return Regex("""\d+""").find(this)?.groupValues?.firstOrNull()?.toIntOrNull()
}
private fun Element.toEpisode(): Episode {
val a = select("a.text-white")
val url = a.attr("href")
val title = a.text()
val thumbUrl = select("picture > img").attr("src")
val date = select("p.entry-date").text()
return newEpisode(url) {
name = title
episode = title.getIntFromText()
posterUrl = thumbUrl
addDate(date)
}
}
override suspend fun load(url: String): LoadResponse {
val doc = app.get(url).document
val isMovie = url.contains("/movie/")
val title = doc.select("h1.entry-title").text()
val posterUrl = doc.select("picture > img").attr("src")
val year =
doc.select("div.font-size-16.text-white.mt-2").firstOrNull {
it.text().contains("السنة")
}?.text()?.getIntFromText()
// A bit iffy to parse twice like this, but it'll do.
val duration =
doc.select("div.font-size-16.text-white.mt-2").firstOrNull {
it.text().contains("مدة الفيلم")
}?.text()?.getIntFromText()
val synopsis = doc.select("div.widget-body p:first-child").text()
val rating = doc.select("span.mx-2").text().split("/").lastOrNull()?.toRatingInt()
val tags = doc.select("div.font-size-16.d-flex.align-items-center.mt-3 > a").map {
it.text()
}
val actors = doc.select("div.widget-body > div > div.entry-box > a").mapNotNull {
val name = it?.selectFirst("div > .entry-title")?.text() ?: return@mapNotNull null
val image = it.selectFirst("div > img")?.attr("src") ?: return@mapNotNull null
Actor(name, image)
}
val recommendations =
doc.select("div > div.widget-body > div.row > div > div.entry-box").mapNotNull {
val recTitle = it?.selectFirst("div.entry-body > .entry-title > .text-white")
?: return@mapNotNull null
val href = recTitle.attr("href") ?: return@mapNotNull null
val name = recTitle.text() ?: return@mapNotNull null
val poster = it.selectFirst(".entry-image > a > picture > img")?.attr("data-src")
?: return@mapNotNull null
MovieSearchResponse(name, href, this.name, TvType.Movie, fixUrl(poster))
}
return if (isMovie) {
newMovieLoadResponse(
title,
url,
TvType.Movie,
url
) {
this.posterUrl = posterUrl
this.year = year
this.plot = synopsis
this.rating = rating
this.tags = tags
this.duration = duration
this.recommendations = recommendations
addActors(actors)
}
} else {
val episodes = doc.select("div.bg-primary2.p-4.col-lg-4.col-md-6.col-12").map {
it.toEpisode()
}.let {
val isReversed = (it.lastOrNull()?.episode ?: 1) < (it.firstOrNull()?.episode ?: 0)
if (isReversed)
it.reversed()
else it
}
newTvSeriesLoadResponse(title, url, TvType.TvSeries, episodes) {
this.duration = duration
this.posterUrl = posterUrl
this.tags = tags.filterNotNull()
this.rating = rating
this.year = year
this.plot = synopsis
this.recommendations = recommendations
addActors(actors)
}
}
}
// // Maybe possible to not use the url shortener but cba investigating that.
// private suspend fun skipUrlShortener(url: String): AppResponse {
// return app.get(app.get(url).document.select("a.download-link").attr("href"))
// }
private fun getQualityFromId(id: Int?): Qualities {
return when (id) {
2 -> Qualities.P360 // Extrapolated
3 -> Qualities.P480
4 -> Qualities.P720
5 -> Qualities.P1080
else -> Qualities.Unknown
}
}
override suspend fun loadLinks(
data: String,
isCasting: Boolean,
subtitleCallback: (SubtitleFile) -> Unit,
callback: (ExtractorLink) -> Unit
): Boolean {
val doc = app.get(data).document
val links = doc.select("div.tab-content.quality").map { element ->
val quality = getQualityFromId(element.attr("id").getIntFromText())
element.select(".col-lg-6 > a:contains(تحميل)").map { linkElement ->
if (linkElement.attr("href").contains("/download/")) {
Pair(
linkElement.attr("href"),
quality,
)
} else {
val url = "$mainUrl/download${
linkElement.attr("href").split("/link")[1]
}${data.split("/movie|/episode|/show/episode".toRegex())[1]}"
Pair(
url,
quality,
)
// just in case if they add the shorts urls again
}
}
}.flatten()
links.map {
val linkDoc = app.get(it.first).document
val button = linkDoc.select("div.btn-loader > a")
val url = button.attr("href")
callback.invoke(
ExtractorLink(
this.name,
this.name,
url,
this.mainUrl,
it.second.value
)
)
}
return true
}
}

View File

@ -1,14 +0,0 @@
package com.lagradost
import com.lagradost.cloudstream3.plugins.CloudstreamPlugin
import com.lagradost.cloudstream3.plugins.Plugin
import android.content.Context
@CloudstreamPlugin
class AkwamProviderPlugin: Plugin() {
override fun load(context: Context) {
// All providers should be added in this manner. Please don't edit the providers list directly.
registerMainAPI(AkwamProvider())
}
}

View File

@ -1,26 +0,0 @@
// use an integer for version numbers
version = 1
cloudstream {
// All of these properties are optional, you can safely remove them
// description = "Lorem Ipsum"
// authors = listOf("Cloudburst")
/**
* Status int as the following:
* 0: Down
* 1: Ok
* 2: Slow
* 3: Beta only
* */
status = 1 // will be 3 if unspecified
tvTypes = listOf(
"Anime",
"TvSeries",
"Movie",
)
iconUrl = "https://www.google.com/s2/favicons?domain=www.egy.best&sz=24"
}

View File

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

View File

@ -1,237 +0,0 @@
package com.lagradost
import com.fasterxml.jackson.annotation.JsonProperty
import com.lagradost.cloudstream3.*
import com.lagradost.cloudstream3.utils.AppUtils.parseJson
import com.lagradost.cloudstream3.utils.ExtractorLink
import com.lagradost.cloudstream3.LoadResponse.Companion.addTrailer
import org.jsoup.nodes.Element
class EgyBestProvider : MainAPI() {
override var lang = "ar"
override var mainUrl = "https://www.egy.best"
override var name = "EgyBest"
override val usesWebView = false
override val hasMainPage = true
override val supportedTypes = setOf(TvType.TvSeries, TvType.Movie, TvType.Anime)
private fun String.getIntFromText(): Int? {
return Regex("""\d+""").find(this)?.groupValues?.firstOrNull()?.toIntOrNull()
}
private fun Element.toSearchResponse(): SearchResponse? {
val url = this.attr("href") ?: return null
val posterUrl = select("img")?.attr("src")
var title = select("span.title").text()
val year = title.getYearFromTitle()
val isMovie = Regex(".*/movie/.*|.*/masrahiya/.*").matches(url)
val tvType = if (isMovie) TvType.Movie else TvType.TvSeries
title = if (year !== null) title else title.split(" (")[0].trim()
val quality = select("span.ribbon span").text().replace("-", "")
// If you need to differentiate use the url.
return MovieSearchResponse(
title,
url,
this@EgyBestProvider.name,
tvType,
posterUrl,
year,
null,
quality = getQualityFromString(quality)
)
}
override suspend fun getMainPage(page: Int, request : MainPageRequest): HomePageResponse {
// url, title
val doc = app.get(mainUrl).document
val pages = arrayListOf<HomePageList>()
doc.select("#mainLoad div.mbox").apmap {
val name = it.select(".bdb.pda > strong").text()
if (it.select(".movie").first()?.attr("href")?.contains("season-(.....)|ep-(.....)".toRegex()) == true) return@apmap
val list = arrayListOf<SearchResponse>()
it.select(".movie").map { element ->
list.add(element.toSearchResponse()!!)
}
pages.add(HomePageList(name, list))
}
return HomePageResponse(pages)
}
override suspend fun search(query: String): List<SearchResponse> {
val q = query.replace(" ","%20")
val result = arrayListOf<SearchResponse>()
listOf("$mainUrl/explore/?q=$q").apmap { url ->
val d = app.get(url).document
d.select("div.movies a").not("a.auto.load.btn.b").mapNotNull {
it.toSearchResponse()?.let { it1 -> result.add(it1) }
}
}
return result.distinct().sortedBy { it.name }
}
private fun String.getYearFromTitle(): Int? {
return Regex("""\(\d{4}\)""").find(this)?.groupValues?.firstOrNull()?.toIntOrNull()
}
override suspend fun load(url: String): LoadResponse {
val doc = app.get(url).document
val isMovie = Regex(".*/movie/.*|.*/masrahiya/.*").matches(url)
val posterUrl = doc.select("div.movie_img a img")?.attr("src")
val year = doc.select("div.movie_title h1 a")?.text()?.toIntOrNull()
val title = doc.select("div.movie_title h1 span").text()
val youtubeTrailer = doc.select("div.play")?.attr("url")
val synopsis = doc.select("div.mbox").firstOrNull {
it.text().contains("القصة")
}?.text()?.replace("القصة ", "")
val tags = doc.select("table.movieTable tbody tr").firstOrNull {
it.text().contains("النوع")
}?.select("a")?.map { it.text() }
val actors = doc.select("div.cast_list .cast_item").mapNotNull {
val name = it.selectFirst("div > a > img")?.attr("alt") ?: return@mapNotNull null
val image = it.selectFirst("div > a > img")?.attr("src") ?: return@mapNotNull null
val roleString = it.selectFirst("div > span")!!.text()
val mainActor = Actor(name, image)
ActorData(actor = mainActor, roleString = roleString)
}
return if (isMovie) {
val recommendations = doc.select(".movies_small .movie").mapNotNull { element ->
element.toSearchResponse()
}
newMovieLoadResponse(
title,
url,
TvType.Movie,
url
) {
this.posterUrl = posterUrl
this.year = year
this.recommendations = recommendations
this.plot = synopsis
this.tags = tags
this.actors = actors
addTrailer(youtubeTrailer)
}
} else {
val episodes = ArrayList<Episode>()
doc.select("#mainLoad > div:nth-child(2) > div.h_scroll > div a").map {
it.attr("href")
}.apmap {
val d = app.get(it).document
val season = Regex("season-(.....)").find(it)?.groupValues?.getOrNull(1)?.getIntFromText()
if(d.select("tr.published").isNotEmpty()) {
d.select("tr.published").map { element ->
val ep = Regex("ep-(.....)").find(element.select(".ep_title a").attr("href"))?.groupValues?.getOrNull(1)?.getIntFromText()
episodes.add(
Episode(
element.select(".ep_title a").attr("href"),
name = element.select("td.ep_title").html().replace(".*</span>|</a>".toRegex(), ""),
season,
ep,
rating = element.select("td.tam:not(.date, .ep_len)").text().getIntFromText()
)
)
}
} else {
d.select("#mainLoad > div:nth-child(3) > div.movies_small a").map { eit ->
val ep = Regex("ep-(.....)").find(eit.attr("href"))?.groupValues?.getOrNull(1)?.getIntFromText()
episodes.add(
Episode(
eit.attr("href"),
eit.select("span.title").text(),
season,
ep,
)
)
}
}
}
newTvSeriesLoadResponse(title, url, TvType.TvSeries, episodes.distinct().sortedBy { it.episode }) {
this.posterUrl = posterUrl
this.tags = tags
this.year = year
this.plot = synopsis
this.actors = actors
addTrailer(youtubeTrailer)
}
}
}
data class Sources (
@JsonProperty("quality") val quality: Int?,
@JsonProperty("link") val link: String
)
override suspend fun loadLinks(
data: String,
isCasting: Boolean,
subtitleCallback: (SubtitleFile) -> Unit,
callback: (ExtractorLink) -> Unit
): Boolean {
/*val baseURL = data.split("/")[0] + "//" + data.split("/")[2]
val episodeSoup = app.get(data).document
val vidstreamURL = fixUrlNull(episodeSoup.selectFirst("iframe.auto-size")?.attr("src") ) ?: throw ErrorLoadingException("No iframe")
val videoSoup = app.get(vidstreamURL).document
fixUrlNull( videoSoup.select("source").firstOrNull { it.hasAttr("src") }?.attr("src"))?.let {
callback.invoke(ExtractorLink(this.name,this.name,it,"",Qualities.Unknown.value,it.contains(".m3u8")))
} ?: run {
var jsCode = videoSoup.select("script")[1].data()
val verificationToken = Regex("{'[0-9a-zA-Z_]*':'ok'}").findAll(jsCode)[0][2:-7]
val encodedAdLinkVar = Regex("([0-9a-zA-Z_]{2,12}\[Math").findAll(jsCode)[0][1:-5]
val encodingArraysRegEx = Regex(",[0-9a-zA-Z_]{2,12}=\[\]").findAll(jsCode)
val firstEncodingArray = encodingArraysRegEx[1][1:-3]
val secondEncodingArray = encodingArraysRegEx[2][1:-3]
jsCode = Regex("^<script type=\"text/javascript\">", "", jsCode)
jsCode = Regex("[;,]\$\('\*'\)(.*)$", ";", jsCode)
jsCode = Regex(",ismob=(.*)\(navigator\[(.*)\]\)[,;]", ";", jsCode)
jsCode = Regex("var a0b=function\(\)(.*)a0a\(\);",).findAll( jsCode)
jsCode += "var link = ''; for (var i = 0; i <= $secondEncodingArray['length']; i++) { link += $firstEncodingArray[$secondEncodingArray[i]] || ''; } return [link, $encodedAdLinkVar[0]] }"
val jsCodeReturn = executeJS(jsCode)()
val verificationPath = jsCodeReturn[0]
val encodedAdPath = jsCodeReturn[1]
val adLink = baseURL + "/" + str(decode(encodedAdPath + "=" * (-len(encodedAdPath) % 4)), "utf-8")
val session.get(adLink)
val verificationLink = baseURL + "/tvc.php?verify=" + verificationPath
val session.post(verificationLink, data={verificationToken: "ok"})
val vidstreamResponseText = session.get(vidstreamURL).text
val videoSoup = BeautifulSoup(vidstreamResponseText, features="html.parser")
val qualityLinksFileURL = baseURL + videoSoup.body.find("source").get("src")
}
return true*/
val requestJSON = app.get("https://api.zr5.repl.co/egybest?url=$data").text
// To solve this you need to send a verify request which is pretty hidden, see
// https://vear.egybest.deals/tvc.php?verify=.......
val jsonArray = parseJson<List<Sources>>(requestJSON)
for (i in jsonArray) {
val quality = i.quality
val link = i.link
callback.invoke(
ExtractorLink(
this.name,
this.name,
link,
this.mainUrl,
quality!!,
true,
// Does not work without these headers!
headers = mapOf("range" to "bytes=0-"),
)
)
}
return true
}
}

View File

@ -1,14 +0,0 @@
package com.lagradost
import com.lagradost.cloudstream3.plugins.CloudstreamPlugin
import com.lagradost.cloudstream3.plugins.Plugin
import android.content.Context
@CloudstreamPlugin
class EgyBestProviderPlugin: Plugin() {
override fun load(context: Context) {
// All providers should be added in this manner. Please don't edit the providers list directly.
registerMainAPI(EgyBestProvider())
}
}

View File

@ -1,27 +0,0 @@
// use an integer for version numbers
version = 1
cloudstream {
// All of these properties are optional, you can safely remove them
// description = "Lorem Ipsum"
// authors = listOf("Cloudburst")
/**
* Status int as the following:
* 0: Down
* 1: Ok
* 2: Slow
* 3: Beta only
* */
status = 1 // will be 3 if unspecified
tvTypes = listOf(
"AsianDrama",
"Anime",
"TvSeries",
"Movie",
)
iconUrl = "https://www.google.com/s2/favicons?domain=faselhd.io&sz=24"
}

View File

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

View File

@ -1,163 +0,0 @@
package com.lagradost
import com.lagradost.cloudstream3.*
import com.lagradost.cloudstream3.utils.ExtractorLink
import org.jsoup.nodes.Element
class FaselHDProvider : MainAPI() {
override var lang = "ar"
override var mainUrl = "https://faselhd.io"
override var name = "FaselHD"
override val usesWebView = false
override val hasMainPage = true
override val supportedTypes = setOf(TvType.TvSeries, TvType.Movie, TvType.AsianDrama, TvType.Anime)
private fun String.getIntFromText(): Int? {
return Regex("""\d+""").find(this)?.groupValues?.firstOrNull()?.toIntOrNull()
}
private fun Element.toSearchResponse(): SearchResponse? {
val url = select("div.postDiv a").attr("href") ?: return null
val posterUrl = select("div.postDiv a div img").attr("data-src") ?:
select("div.postDiv a div img").attr("src")
val title = select("div.postDiv a div img").attr("alt")
val quality = select(".quality").first()?.text()?.replace("1080p |-".toRegex(), "")
val type = if(title.contains("فيلم")) TvType.Movie else TvType.TvSeries
return MovieSearchResponse(
title.replace("الموسم الأول|برنامج|فيلم|مترجم|اون لاين|مسلسل|مشاهدة|انمي|أنمي".toRegex(),""),
url,
this@FaselHDProvider.name,
type,
posterUrl,
null,
null,
quality = getQualityFromString(quality)
)
}
override suspend fun getMainPage(page: Int, request : MainPageRequest): HomePageResponse {
// Title, Url
val moviesUrl = listOf(
Pair("Movies", "$mainUrl/all-movies/page/"+(0..10).random()),
Pair("Series", "$mainUrl/series/page/"+(0..10).random()),
Pair("Top Movies IMDB", "$mainUrl/movies_top_imdb"),
)
val pages = moviesUrl.apmap { (title, url) ->
val doc = app.get(url).document
val list = doc.select("div[id=\"postList\"] div[class=\"col-xl-2 col-lg-2 col-md-3 col-sm-3\"]")
.mapNotNull { element ->
element.toSearchResponse()
}
HomePageList(title, list)
}
return HomePageResponse(pages)
}
override suspend fun search(query: String): List<SearchResponse> {
val q = query.replace(" ","+")
val d = app.get("$mainUrl/?s=$q").document
return d.select("div[id=\"postList\"] div[class=\"col-xl-2 col-lg-2 col-md-3 col-sm-3\"]")
.mapNotNull {
it.toSearchResponse()
}
}
override suspend fun load(url: String): LoadResponse {
val doc = app.get(url).document
val isMovie = doc.select("div.epAll").isEmpty()
val posterUrl = doc.select("div.posterImg img").attr("src")
.ifEmpty { doc.select("div.seasonDiv.active img").attr("data-src") }
val year = doc.select("div[id=\"singleList\"] div[class=\"col-xl-6 col-lg-6 col-md-6 col-sm-6\"]").firstOrNull {
it.text().contains("سنة|موعد".toRegex())
}?.text()?.getIntFromText()
val title =
doc.select("title").text().replace(" - فاصل إعلاني", "")
.replace("الموسم الأول|برنامج|فيلم|مترجم|اون لاين|مسلسل|مشاهدة|انمي|أنمي|$year".toRegex(),"")
// A bit iffy to parse twice like this, but it'll do.
val duration = doc.select("div[id=\"singleList\"] div[class=\"col-xl-6 col-lg-6 col-md-6 col-sm-6\"]").firstOrNull {
it.text().contains("مدة|توقيت".toRegex())
}?.text()?.getIntFromText()
val tags = doc.select("div[id=\"singleList\"] div[class=\"col-xl-6 col-lg-6 col-md-6 col-sm-6\"]:contains(تصنيف الفيلم) a").map {
it.text()
}
val recommendations = doc.select("div#postList div.postDiv").mapNotNull {
it.toSearchResponse()
}
val synopsis = doc.select("div.singleDesc p").text()
return if (isMovie) {
newMovieLoadResponse(
title,
url,
TvType.Movie,
url
) {
this.posterUrl = posterUrl
this.year = year
this.plot = synopsis
this.duration = duration
this.tags = tags
this.recommendations = recommendations
}
} else {
val episodes = ArrayList<Episode>()
doc.select("div.epAll a").map {
episodes.add(
Episode(
it.attr("href"),
it.text(),
doc.select("div.seasonDiv.active div.title").text().getIntFromText() ?: 1,
it.text().getIntFromText(),
)
)
}
doc.select("div[id=\"seasonList\"] div[class=\"col-xl-2 col-lg-3 col-md-6\"] div.seasonDiv")
.not(".active").apmap { it ->
val s = app.get("$mainUrl/?p="+it.attr("data-href")).document
s.select("div.epAll a").map {
episodes.add(
Episode(
it.attr("href"),
it.text(),
s.select("div.seasonDiv.active div.title").text().getIntFromText(),
it.text().getIntFromText(),
)
)
}
}
newTvSeriesLoadResponse(title, url, TvType.TvSeries, episodes.distinct().sortedBy { it.episode }) {
this.duration = duration
this.posterUrl = posterUrl
this.year = year
this.plot = synopsis
this.tags = tags
this.recommendations = recommendations
}
}
}
override suspend fun loadLinks(
data: String,
isCasting: Boolean,
subtitleCallback: (SubtitleFile) -> Unit,
callback: (ExtractorLink) -> Unit
): Boolean {
val player = app.get(app.get(data).document.select("iframe[name=\"player_iframe\"]").attr("src")).document
player.select("div.quality_change button.hd_btn").map {
callback.invoke(
ExtractorLink(
this.name,
this.name,
it.attr("data-url"),
this.mainUrl,
quality = it.text().getIntFromText() ?: 0,
isM3u8 = true
)
)
}
return true
}
}

View File

@ -1,14 +0,0 @@
package com.lagradost
import com.lagradost.cloudstream3.plugins.CloudstreamPlugin
import com.lagradost.cloudstream3.plugins.Plugin
import android.content.Context
@CloudstreamPlugin
class FaselHDProviderPlugin: Plugin() {
override fun load(context: Context) {
// All providers should be added in this manner. Please don't edit the providers list directly.
registerMainAPI(FaselHDProvider())
}
}

View File

@ -1,26 +0,0 @@
// use an integer for version numbers
version = 1
cloudstream {
// All of these properties are optional, you can safely remove them
// description = "Lorem Ipsum"
// authors = listOf("Cloudburst")
/**
* Status int as the following:
* 0: Down
* 1: Ok
* 2: Slow
* 3: Beta only
* */
status = 1 // will be 3 if unspecified
tvTypes = listOf(
"Anime",
"TvSeries",
"Movie",
)
iconUrl = "https://www.google.com/s2/favicons?domain=mycima.tv&sz=24"
}

View File

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

View File

@ -1,327 +0,0 @@
package com.lagradost
import com.lagradost.cloudstream3.*
import com.lagradost.cloudstream3.LoadResponse.Companion.addActors
import com.lagradost.cloudstream3.utils.AppUtils.parseJson
import com.lagradost.cloudstream3.utils.ExtractorLink
import org.jsoup.Jsoup
import org.jsoup.nodes.Element
class MyCimaProvider : MainAPI() {
override var lang = "ar"
override var mainUrl = "https://mycima.tv"
override var name = "MyCima"
override val usesWebView = false
override val hasMainPage = true
override val supportedTypes = setOf(TvType.TvSeries, TvType.Movie, TvType.Anime)
private fun String.getImageURL(): String? {
return this.replace("--im(age|g):url\\(|\\);".toRegex(), "")
}
private fun String.getIntFromText(): Int? {
return Regex("""\d+""").find(this)?.groupValues?.firstOrNull()?.toIntOrNull()
}
private fun Element.toSearchResponse(): SearchResponse? {
val url = select("div.Thumb--GridItem a")
val posterUrl = select("span.BG--GridItem")?.attr("data-lazy-style")
?.getImageURL()
val year = select("div.GridItem span.year")?.text()
val title = select("div.Thumb--GridItem strong").text()
.replace("$year", "")
.replace("مشاهدة|فيلم|مسلسل|مترجم".toRegex(), "")
.replace("( نسخة مدبلجة )", " ( نسخة مدبلجة ) ")
// If you need to differentiate use the url.
return MovieSearchResponse(
title,
url.attr("href"),
this@MyCimaProvider.name,
if(url.attr("title").contains("فيلم")) TvType.Movie else TvType.TvSeries,
posterUrl,
year?.getIntFromText(),
null,
)
}
override suspend fun getMainPage(page: Int, request : MainPageRequest): HomePageResponse {
// Title, Url
val moviesUrl = listOf(
"Movies" to "$mainUrl/movies/page/" + (0..25).random(),
"Series" to "$mainUrl/seriestv/new/page/" + (0..25).random()
)
val pages = moviesUrl.apmap {
val doc = app.get(it.second).document
val list = doc.select("div.Grid--MycimaPosts div.GridItem").mapNotNull { element ->
element.toSearchResponse()
}
HomePageList(it.first, list)
}.sortedBy { it.name }
return HomePageResponse(pages)
}
override suspend fun search(query: String): List<SearchResponse> {
val q = query.replace(" ", "%20")
val result = arrayListOf<SearchResponse>()
listOf(
"$mainUrl/search/$q",
"$mainUrl/search/$q/list/series/",
"$mainUrl/search/$q/list/anime/"
).apmap { url ->
val d = app.get(url).document
d.select("div.Grid--MycimaPosts div.GridItem").mapNotNull {
if (it.text().contains("اعلان")) return@mapNotNull null
it.toSearchResponse()?.let { it1 -> result.add(it1) }
}
}
return result.distinct().sortedBy { it.name }
}
data class MoreEPS(
val output: String
)
override suspend fun load(url: String): LoadResponse {
val doc = app.get(url).document
val isMovie = doc.select("ol li:nth-child(3)").text().contains("افلام")
val posterUrl =
doc.select("mycima.separated--top")?.attr("data-lazy-style")?.getImageURL()
?.ifEmpty { doc.select("meta[itemprop=\"thumbnailUrl\"]")?.attr("content") }
?.ifEmpty { doc.select("mycima.separated--top")?.attr("style")?.getImageURL() }
val year =
doc.select("div.Title--Content--Single-begin h1 a.unline")?.text()?.getIntFromText()
val title = doc.select("div.Title--Content--Single-begin h1").text()
.replace("($year)", "")
.replace("مشاهدة|فيلم|مسلسل|مترجم|انمي".toRegex(), "")
// A bit iffy to parse twice like this, but it'll do.
val duration =
doc.select("ul.Terms--Content--Single-begin li").firstOrNull {
it.text().contains("المدة")
}?.text()?.getIntFromText()
val synopsis = doc.select("div.StoryMovieContent").text()
.ifEmpty { doc.select("div.PostItemContent").text() }
val tags = doc.select("li:nth-child(3) > p > a").map { it.text() }
val actors = doc.select("div.List--Teamwork > ul.Inner--List--Teamwork > li")?.mapNotNull {
val name = it?.selectFirst("a > div.ActorName > span")?.text() ?: return@mapNotNull null
val image = it.attr("style")
?.getImageURL()
?: return@mapNotNull null
Actor(name, image)
}
val recommendations =
doc.select("div.Grid--MycimaPosts div.GridItem")?.mapNotNull { element ->
element.toSearchResponse()
}
return if (isMovie) {
newMovieLoadResponse(
title,
url,
TvType.Movie,
url
) {
this.posterUrl = posterUrl
this.year = year
this.plot = synopsis
this.tags = tags
this.duration = duration
this.recommendations = recommendations
addActors(actors)
}
} else {
val episodes = ArrayList<Episode>()
val seasons = doc.select("div.List--Seasons--Episodes a").not(".selected").map {
it.attr("href")
}
val moreButton = doc.select("div.MoreEpisodes--Button")
val season =
doc.select("div.List--Seasons--Episodes a.selected").text().getIntFromText()
doc.select("div.Seasons--Episodes div.Episodes--Seasons--Episodes a")
.apmap {
episodes.add(
Episode(
it.attr("href"),
it.text(),
season,
it.text().getIntFromText(),
)
)
}
if (moreButton.isNotEmpty()) {
val n = doc.select("div.Seasons--Episodes div.Episodes--Seasons--Episodes a").size
val totals =
doc.select("div.Episodes--Seasons--Episodes a").first()!!.text().getIntFromText()
val mEPS = arrayListOf(
n,
n + 40,
n + 80,
n + 120,
n + 160,
n + 200,
n + 240,
n + 280,
n + 320,
n + 360,
n + 400,
n + 440,
n + 480,
n + 520,
n + 660,
n + 700,
n + 740,
n + 780,
n + 820,
n + 860,
n + 900,
n + 940,
n + 980,
n + 1020,
n + 1060,
n + 1100,
n + 1140,
n + 1180,
n + 1220,
totals
)
mEPS.apmap { it ->
if (it != null) {
if (it > totals!!) return@apmap
val ajaxURL =
"$mainUrl/AjaxCenter/MoreEpisodes/${moreButton.attr("data-term")}/$it"
val jsonResponse = app.get(ajaxURL)
val json = parseJson<MoreEPS>(jsonResponse.text)
val document = Jsoup.parse(json.output?.replace("""\""", ""))
document.select("a").map {
episodes.add(
Episode(
it.attr("href"),
it.text(),
season,
it.text().getIntFromText(),
)
)
}
}
}
}
if (seasons.isNotEmpty()) {
seasons.apmap { surl ->
if (surl.contains("%d9%85%d8%af%d8%a8%d9%84%d8%ac")) return@apmap
val seasonsite = app.get(surl).document
val fmoreButton = seasonsite.select("div.MoreEpisodes--Button")
val fseason = seasonsite.select("div.List--Seasons--Episodes a.selected").text()
.getIntFromText() ?: 1
seasonsite.select("div.Seasons--Episodes div.Episodes--Seasons--Episodes a")
.map {
episodes.add(
Episode(
it.attr("href"),
it.text(),
fseason,
it.text().getIntFromText(),
)
)
}
if (fmoreButton.isNotEmpty()) {
val n =
seasonsite.select("div.Seasons--Episodes div.Episodes--Seasons--Episodes a").size
val totals =
seasonsite.select("div.Episodes--Seasons--Episodes a").first()!!.text()
.getIntFromText()
val mEPS = arrayListOf(
n,
n + 40,
n + 80,
n + 120,
n + 160,
n + 200,
n + 240,
n + 280,
n + 320,
n + 360,
n + 400,
n + 440,
n + 480,
n + 520,
n + 660,
n + 700,
n + 740,
n + 780,
n + 820,
n + 860,
n + 900,
n + 940,
n + 980,
n + 1020,
n + 1060,
n + 1100,
n + 1140,
n + 1180,
n + 1220,
totals
)
mEPS.apmap { it ->
if (it != null) {
if (it > totals!!) return@apmap
val ajaxURL =
"$mainUrl/AjaxCenter/MoreEpisodes/${fmoreButton.attr("data-term")}/$it"
val jsonResponse = app.get(ajaxURL)
val json = parseJson<MoreEPS>(jsonResponse.text)
val document = Jsoup.parse(json.output?.replace("""\""", ""))
document.select("a").map {
episodes.add(
Episode(
it.attr("href"),
it.text(),
fseason,
it.text().getIntFromText(),
)
)
}
}
}
} else return@apmap
}
}
newTvSeriesLoadResponse(
title,
url,
TvType.TvSeries,
episodes.distinct().sortedBy { it.episode }) {
this.duration = duration
this.posterUrl = posterUrl
this.tags = tags
this.year = year
this.plot = synopsis
this.recommendations = recommendations
addActors(actors)
}
}
}
override suspend fun loadLinks(
data: String,
isCasting: Boolean,
subtitleCallback: (SubtitleFile) -> Unit,
callback: (ExtractorLink) -> Unit
): Boolean {
app.get(data).document
.select("ul.List--Download--Mycima--Single:nth-child(2) li").map {
it.select("a").map { linkElement ->
callback.invoke(
ExtractorLink(
this.name,
this.name,
linkElement.attr("href"),
this.mainUrl,
quality = linkElement.select("resolution").text().getIntFromText() ?: 0
)
)
}
}.flatten()
return true
}
}

View File

@ -1,14 +0,0 @@
package com.lagradost
import com.lagradost.cloudstream3.plugins.CloudstreamPlugin
import com.lagradost.cloudstream3.plugins.Plugin
import android.content.Context
@CloudstreamPlugin
class MyCimaProviderPlugin: Plugin() {
override fun load(context: Context) {
// All providers should be added in this manner. Please don't edit the providers list directly.
registerMainAPI(MyCimaProvider())
}
}