Fix egybest (#939)

* fixes, added quality to SearchResponse

* more qualities
This commit is contained in:
Zaw 2022-04-11 17:16:22 +03:00 committed by GitHub
parent d4ddab83e4
commit a975e5cf4b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 17 additions and 6 deletions

View file

@ -587,17 +587,22 @@ fun getQualityFromString(string: String?): SearchQuality? {
"cam" -> SearchQuality.Cam
"camrip" -> SearchQuality.CamRip
"hdcam" -> SearchQuality.HdCam
"hdtc" -> SearchQuality.HdCam
"hdts" -> SearchQuality.HdCam
"highquality" -> SearchQuality.HQ
"hq" -> SearchQuality.HQ
"highdefinition" -> SearchQuality.HD
"hdrip" -> SearchQuality.HD
"hd" -> SearchQuality.HD
"hdtv" -> SearchQuality.HD
"rip" -> SearchQuality.CamRip
"telecine" -> SearchQuality.Telecine
"tc" -> SearchQuality.Telecine
"telesync" -> SearchQuality.Telesync
"ts" -> SearchQuality.Telesync
"dvd" -> SearchQuality.DVD
"dvdrip" -> SearchQuality.DVD
"dvdscr" -> SearchQuality.DVD
"blueray" -> SearchQuality.BlueRay
"bluray" -> SearchQuality.BlueRay
"br" -> SearchQuality.BlueRay
@ -609,6 +614,7 @@ fun getQualityFromString(string: String?): SearchQuality? {
"wp" -> SearchQuality.WorkPrint
"workprint" -> SearchQuality.WorkPrint
"webrip" -> SearchQuality.WebRip
"webdl" -> SearchQuality.WebRip
"web" -> SearchQuality.WebRip
"hdr" -> SearchQuality.HDR
"sdr" -> SearchQuality.SDR

View file

@ -8,7 +8,7 @@ import org.jsoup.nodes.Element
class EgyBestProvider : MainAPI() {
override val lang = "ar"
override var mainUrl = "https://egy.best"
override var mainUrl = "https://www.egy.best"
override var name = "EgyBest"
override val usesWebView = false
override val hasMainPage = true
@ -26,6 +26,7 @@ class EgyBestProvider : MainAPI() {
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,
@ -35,18 +36,22 @@ class EgyBestProvider : MainAPI() {
posterUrl,
year,
null,
quality = getQualityFromString(quality)
)
}
override suspend fun getMainPage(): HomePageResponse {
// url, title
val doc = app.get(mainUrl).document
val pages = doc.select("#mainLoad div.mbox").apmap {
val pages = arrayListOf<HomePageList>()
doc.select("#mainLoad div.mbox").apmap {
val name = it.select(".bdb.pda > strong").text()
val list = it.select(".movie").mapNotNull { element ->
element.toSearchResponse()
if (it.select(".movie").first().attr("href").contains("season-(.....)|ep-(.....)".toRegex())) return@apmap
val list = arrayListOf<SearchResponse>()
it.select(".movie").map { element ->
list.add(element.toSearchResponse()!!)
}
HomePageList(name, list)
pages.add(HomePageList(name, list))
}
return HomePageResponse(pages)
}
@ -72,7 +77,7 @@ class EgyBestProvider : MainAPI() {
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[itemprop=\"name\"]").text()
val title = doc.select("div.movie_title h1 span").text()
val synopsis = doc.select("div.mbox").firstOrNull {
it.text().contains("القصة")