mirror of
https://github.com/yoyzo/arab
synced 2024-08-15 03:15:00 +00:00
update providers (#3)
* added more extractors and fixed movizland * update movizland fushaar mycima shahed4u
This commit is contained in:
parent
0d681a51ae
commit
458aac3df7
16 changed files with 651 additions and 91 deletions
|
@ -1,4 +1,4 @@
|
|||
version = 1
|
||||
version = 2
|
||||
|
||||
cloudstream {
|
||||
description = ""
|
||||
|
|
|
@ -26,7 +26,9 @@ class Fushaar : MainAPI() {
|
|||
val posterUrl = select("img").attr("data-lazy-src")
|
||||
val year = select("ul.labels li.year").text()?.getIntFromText()
|
||||
var quality = select("div").first()?.attr("class")?.replace("hdd","hd")?.replace("caam","cam")
|
||||
val title = select("div.info h3").text()+"\n"+select("div.info h4").text()
|
||||
val titleOne = select("div.info h3").text()
|
||||
val titleTwo = select("div.info h4").text()
|
||||
val title = if(titleOne == titleTwo && titleOne.isNotEmpty()) titleOne else "$titleOne\n$titleTwo"
|
||||
|
||||
return MovieSearchResponse(
|
||||
title,
|
||||
|
@ -53,7 +55,7 @@ class Fushaar : MainAPI() {
|
|||
"$mainUrl/gerne/family/page/" to "Family | عائلي",
|
||||
"$mainUrl/gerne/fantasy/page/" to "Fantasy | فنتازيا",
|
||||
"$mainUrl/gerne/herror/page/" to "Herror | رعب",
|
||||
"$mainUrl/gerne/history/page/" to "History |تاريخي",
|
||||
"$mainUrl/gerne/history/page/" to "History | تاريخي",
|
||||
"$mainUrl/gerne/music/page/" to "Music | موسيقى",
|
||||
"$mainUrl/gerne/musical/page/" to "Musical | موسيقي",
|
||||
"$mainUrl/gerne/mystery/page/" to "Mystery | غموض",
|
||||
|
@ -84,9 +86,12 @@ class Fushaar : MainAPI() {
|
|||
|
||||
override suspend fun load(url: String): LoadResponse {
|
||||
var doc = app.get(url).document
|
||||
val posterUrl = doc.select("figure.poster noscript img").attr("src")
|
||||
val bigPoster = doc.select("""meta[property="og:image"]""").attr("content")
|
||||
val posterUrl = bigPoster.ifEmpty() { doc.select("figure.poster noscript img").attr("src")}
|
||||
val year = doc.select("header span.yearz").text()?.getIntFromText()
|
||||
val title = doc.select("header h1").text()+" | "+doc.select("header h2").text()
|
||||
val ARtitle = doc.select("header h1").text()
|
||||
val ENtitle = doc.select("header h2").text()
|
||||
val title = if( ARtitle.isNotEmpty() && ENtitle.isNotEmpty() ) "$ARtitle | $ENtitle" else if(ARtitle == ENtitle) ARtitle else "$ARtitle$ENtitle"
|
||||
val synopsis = doc.select("div.postz").text()
|
||||
val trailer = doc.select("#new-stream > div > div.ytb > a").attr("href")
|
||||
val tags = doc.select("div.zoomInUp a").map{it.text()}//doc.select("li.iifo").map { it.select("span.z-s-i").text()+" "+it.select("h8").text() }
|
||||
|
@ -119,13 +124,13 @@ class Fushaar : MainAPI() {
|
|||
callback: (ExtractorLink) -> Unit
|
||||
): Boolean {
|
||||
val doc = app.get(data).document
|
||||
var sourceUrl = doc.select("div:nth-child(10) > a").attr("href")
|
||||
var sourceUrl = doc.select("div:nth-child(3) > div > iframe,div:nth-child(4) > div > iframe").attr("data-lazy-src")
|
||||
loadExtractor(sourceUrl, data, subtitleCallback, callback)
|
||||
doc.select("#fancyboxID-download > center > a:nth-child(n+19),#fancyboxID-1 > center > a:nth-child(n+16)").map {
|
||||
callback.invoke(
|
||||
ExtractorLink(
|
||||
source = this.name,
|
||||
name = name,
|
||||
name = it.text() ?: name,
|
||||
url = it.attr("href"),
|
||||
referer = this.mainUrl,
|
||||
quality = it.text().getIntFromText() ?: Qualities.Unknown.value,
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
version = 3
|
||||
version = 4
|
||||
|
||||
cloudstream {
|
||||
description = "Not recommended for series."
|
||||
|
@ -8,7 +8,7 @@ cloudstream {
|
|||
|
||||
status = 1
|
||||
|
||||
tvTypes = listOf( "Movie" )
|
||||
tvTypes = listOf( "TvSeries" , "Movie" , "Anime" , "AsianDrama" )
|
||||
|
||||
iconUrl = "https://www.google.com/s2/favicons?domain=movizland.cyou&sz=%size%"
|
||||
iconUrl = "https://www.google.com/s2/favicons?domain=movizland.online&sz=%size%"
|
||||
}
|
||||
|
|
53
MovizlandProvider/src/main/kotlin/com/movizland/Govad.kt
Normal file
53
MovizlandProvider/src/main/kotlin/com/movizland/Govad.kt
Normal file
|
@ -0,0 +1,53 @@
|
|||
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?
|
||||
)
|
||||
}
|
59
MovizlandProvider/src/main/kotlin/com/movizland/JWPlayer.kt
Normal file
59
MovizlandProvider/src/main/kotlin/com/movizland/JWPlayer.kt
Normal file
|
@ -0,0 +1,59 @@
|
|||
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/"
|
||||
}
|
|
@ -7,5 +7,9 @@ import android.content.Context
|
|||
class MovizlandPlugin: Plugin() {
|
||||
override fun load(context: Context) {
|
||||
registerMainAPI(Movizland())
|
||||
registerExtractorAPI(Govad())
|
||||
registerExtractorAPI(Moshahda())
|
||||
registerExtractorAPI(Vadbam())
|
||||
registerExtractorAPI(Vidshar())
|
||||
}
|
||||
}
|
|
@ -0,0 +1,277 @@
|
|||
package com.movizland
|
||||
|
||||
|
||||
import com.lagradost.cloudstream3.*
|
||||
import com.lagradost.cloudstream3.LoadResponse.Companion.addTrailer
|
||||
import com.lagradost.cloudstream3.utils.ExtractorLink
|
||||
import com.lagradost.cloudstream3.utils.Qualities
|
||||
import com.lagradost.cloudstream3.utils.loadExtractor
|
||||
import org.jsoup.nodes.Element
|
||||
|
||||
class Movizland : MainAPI() {
|
||||
override var lang = "ar"
|
||||
override var mainUrl = "https://movizland.online"
|
||||
override var name = "Movizland"
|
||||
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 String.getFullSize(): String? {
|
||||
return this.replace("""-\d+x\d+""".toRegex(),"")
|
||||
}
|
||||
|
||||
private fun String.cleanTitle(): String {
|
||||
val prefix = setOf("مشاهدة فيلم","مشاهدة وتحميل فيلم","تحميل","فيلم","انمي","إنمي","مسلسل","برنامج")
|
||||
val suffix = setOf("مدبلج للعربية","اون لاين","مترجم")
|
||||
this.let{ clean ->
|
||||
var aa = clean
|
||||
prefix.forEach{ pre ->
|
||||
aa = if (aa.contains(pre)) aa.replace(pre,"") else aa }
|
||||
var bb = aa
|
||||
suffix.mapNotNull{ suf ->
|
||||
bb = if (bb.contains(suf)) bb.replace(suf,"") else bb }
|
||||
return bb
|
||||
}
|
||||
}
|
||||
|
||||
private fun Element.toSearchResponse(): SearchResponse? {
|
||||
val url = select(".BlockItem")
|
||||
val title = url.select(".BlockTitle").text()
|
||||
val img = url.select("img:last-of-type")
|
||||
val posterUrl = img?.attr("src")?.ifEmpty { img?.attr("data-src") }
|
||||
val year = url.select(".InfoEndBlock li").last()?.text()?.getIntFromText()
|
||||
var quality = url.select(".RestInformation li").last()?.text()?.replace(" |-|1080p|720p".toRegex(), "")?.replace("BluRay","BLURAY")
|
||||
val tvtype = if(title.contains("فيلم")) TvType.Movie else TvType.TvSeries
|
||||
return MovieSearchResponse(
|
||||
title.cleanTitle(),
|
||||
url.select("a").attr("href"),
|
||||
this@Movizland.name,
|
||||
tvtype,
|
||||
posterUrl,
|
||||
year,
|
||||
null,
|
||||
quality = getQualityFromString(quality),
|
||||
)
|
||||
}
|
||||
override val mainPage = mainPageOf(
|
||||
"$mainUrl/page/" to "أضيف حديثا",
|
||||
"$mainUrl/category/movies/page/" to "أفلام",
|
||||
"$mainUrl/series/page/" to "مسلسلات"
|
||||
)
|
||||
|
||||
override suspend fun getMainPage(page: Int, request : MainPageRequest): HomePageResponse {
|
||||
val doc = app.get(request.data + page).document
|
||||
val list = doc.select(".BlockItem").mapNotNull { element ->
|
||||
element.toSearchResponse()
|
||||
}
|
||||
return newHomePageResponse(request.name, list)
|
||||
}
|
||||
|
||||
override suspend fun search(query: String): List<SearchResponse> {
|
||||
val q = query.replace(" ".toRegex(), "%20")
|
||||
val result = arrayListOf<SearchResponse>()
|
||||
|
||||
val rlist = setOf(
|
||||
"$mainUrl/?s=$q",
|
||||
)
|
||||
rlist.forEach{ docs ->
|
||||
val d = app.get(docs).document
|
||||
d.select(".BlockItem").mapNotNull {
|
||||
it.toSearchResponse()?.let {
|
||||
it1 -> result.add(it1)
|
||||
}
|
||||
}
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
||||
private val seasonPatterns = arrayOf(
|
||||
Pair("الموسم العاشر|الموسم 10", 10),
|
||||
Pair("الموسم الحادي عشر|الموسم 11", 11),
|
||||
Pair("الموسم الثاني عشر|الموسم 12", 12),
|
||||
Pair("الموسم الثالث عشر|الموسم 13", 13),
|
||||
Pair("الموسم الرابع عشر|الموسم 14", 14),
|
||||
Pair("الموسم الخامس عشر|الموسم 15", 15),
|
||||
Pair("الموسم السادس عشر|الموسم 16", 16),
|
||||
Pair("الموسم السابع عشر|الموسم 17", 17),
|
||||
Pair("الموسم الثامن عشر|الموسم 18", 18),
|
||||
Pair("الموسم التاسع عشر|الموسم 19", 19),
|
||||
Pair("الموسم العشرون|الموسم 20", 20),
|
||||
Pair("الموسم الاول|الموسم 1", 1),
|
||||
Pair("الموسم الثاني|الموسم 2", 2),
|
||||
Pair("الموسم الثالث|الموسم 3", 3),
|
||||
Pair("الموسم الرابع|الموسم 4", 4),
|
||||
Pair("الموسم الخامس|الموسم 5", 5),
|
||||
Pair("الموسم السادس|الموسم 6", 6),
|
||||
Pair("الموسم السابع|الموسم 7", 7),
|
||||
Pair("الموسم الثامن|الموسم 8", 8),
|
||||
Pair("الموسم التاسع|الموسم 9", 9),
|
||||
)
|
||||
|
||||
private fun getSeasonFromString(sName: String): Int {
|
||||
return seasonPatterns.firstOrNull{(pattern, seasonNum) -> sName.contains(pattern.toRegex()) }?.second ?: 1
|
||||
}
|
||||
|
||||
override suspend fun load(url: String): LoadResponse {
|
||||
var doc = app.get(url).document
|
||||
val sdetails = doc.select(".SingleDetails")
|
||||
var posterUrl = sdetails.select("img")?.attr("data-src")?.getFullSize()
|
||||
val year = sdetails.select("li:has(.fa-clock) a").text()?.getIntFromText()
|
||||
var title = doc.select("h2.postTitle").text()
|
||||
val isMovie = title.contains("عرض|فيلم".toRegex())
|
||||
val synopsis = doc.select("section.story").text()
|
||||
val trailer = doc.select("div.InnerTrailer iframe").attr("data-src")
|
||||
var tags = sdetails.select("li:has(.fa-film) a").map{ it.text() }
|
||||
val recommendations = doc.select(".BlocksUI#LoadFilter .BlockItem").mapNotNull { element ->
|
||||
element.toSearchResponse()
|
||||
}
|
||||
|
||||
|
||||
return if (isMovie) {
|
||||
newMovieLoadResponse(
|
||||
title.cleanTitle().replace("$year",""),
|
||||
url,
|
||||
TvType.Movie,
|
||||
url
|
||||
) {
|
||||
this.posterUrl = posterUrl
|
||||
this.year = year
|
||||
this.tags = tags
|
||||
this.plot = synopsis
|
||||
this.recommendations = recommendations
|
||||
addTrailer(trailer)
|
||||
}
|
||||
} else {
|
||||
val episodes = ArrayList<Episode>()
|
||||
val episodesItem = doc.select(".EpisodesList").isNotEmpty()
|
||||
val fBlock = doc.select(".BlockItem")?.first()
|
||||
val img = fBlock?.select("img:last-of-type")
|
||||
|
||||
if(episodesItem){
|
||||
title = doc.select(".SeriesSingle .ButtonsFilter.WidthAuto span").text()
|
||||
doc.select(".EpisodesList .EpisodeItem").map{ element ->
|
||||
if(!element.text().contains("Full")){
|
||||
episodes.add(
|
||||
Episode(
|
||||
element.select("a").attr("href"),
|
||||
null,
|
||||
null,
|
||||
element.select("em").text().getIntFromText(),
|
||||
null,
|
||||
null,
|
||||
)
|
||||
)
|
||||
}
|
||||
}
|
||||
newTvSeriesLoadResponse(title, url, TvType.TvSeries, episodes) {
|
||||
this.posterUrl = posterUrl
|
||||
this.year = year
|
||||
this.tags = tags
|
||||
this.plot = synopsis
|
||||
this.recommendations = recommendations
|
||||
addTrailer(trailer)
|
||||
}
|
||||
}else{
|
||||
posterUrl = img?.attr("src")?.ifEmpty { img?.attr("data-src") }
|
||||
tags = fBlock?.select(".RestInformation span")!!.mapNotNull { t ->
|
||||
t.text()
|
||||
}
|
||||
title = doc.select(".PageTitle .H1Title").text().cleanTitle()
|
||||
if(doc.select(".BlockItem a").attr("href").contains("/series/")){//seasons
|
||||
doc.select(".BlockItem").map { seas ->
|
||||
seas.select("a").attr("href") }.apmap{ pageIt ->
|
||||
val Sedoc = app.get(pageIt).document
|
||||
val pagEl = Sedoc.select(".pagination > div > ul > li").isNotEmpty()
|
||||
if(pagEl) {
|
||||
Sedoc.select(".pagination > div > ul > li:nth-child(n):not(:last-child) a").apmap {
|
||||
val epidoc = app.get(it.attr("href")).document
|
||||
epidoc.select(".BlockItem").map{ element ->
|
||||
episodes.add(
|
||||
Episode(
|
||||
element.select("a").attr("href"),
|
||||
element.select(".BlockTitle").text(),
|
||||
getSeasonFromString(element.select(".BlockTitle").text()),
|
||||
element.select(".EPSNumber").text().getIntFromText(),
|
||||
element.select("img:last-of-type").attr("src")?.ifEmpty { img?.attr("data-src") },
|
||||
null,
|
||||
)
|
||||
)
|
||||
}
|
||||
}
|
||||
}else{
|
||||
Sedoc.select(".BlockItem").map{ el ->
|
||||
episodes.add(
|
||||
Episode(
|
||||
el.select("a").attr("href"),
|
||||
el.select(".BlockTitle").text(),
|
||||
getSeasonFromString(el.select(".BlockTitle").text()),
|
||||
el.select(".EPSNumber").text().getIntFromText(),
|
||||
el.select("img:last-of-type").attr("src")?.ifEmpty { img?.attr("data-src") },
|
||||
null,
|
||||
)
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
} else {//episodes
|
||||
val pagEl = doc.select(".pagination > div > ul > li.active > a").isNotEmpty()
|
||||
val pagSt = if(pagEl) true else false
|
||||
if(pagSt){
|
||||
doc.select(".pagination > div > ul > li:nth-child(n):not(:last-child) a").map{ eppages ->
|
||||
eppages.attr("href") }.apmap{
|
||||
val epidoc = app.get(it).document
|
||||
epidoc.select(".BlockItem").map{ element ->
|
||||
episodes.add(
|
||||
Episode(
|
||||
element.select("a").attr("href"),
|
||||
element.select(".BlockTitle").text(),
|
||||
getSeasonFromString(element.select(".BlockTitle").text()),
|
||||
element.select(".EPSNumber").text().getIntFromText(),
|
||||
element.select("img:last-of-type").attr("src")?.ifEmpty { img?.attr("data-src") },
|
||||
null,
|
||||
)
|
||||
)
|
||||
}
|
||||
}
|
||||
}else{
|
||||
doc.select(".BlockItem").map{ el ->
|
||||
episodes.add(
|
||||
Episode(
|
||||
el.select("a").attr("href"),
|
||||
el.select(".BlockTitle").text(),
|
||||
getSeasonFromString(el.select(".BlockTitle").text()),
|
||||
el.select(".EPSNumber").text().getIntFromText(),
|
||||
el.select("img:last-of-type").attr("src")?.ifEmpty { img?.attr("data-src") },
|
||||
null,
|
||||
)
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
newTvSeriesLoadResponse(title, url, TvType.TvSeries, episodes) {
|
||||
this.posterUrl = posterUrl?.getFullSize()
|
||||
this.tags = tags
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
override suspend fun loadLinks(
|
||||
data: String,
|
||||
isCasting: Boolean,
|
||||
subtitleCallback: (SubtitleFile) -> Unit,
|
||||
callback: (ExtractorLink) -> Unit
|
||||
): Boolean {
|
||||
val doc = app.get(data).document
|
||||
doc.select("code[id*='Embed'] iframe,.DownloadsList a").apmap {
|
||||
var sourceUrl = it.attr("data-srcout").ifEmpty { it.attr("href") }
|
||||
loadExtractor(sourceUrl, data, subtitleCallback, callback)
|
||||
}
|
||||
return true
|
||||
}
|
||||
}
|
|
@ -1,10 +1,10 @@
|
|||
package com.movizland
|
||||
|
||||
|
||||
import com.lagradost.cloudstream3.*
|
||||
import com.lagradost.cloudstream3.LoadResponse.Companion.addTrailer
|
||||
import com.lagradost.cloudstream3.utils.ExtractorLink
|
||||
import com.lagradost.cloudstream3.utils.Qualities
|
||||
import com.lagradost.cloudstream3.utils.getQualityFromName
|
||||
import com.lagradost.cloudstream3.utils.loadExtractor
|
||||
import org.jsoup.nodes.Element
|
||||
|
||||
|
@ -20,6 +20,10 @@ class Movizland : MainAPI() {
|
|||
return Regex("""\d+""").find(this)?.groupValues?.firstOrNull()?.toIntOrNull()
|
||||
}
|
||||
|
||||
private fun String.getFullSize(): String? {
|
||||
return this.replace("""-\d+x\d+""".toRegex(),"")
|
||||
}
|
||||
|
||||
private fun String.cleanTitle(): String {
|
||||
val prefix = setOf("مشاهدة فيلم","مشاهدة وتحميل فيلم","تحميل","فيلم","انمي","إنمي","مسلسل","برنامج")
|
||||
val suffix = setOf("مدبلج للعربية","اون لاين","مترجم")
|
||||
|
@ -36,28 +40,27 @@ class Movizland : MainAPI() {
|
|||
|
||||
private fun Element.toSearchResponse(): SearchResponse? {
|
||||
val url = select(".BlockItem")
|
||||
val title = url.select(".BlockTitle").text().cleanTitle()
|
||||
val title = url.select(".BlockTitle").text()
|
||||
val img = url.select("img:last-of-type")
|
||||
val posterUrl = img?.attr("src")?.ifEmpty { img?.attr("data-src") }
|
||||
val year = select(".InfoEndBlock li").last()?.text()?.getIntFromText()
|
||||
var quality = select(".RestInformation li").last()?.text()?.replace(" |-|1080p|720p".toRegex(), "")
|
||||
?.replace("WEB DL","WEBDL")?.replace("BluRay","BLURAY")
|
||||
val year = url.select(".InfoEndBlock li").last()?.text()?.getIntFromText()
|
||||
var quality = url.select(".RestInformation li").last()?.text()?.replace(" |-|1080p|720p".toRegex(), "")?.replace("BluRay","BLURAY")
|
||||
val tvtype = if(title.contains("فيلم")) TvType.Movie else TvType.TvSeries
|
||||
return MovieSearchResponse(
|
||||
title.replace("$year",""),
|
||||
title.cleanTitle(),
|
||||
url.select("a").attr("href"),
|
||||
this@Movizland.name,
|
||||
TvType.TvSeries,
|
||||
tvtype,
|
||||
posterUrl,
|
||||
year,
|
||||
null,
|
||||
quality = getQualityFromString(quality),
|
||||
)
|
||||
}
|
||||
|
||||
override val mainPage = mainPageOf(
|
||||
"$mainUrl/page/" to "الحلقات و الافلام المضافة حديثا",
|
||||
"$mainUrl/page/" to "أضيف حديثا",
|
||||
"$mainUrl/category/movies/page/" to "أفلام",
|
||||
"$mainUrl/series/page/" to "مسلسلات",
|
||||
"$mainUrl/series/page/" to "مسلسلات"
|
||||
)
|
||||
|
||||
override suspend fun getMainPage(page: Int, request : MainPageRequest): HomePageResponse {
|
||||
|
@ -69,55 +72,68 @@ class Movizland : MainAPI() {
|
|||
}
|
||||
|
||||
override suspend fun search(query: String): List<SearchResponse> {
|
||||
val d = app.get("$mainUrl/?s=$query").document
|
||||
return d.select(".BlockItem").mapNotNull {
|
||||
if(it.select(".BlockTitle").text().contains("الحلقة")) return@mapNotNull null;
|
||||
it.toSearchResponse()
|
||||
val q = query.replace(" ".toRegex(), "%20")
|
||||
val result = arrayListOf<SearchResponse>()
|
||||
|
||||
val rlist = setOf(
|
||||
"$mainUrl/?s=$q",
|
||||
)
|
||||
rlist.forEach{ docs ->
|
||||
val d = app.get(docs).document
|
||||
d.select(".BlockItem").mapNotNull {
|
||||
it.toSearchResponse()?.let {
|
||||
it1 -> result.add(it1)
|
||||
}
|
||||
}
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
||||
private fun getSeasonFromString(sName: String): Int {
|
||||
return when (sName.isNotEmpty()) {
|
||||
sName.contains("الموسم الاول|الموسم 1".toRegex()) -> 1
|
||||
sName.contains("الموسم الحادي عشر|الموسم 11".toRegex()) -> 11
|
||||
sName.contains("الموسم الثاني عشر|الموسم 12".toRegex()) -> 12
|
||||
sName.contains("الموسم الثالث عشر|الموسم 13".toRegex()) -> 13
|
||||
sName.contains("الموسم الرابع عشر|الموسم 14".toRegex()) -> 14
|
||||
sName.contains("الموسم الخامس عشر|الموسم 15".toRegex()) -> 15
|
||||
sName.contains("الموسم السادس عشر|الموسم 16".toRegex()) -> 16
|
||||
sName.contains("الموسم السابع عشر|الموسم 17".toRegex()) -> 17
|
||||
sName.contains("الموسم الثامن عشر|الموسم 18".toRegex()) -> 18
|
||||
sName.contains("الموسم التاسع عشر|الموسم 19".toRegex()) -> 19
|
||||
sName.contains("الموسم الثاني|الموسم 2".toRegex()) -> 2
|
||||
sName.contains("الموسم الثالث|الموسم 3".toRegex()) -> 3
|
||||
sName.contains("الموسم الرابع|الموسم 4".toRegex()) -> 4
|
||||
sName.contains("الموسم الخامس|الموسم 5".toRegex()) -> 5
|
||||
sName.contains("الموسم السادس|الموسم 6".toRegex()) -> 6
|
||||
sName.contains("الموسم السابع|الموسم 7".toRegex()) -> 7
|
||||
sName.contains("الموسم الثامن|الموسم 8".toRegex()) -> 8
|
||||
sName.contains("الموسم التاسع|الموسم 9".toRegex()) -> 9
|
||||
sName.contains("الموسم العاشر|الموسم 10".toRegex()) -> 10
|
||||
sName.contains("الموسم العشرون|الموسم 20".toRegex()) -> 20
|
||||
else -> 1
|
||||
}
|
||||
}
|
||||
private val seasonPatterns = arrayOf(
|
||||
Pair("الموسم العاشر|الموسم 10", 10),
|
||||
Pair("الموسم الحادي عشر|الموسم 11", 11),
|
||||
Pair("الموسم الثاني عشر|الموسم 12", 12),
|
||||
Pair("الموسم الثالث عشر|الموسم 13", 13),
|
||||
Pair("الموسم الرابع عشر|الموسم 14", 14),
|
||||
Pair("الموسم الخامس عشر|الموسم 15", 15),
|
||||
Pair("الموسم السادس عشر|الموسم 16", 16),
|
||||
Pair("الموسم السابع عشر|الموسم 17", 17),
|
||||
Pair("الموسم الثامن عشر|الموسم 18", 18),
|
||||
Pair("الموسم التاسع عشر|الموسم 19", 19),
|
||||
Pair("الموسم العشرون|الموسم 20", 20),
|
||||
Pair("الموسم الاول|الموسم 1", 1),
|
||||
Pair("الموسم الثاني|الموسم 2", 2),
|
||||
Pair("الموسم الثالث|الموسم 3", 3),
|
||||
Pair("الموسم الرابع|الموسم 4", 4),
|
||||
Pair("الموسم الخامس|الموسم 5", 5),
|
||||
Pair("الموسم السادس|الموسم 6", 6),
|
||||
Pair("الموسم السابع|الموسم 7", 7),
|
||||
Pair("الموسم الثامن|الموسم 8", 8),
|
||||
Pair("الموسم التاسع|الموسم 9", 9),
|
||||
)
|
||||
|
||||
private fun getSeasonFromString(sName: String): Int {
|
||||
return seasonPatterns.firstOrNull{(pattern, seasonNum) -> sName.contains(pattern.toRegex()) }?.second ?: 1
|
||||
}
|
||||
|
||||
override suspend fun load(url: String): LoadResponse {
|
||||
var doc = app.get(url).document
|
||||
val sdetails = doc.select(".SingleDetails")
|
||||
val posterUrl = sdetails.select(".Poster img").attr("data-src").ifEmpty {
|
||||
sdetails.select(".BlockItem").last()?.select(".Poster img")?.attr("src")
|
||||
}
|
||||
var posterUrl = sdetails.select("img")?.attr("data-src")?.getFullSize()
|
||||
val year = sdetails.select("li:has(.fa-clock) a").text()?.getIntFromText()
|
||||
val title = doc.select("h2.postTitle").text().cleanTitle().replace("$year","")
|
||||
val isMovie = doc.select("h2.postTitle").text().contains("عرض|فيلم".toRegex())
|
||||
var title = doc.select("h2.postTitle").text()
|
||||
val isMovie = title.contains("عرض|فيلم".toRegex())
|
||||
val synopsis = doc.select("section.story").text()
|
||||
val trailer = doc.select("div.InnerTrailer iframe").attr("data-src")
|
||||
val tags = sdetails.select("li:has(.fa-film) a").map{ it.text() }
|
||||
var tags = sdetails.select("li:has(.fa-film) a").map{ it.text() }
|
||||
val recommendations = doc.select(".BlocksUI#LoadFilter .BlockItem").mapNotNull { element ->
|
||||
element.toSearchResponse()
|
||||
}
|
||||
|
||||
|
||||
return if (isMovie) {
|
||||
newMovieLoadResponse(
|
||||
title,
|
||||
title.cleanTitle().replace("$year",""),
|
||||
url,
|
||||
TvType.Movie,
|
||||
url
|
||||
|
@ -126,12 +142,45 @@ class Movizland : MainAPI() {
|
|||
this.year = year
|
||||
this.tags = tags
|
||||
this.plot = synopsis
|
||||
this.recommendations = recommendations
|
||||
addTrailer(trailer)
|
||||
}
|
||||
} else {
|
||||
val episodes = ArrayList<Episode>()
|
||||
val pageUrl = doc.select("meta[property='og:url']").attr("content")
|
||||
val refererUrl = doc.select("body > header > div > div.Logo > a").attr("href")
|
||||
val episodesItem = doc.select(".EpisodesList").isNotEmpty()
|
||||
val fBlock = doc.select(".BlockItem")?.first()
|
||||
val img = fBlock?.select("img:last-of-type")
|
||||
|
||||
if(episodesItem){
|
||||
title = doc.select(".SeriesSingle .ButtonsFilter.WidthAuto span").text()
|
||||
doc.select(".EpisodesList .EpisodeItem").map{ element ->
|
||||
if(!element.text().contains("Full")){
|
||||
episodes.add(
|
||||
Episode(
|
||||
element.select("a").attr("href"),
|
||||
null,
|
||||
null,
|
||||
element.select("em").text().getIntFromText(),
|
||||
null,
|
||||
null,
|
||||
)
|
||||
)
|
||||
}
|
||||
}
|
||||
newTvSeriesLoadResponse(title, url, TvType.TvSeries, episodes) {
|
||||
this.posterUrl = posterUrl
|
||||
this.year = year
|
||||
this.tags = tags
|
||||
this.plot = synopsis
|
||||
this.recommendations = recommendations
|
||||
addTrailer(trailer)
|
||||
}
|
||||
}else{
|
||||
posterUrl = img?.attr("src")?.ifEmpty { img?.attr("data-src") }
|
||||
tags = fBlock?.select(".RestInformation span")!!.mapNotNull { t ->
|
||||
t.text()
|
||||
}
|
||||
title = doc.select(".PageTitle .H1Title").text().cleanTitle()
|
||||
if(doc.select(".BlockItem a").attr("href").contains("/series/")){//seasons
|
||||
doc.select(".BlockItem").map { seas ->
|
||||
seas.select("a").attr("href") }.apmap{ pageIt ->
|
||||
|
@ -140,13 +189,15 @@ class Movizland : MainAPI() {
|
|||
if(pagEl) {
|
||||
Sedoc.select(".pagination > div > ul > li:nth-child(n):not(:last-child) a").apmap {
|
||||
val epidoc = app.get(it.attr("href")).document
|
||||
epidoc.select("div.BlockItem").map{ element ->
|
||||
epidoc.select(".BlockItem").map{ element ->
|
||||
episodes.add(
|
||||
Episode(
|
||||
element.select("a").attr("href"),
|
||||
element.select(".BlockTitle").text(),
|
||||
getSeasonFromString(element.select(".BlockTitle").text()),
|
||||
element.select(".EPSNumber").text().getIntFromText(),
|
||||
element.select("img:last-of-type").attr("src")?.ifEmpty { img?.attr("data-src") },
|
||||
null,
|
||||
)
|
||||
)
|
||||
}
|
||||
|
@ -159,6 +210,8 @@ class Movizland : MainAPI() {
|
|||
el.select(".BlockTitle").text(),
|
||||
getSeasonFromString(el.select(".BlockTitle").text()),
|
||||
el.select(".EPSNumber").text().getIntFromText(),
|
||||
el.select("img:last-of-type").attr("src")?.ifEmpty { img?.attr("data-src") },
|
||||
null,
|
||||
)
|
||||
)
|
||||
}
|
||||
|
@ -172,25 +225,29 @@ class Movizland : MainAPI() {
|
|||
doc.select(".pagination > div > ul > li:nth-child(n):not(:last-child) a").map{ eppages ->
|
||||
eppages.attr("href") }.apmap{
|
||||
val epidoc = app.get(it).document
|
||||
epidoc.select("div.BlockItem").map{ element ->
|
||||
epidoc.select(".BlockItem").map{ element ->
|
||||
episodes.add(
|
||||
Episode(
|
||||
element.select("a").attr("href"),
|
||||
element.select(".BlockTitle").text(),
|
||||
getSeasonFromString(element.select(".BlockTitle").text()),
|
||||
element.select(".EPSNumber").text().getIntFromText(),
|
||||
element.select("img:last-of-type").attr("src")?.ifEmpty { img?.attr("data-src") },
|
||||
null,
|
||||
)
|
||||
)
|
||||
}
|
||||
}
|
||||
}else{
|
||||
doc.select("div.BlockItem").map{ el ->
|
||||
doc.select(".BlockItem").map{ el ->
|
||||
episodes.add(
|
||||
Episode(
|
||||
el.select("a").attr("href"),
|
||||
el.select(".BlockTitle").text(),
|
||||
getSeasonFromString(el.select(".BlockTitle").text()),
|
||||
el.select(".EPSNumber").text().getIntFromText(),
|
||||
el.select("img:last-of-type").attr("src")?.ifEmpty { img?.attr("data-src") },
|
||||
null,
|
||||
)
|
||||
)
|
||||
}
|
||||
|
@ -198,24 +255,21 @@ class Movizland : MainAPI() {
|
|||
}
|
||||
|
||||
newTvSeriesLoadResponse(title, url, TvType.TvSeries, episodes) {
|
||||
/*this.posterUrl = posterUrl
|
||||
this.year = year
|
||||
this.posterUrl = posterUrl?.getFullSize()
|
||||
this.tags = tags
|
||||
this.plot = synopsis
|
||||
addTrailer(trailer)*/
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override suspend fun loadLinks(
|
||||
}
|
||||
override suspend fun loadLinks(
|
||||
data: String,
|
||||
isCasting: Boolean,
|
||||
subtitleCallback: (SubtitleFile) -> Unit,
|
||||
callback: (ExtractorLink) -> Unit
|
||||
): Boolean {
|
||||
val doc = app.get(data).document
|
||||
doc.select("code[id*='Embed'] iframe").apmap {
|
||||
var sourceUrl = it.attr("data-srcout")
|
||||
doc.select("code[id*='Embed'] iframe,.DownloadsList a").apmap {
|
||||
var sourceUrl = it.attr("data-srcout").ifEmpty { it.attr("href") }
|
||||
loadExtractor(sourceUrl, data, subtitleCallback, callback)
|
||||
}
|
||||
return true
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
version = 3
|
||||
version = 4
|
||||
|
||||
cloudstream {
|
||||
description = ""
|
||||
|
|
|
@ -7,5 +7,6 @@ import android.content.Context
|
|||
class MyCimaPlugin: Plugin() {
|
||||
override fun load(context: Context) {
|
||||
registerMainAPI(MyCima())
|
||||
registerExtractorAPI(MyVid())
|
||||
}
|
||||
}
|
32
MyCimaProvider/src/main/kotlin/com/mycima/myvid.kt
Normal file
32
MyCimaProvider/src/main/kotlin/com/mycima/myvid.kt
Normal file
|
@ -0,0 +1,32 @@
|
|||
package com.mycima
|
||||
|
||||
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
|
||||
}
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
version = 6
|
||||
version = 7
|
||||
|
||||
cloudstream {
|
||||
description = ""
|
||||
|
|
|
@ -57,10 +57,6 @@ 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"
|
||||
|
|
|
@ -8,7 +8,7 @@ import org.jsoup.nodes.Element
|
|||
|
||||
class Shahid4u : MainAPI() {
|
||||
override var lang = "ar"
|
||||
override var mainUrl = "https://shahed4u.vip"
|
||||
override var mainUrl = "https://shaheed4u.me/"
|
||||
override var name = "Shahid4u"
|
||||
override val usesWebView = false
|
||||
override val hasMainPage = true
|
||||
|
|
33
Shahid4uProvider/src/main/kotlin/com/shahid4u/gostream.kt
Normal file
33
Shahid4uProvider/src/main/kotlin/com/shahid4u/gostream.kt
Normal file
|
@ -0,0 +1,33 @@
|
|||
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
|
||||
}
|
||||
}
|
46
Shahid4uProvider/src/main/kotlin/com/shahid4u/vidhd.kt
Normal file
46
Shahid4uProvider/src/main/kotlin/com/shahid4u/vidhd.kt
Normal file
|
@ -0,0 +1,46 @@
|
|||
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
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue