Egybest fixes (#993)

fix for media links
fix for episodes table new layout
This commit is contained in:
Zaw 2022-04-25 00:26:09 +03:00 committed by GitHub
parent 7adc6f6cb1
commit ea7dfdad5a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -44,7 +44,7 @@ class EgyBestProvider : MainAPI() {
// url, title // url, title
val doc = app.get(mainUrl).document val doc = app.get(mainUrl).document
val pages = arrayListOf<HomePageList>() val pages = arrayListOf<HomePageList>()
doc.select("#mainLoad div.mbox").apmap { doc.select("#mainLoad div.mbox").apmap {
val name = it.select(".bdb.pda > strong").text() val name = it.select(".bdb.pda > strong").text()
if (it.select(".movie").first().attr("href").contains("season-(.....)|ep-(.....)".toRegex())) return@apmap if (it.select(".movie").first().attr("href").contains("season-(.....)|ep-(.....)".toRegex())) return@apmap
val list = arrayListOf<SearchResponse>() val list = arrayListOf<SearchResponse>()
@ -120,16 +120,31 @@ class EgyBestProvider : MainAPI() {
}.apmap { }.apmap {
val d = app.get(it).document val d = app.get(it).document
val season = Regex("season-(.....)").find(it)?.groupValues?.getOrNull(1)?.getIntFromText() val season = Regex("season-(.....)").find(it)?.groupValues?.getOrNull(1)?.getIntFromText()
d.select("#mainLoad > div:nth-child(3) > div.movies_small a").map { eit -> if(d.select("tr.published").isNotEmpty()) {
val ep = Regex("ep-(.....)").find(eit.attr("href"))?.groupValues?.getOrNull(1)?.getIntFromText() d.select("tr.published").map { element ->
episodes.add( val ep = Regex("ep-(.....)").find(element.select(".ep_title a").attr("href"))?.groupValues?.getOrNull(1)?.getIntFromText()
Episode( episodes.add(
eit.attr("href"), Episode(
eit.select("span.title").text(), element.select(".ep_title a").attr("href"),
season, name = element.select("td.ep_title").html().replace(".*</span>|</a>".toRegex(), ""),
ep, 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 }) { newTvSeriesLoadResponse(title, url, TvType.TvSeries, episodes.distinct().sortedBy { it.episode }) {
@ -151,21 +166,21 @@ class EgyBestProvider : MainAPI() {
subtitleCallback: (SubtitleFile) -> Unit, subtitleCallback: (SubtitleFile) -> Unit,
callback: (ExtractorLink) -> Unit callback: (ExtractorLink) -> Unit
): Boolean { ): Boolean {
val requestJSON = app.get("https://zawmedia-api.herokuapp.com/egybest?url=$data").text val requestJSON = app.get("https://api.zr5.repl.co/egybest?url=$data").text
val jsonArray = parseJson<List<Sources>>(requestJSON) val jsonArray = parseJson<List<Sources>>(requestJSON)
for (i in jsonArray) { for (i in jsonArray) {
val quality = i.quality val quality = i.quality
val link = i.link val link = i.link
callback.invoke( callback.invoke(
ExtractorLink( ExtractorLink(
this.name, this.name,
this.name + " ${quality}p", this.name,
link, link,
this.mainUrl, this.mainUrl,
2, quality!!,
true true
)
) )
)
} }
return true return true
} }