some fixes for some providers

egybest still broken
This commit is contained in:
Zaw 2022-11-23 20:14:16 +03:00
parent c7bd8bf973
commit c007fefc1a
7 changed files with 68 additions and 38 deletions

View file

@ -1,4 +1,4 @@
version = 1 version = 2
cloudstream { cloudstream {
description = "" description = ""

View file

@ -4,6 +4,8 @@ package com.animeblkom
import com.lagradost.cloudstream3.* import com.lagradost.cloudstream3.*
import com.lagradost.cloudstream3.LoadResponse.Companion.addMalId import com.lagradost.cloudstream3.LoadResponse.Companion.addMalId
import com.lagradost.cloudstream3.utils.ExtractorLink import com.lagradost.cloudstream3.utils.ExtractorLink
import com.lagradost.cloudstream3.utils.Qualities
import com.lagradost.cloudstream3.utils.loadExtractor
import org.jsoup.nodes.Element import org.jsoup.nodes.Element
class AnimeBlkom : MainAPI() { class AnimeBlkom : MainAPI() {
@ -111,11 +113,46 @@ class AnimeBlkom : MainAPI() {
callback: (ExtractorLink) -> Unit callback: (ExtractorLink) -> Unit
): Boolean { ): Boolean {
val doc = app.get(data).document val doc = app.get(data).document
doc.select(".panel .panel-body a").forEach { doc.select("div.item a[data-src]").map {
it.attr("data-src").let { url ->
if(url.startsWith("https://animetitans.net/")) {
val iframe = app.get(url).document
callback.invoke( callback.invoke(
ExtractorLink( ExtractorLink(
this.name, this.name,
it.attr("title") + " " + it.select("small").text(), "Animetitans " + it.text(),
iframe.select("script").last()?.data()?.substringAfter("source: \"")?.substringBefore("\"").toString(),
this.mainUrl,
Qualities.Unknown.value,
isM3u8 = true
)
)
} else if(it.text() == "Blkom") {
val iframe = app.get(url).document
iframe.select("source").forEach { source ->
callback.invoke(
ExtractorLink(
this.name,
it.text(),
source.attr("src"),
this.mainUrl,
source.attr("res").toInt()
)
)
}
} else {
var sourceUrl = url
if(it.text().contains("Google")) sourceUrl = "http://gdriveplayer.to/embed2.php?link=$url"
loadExtractor(sourceUrl, mainUrl, subtitleCallback, callback)
}
}
}
doc.select(".panel .panel-body a").apmap {
println(it.text())
callback.invoke(
ExtractorLink(
this.name,
it.attr("title") + " " + it.select("small").text() + " Download Source",
it.attr("href"), it.attr("href"),
this.mainUrl, this.mainUrl,
it.text().replace("p.*| ".toRegex(),"").toInt(), it.text().replace("p.*| ".toRegex(),"").toInt(),

View file

@ -1,4 +1,4 @@
version = 1 version = 2
cloudstream { cloudstream {
description = "" description = ""

View file

@ -116,7 +116,7 @@ class Animeiat : MainAPI() {
) )
override suspend fun load(url: String): LoadResponse { override suspend fun load(url: String): LoadResponse {
val loadSession = Requests() val loadSession = Requests()
val request = loadSession.get(url).text val request = loadSession.get(url.replace(pageUrl, mainUrl)).text
val json = parseJson<Load>(request) val json = parseJson<Load>(request)
val episodes = arrayListOf<Episode>() val episodes = arrayListOf<Episode>()
(1..parseJson<Episodes>(loadSession.get("$url/episodes").text).meta.lastPage!!).map { pageNumber -> (1..parseJson<Episodes>(loadSession.get("$url/episodes").text).meta.lastPage!!).map { pageNumber ->
@ -134,7 +134,7 @@ class Animeiat : MainAPI() {
} }
} }
return newAnimeLoadResponse(json.data?.animeName.toString(), "$pageUrl/watch/"+json.data?.slug, if(json.data?.type == "movie") TvType.AnimeMovie else if(json.data?.type == "tv") TvType.Anime else TvType.OVA) { return newAnimeLoadResponse(json.data?.animeName.toString(), "$pageUrl/watch/"+json.data?.slug, if(json.data?.type == "movie") TvType.AnimeMovie else if(json.data?.type == "tv") TvType.Anime else TvType.OVA) {
japName = json.data?.otherNames?.split("\n")?.get(1) japName = json.data?.otherNames?.replace("\\n.*".toRegex(), "")
engName = json.data?.animeName engName = json.data?.animeName
posterUrl = "https://api.animeiat.co/storage/" + json.data?.posterPath posterUrl = "https://api.animeiat.co/storage/" + json.data?.posterPath
this.year = json.data?.year?.name?.toIntOrNull() this.year = json.data?.year?.name?.toIntOrNull()

View file

@ -37,7 +37,7 @@ fun String.runJS(variableName: String): String {
class EgyBest : MainAPI() { class EgyBest : MainAPI() {
override var lang = "ar" override var lang = "ar"
override var mainUrl = "https://www.egy.best" override var mainUrl = "https://egybest.org"
override var name = "EgyBest" override var name = "EgyBest"
var pssid = "" var pssid = ""
override val usesWebView = false override val usesWebView = false
@ -60,7 +60,7 @@ class EgyBest : MainAPI() {
// If you need to differentiate use the url. // If you need to differentiate use the url.
return MovieSearchResponse( return MovieSearchResponse(
title, title,
url, mainUrl + url,
this@EgyBest.name, this@EgyBest.name,
tvType, tvType,
posterUrl, posterUrl,
@ -102,9 +102,8 @@ class EgyBest : MainAPI() {
} }
override suspend fun search(query: String): List<SearchResponse> { override suspend fun search(query: String): List<SearchResponse> {
val q = query.replace(" ","%20")
val result = arrayListOf<SearchResponse>() val result = arrayListOf<SearchResponse>()
listOf("$mainUrl/explore/?q=$q").apmap { url -> listOf("$mainUrl/explore/?q=$query").apmap { url ->
val d = app.get(url).document val d = app.get(url).document
d.select("div.movies a").not("a.auto.load.btn.b").mapNotNull { d.select("div.movies a").not("a.auto.load.btn.b").mapNotNull {
it.toSearchResponse()?.let { it1 -> result.add(it1) } it.toSearchResponse()?.let { it1 -> result.add(it1) }
@ -118,7 +117,7 @@ class EgyBest : MainAPI() {
} }
override suspend fun load(url: String): LoadResponse { override suspend fun load(url: String): LoadResponse {
val doc = app.get(mainUrl + url).document val doc = app.get(url).document
val isMovie = Regex(".*/movie/.*|.*/masrahiya/.*").matches(url) val isMovie = Regex(".*/movie/.*|.*/masrahiya/.*").matches(url)
val posterUrl = doc.select("div.movie_img a img")?.attr("src") val posterUrl = doc.select("div.movie_img a img")?.attr("src")
val year = doc.select("div.movie_title h1 a")?.text()?.toIntOrNull() val year = doc.select("div.movie_title h1 a")?.text()?.toIntOrNull()
@ -172,7 +171,7 @@ class EgyBest : MainAPI() {
val ep = Regex("ep-(.....)").find(element.select(".ep_title a").attr("href"))?.groupValues?.getOrNull(1)?.getIntFromText() val ep = Regex("ep-(.....)").find(element.select(".ep_title a").attr("href"))?.groupValues?.getOrNull(1)?.getIntFromText()
episodes.add( episodes.add(
Episode( Episode(
element.select(".ep_title a").attr("href"), mainUrl + element.select(".ep_title a").attr("href"),
name = element.select("td.ep_title").html().replace(".*</span>|</a>".toRegex(), ""), name = element.select("td.ep_title").html().replace(".*</span>|</a>".toRegex(), ""),
season, season,
ep, ep,
@ -185,7 +184,7 @@ class EgyBest : MainAPI() {
val ep = Regex("ep-(.....)").find(eit.attr("href"))?.groupValues?.getOrNull(1)?.getIntFromText() val ep = Regex("ep-(.....)").find(eit.attr("href"))?.groupValues?.getOrNull(1)?.getIntFromText()
episodes.add( episodes.add(
Episode( Episode(
eit.attr("href"), mainUrl + eit.attr("href"),
eit.select("span.title").text(), eit.select("span.title").text(),
season, season,
ep, ep,

View file

@ -1,7 +1,7 @@
version = 1 version = 2
cloudstream { cloudstream {
description = "" description = "Not recommended for series."
authors = listOf( "Spoonge" ) authors = listOf( "Spoonge" )
language = "ar" language = "ar"

View file

@ -46,7 +46,9 @@ class Movizland : MainAPI() {
private fun Element.toSearchResponse(): SearchResponse? { private fun Element.toSearchResponse(): SearchResponse? {
val url = select(".BlockItem") val url = select(".BlockItem")
val title = url.select(".BlockTitle").text().cleanTitle() val title = url.select(".BlockTitle").text().cleanTitle()
val posterUrl = if (url.select(".BlockTitle").text().contains("فيلم")) {select(".BlockImageItem img")?.attr("src")} else {select(".BlockImageItem > img:nth-child(3)")?.attr("src")} val posterUrl = select(".BlockImageItem img")?.attr("src")?.ifEmpty {
select(".BlockImageItem img")[1].attr("src")
}
val year = select(".InfoEndBlock li").last()?.text()?.getIntFromText() val year = select(".InfoEndBlock li").last()?.text()?.getIntFromText()
var quality = select(".RestInformation li").last()?.text()?.replace(" |-|1080p|720p".toRegex(), "") var quality = select(".RestInformation li").last()?.text()?.replace(" |-|1080p|720p".toRegex(), "")
?.replace("WEB DL","WEBDL")?.replace("BluRay","BLURAY") ?.replace("WEB DL","WEBDL")?.replace("BluRay","BLURAY")
@ -76,20 +78,12 @@ class Movizland : MainAPI() {
} }
override suspend fun search(query: String): List<SearchResponse> { override suspend fun search(query: String): List<SearchResponse> {
val q = query.replace(" ".toRegex(), "%20") val d = app.get("$mainUrl/?s=$query").document
val result = arrayListOf<SearchResponse>() return d.select("div.BlockItem").mapNotNull {
listOf( if(it.select(".BlockTitle").text().contains("الحلقة")) return@mapNotNull null;
"$mainUrl/category/movies/?s=$q", it.toSearchResponse()
"$mainUrl/series/?searching=$q"
).apmap { url ->
val d = app.get(url).document
d.select("div.BlockItem").mapNotNull {
//if (!it.text().contains("فيلم||موسم")) return@mapNotNull null
it.toSearchResponse()?.let { it1 -> result.add(it1) }
} }
} }
return result.distinct().sortedBy { it.name }
}
private fun getSeasonFromString(tit: String): Int { private fun getSeasonFromString(tit: String): Int {
if(tit.contains("الموسم الاول".toRegex())){ return 1 } if(tit.contains("الموسم الاول".toRegex())){ return 1 }
@ -119,10 +113,12 @@ class Movizland : MainAPI() {
override suspend fun load(url: String): LoadResponse { override suspend fun load(url: String): LoadResponse {
var doc = app.get(url).document var doc = app.get(url).document
val sdetails = doc.select(".SingleDetails") val sdetails = doc.select(".SingleDetails")
val posterUrl = sdetails.select("img")?.attr("data-src") val posterUrl = sdetails.select(".Poster img").attr("data-src").ifEmpty {
sdetails.select(".BlockItem").last()?.select(".Poster img")?.attr("src")
}
val year = sdetails.select("li:has(.fa-clock) a").text()?.getIntFromText() val year = sdetails.select("li:has(.fa-clock) a").text()?.getIntFromText()
val title = doc.select("h2.postTitle").text().cleanTitle() val title = doc.select("h2.postTitle").text().cleanTitle()
val isMovie = if(doc.select("h2.postTitle").text().contains("عرض|فيلم".toRegex())) true else false val isMovie = doc.select("h2.postTitle").text().contains("عرض|فيلم".toRegex())
val synopsis = doc.select("section.story").text() val synopsis = doc.select("section.story").text()
val trailer = doc.select("div.InnerTrailer iframe").attr("data-src") val trailer = doc.select("div.InnerTrailer iframe").attr("data-src")
val tags = sdetails.select("li:has(.fa-film) a").map{ it.text() } val tags = sdetails.select("li:has(.fa-film) a").map{ it.text() }
@ -147,14 +143,12 @@ class Movizland : MainAPI() {
val refererUrl = doc.select("body > header > div > div.Logo > a").attr("href") val refererUrl = doc.select("body > header > div > div.Logo > a").attr("href")
if(doc.select(".BlockItem a").attr("href").contains("/series/")){//seasons if(doc.select(".BlockItem a").attr("href").contains("/series/")){//seasons
doc.select(".BlockItem").map { seas -> doc.select(".BlockItem").map { seas ->
seas.select("a").attr("href") }.apmap{ seas.select("a").attr("href") }.apmap{ pageIt ->
val Sedoc = app.get(it).document val Sedoc = app.get(pageIt).document
val pagEl = Sedoc.select(".pagination > div > ul > li.active > a").isNotEmpty() val pagEl = Sedoc.select(".pagination > div > ul > li").isNotEmpty()
val pagSt = if(pagEl) true else false if(pagEl) {
if(pagSt){ Sedoc.select(".pagination > div > ul > li:nth-child(n):not(:last-child) a").apmap {
Sedoc.select(".pagination > div > ul > li:nth-child(n):not(:last-child) a").map{ eppages -> val epidoc = app.get(it.attr("href")).document
eppages.attr("href") }.apmap{
val epidoc = app.get(it).document
epidoc.select("div.BlockItem").map{ element -> epidoc.select("div.BlockItem").map{ element ->
episodes.add( episodes.add(
Episode( Episode(