2
1
Fork 1
mirror of https://github.com/yoyzo/arab synced 2024-08-15 03:15:00 +00:00

Fushar fixes

Some fixes
This commit is contained in:
Zaw 2022-09-08 18:57:33 +03:00 committed by GitHub
commit 5a398caf08
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -39,24 +39,29 @@ class Fushaar : MainAPI() {
} }
override val mainPage = mainPageOf( override val mainPage = mainPageOf(
"$mainUrl/page/" to "Movies", "$mainUrl/page/" to "Movies|أفلام",
"$mainUrl/gerne/action/page/" to "Action", "$mainUrl/gerne/action/page/" to "Action|إثارة",
"$mainUrl/gerne/adventure/page/" to "Adventure", "$mainUrl/gerne/adventure/page/" to "Adventure|مغامرة",
"$mainUrl/gerne/animation/page/" to "Animation", "$mainUrl/gerne/animation/page/" to "Animation|أنيمايشن",
"$mainUrl/gerne/biography/page/" to "Biography", "$mainUrl/gerne/biography/page/" to "Biography|سيرة",
"$mainUrl/gerne/comedy/page/" to "Comedy", "$mainUrl/gerne/comedy/page/" to "Comedy|كوميديا",
"$mainUrl/gerne/crime/page/" to "Crime", "$mainUrl/gerne/crime/page/" to "Crime|جريمة",
"$mainUrl/gerne/documentary/page/" to "Documentary", "$mainUrl/gerne/documentary/page/" to "Documentary|وثائقي",
"$mainUrl/gerne/drama/page/" to "Drama", "$mainUrl/gerne/drama/page/" to "Drama|دراما",
"$mainUrl/gerne/family/page/" to "Family", "$mainUrl/gerne/family/page/" to "Family|عائلي",
"$mainUrl/gerne/herror/page/" to "Herror", "$mainUrl/gerne/fantasy/page/" to "Fantasy|فنتازيا",
"$mainUrl/gerne/history/page/" to "History", "$mainUrl/gerne/herror/page/" to "Herror|رعب",
"$mainUrl/gerne/music/page/" to "Music", "$mainUrl/gerne/history/page/" to "History|تاريخي",
"$mainUrl/gerne/mystery/page/" to "Mystery", "$mainUrl/gerne/music/page/" to "Music|موسيقى",
"$mainUrl/gerne/romance/page/" to "Romance", "$mainUrl/gerne/musical/page/" to "Musical|موسيقي",
"$mainUrl/gerne/sci-fi/page/" to "Sci-fi", "$mainUrl/gerne/mystery/page/" to "Mystery|غموض",
"$mainUrl/gerne/sport/page/" to "Sport", "$mainUrl/gerne/romance/page/" to "Romance|رومنسي",
"$mainUrl/gerne/thriller/page/" to "Thriller", "$mainUrl/gerne/sci-fi/page/" to "Sci-fi|خيال علمي",
"$mainUrl/gerne/short/page/" to "Short|قصير",
"$mainUrl/gerne/sport/page/" to "Sport|رياضة",
"$mainUrl/gerne/thriller/page/" to "Thriller|روائي",
"$mainUrl/gerne/war/page/" to "War|حرب",
"$mainUrl/gerne/western/page/" to "Western|غربي",
) )
override suspend fun getMainPage(page: Int, request : MainPageRequest): HomePageResponse { override suspend fun getMainPage(page: Int, request : MainPageRequest): HomePageResponse {
@ -68,7 +73,7 @@ class Fushaar : MainAPI() {
} }
override suspend fun search(query: String): List<SearchResponse> { override suspend fun search(query: String): List<SearchResponse> {
val q = query.replace(" ", "%20") val q = query.replace(" ", "+")
return app.get("$mainUrl/?s=$q").document.select("article.poster").mapNotNull { return app.get("$mainUrl/?s=$q").document.select("article.poster").mapNotNull {
it.toSearchResponse() it.toSearchResponse()
} }
@ -82,8 +87,11 @@ class Fushaar : MainAPI() {
val title = doc.select("header h1").text()+"\n"+doc.select("header h2").text() val title = doc.select("header h1").text()+"\n"+doc.select("header h2").text()
val synopsis = doc.select("div.postz").text() val synopsis = doc.select("div.postz").text()
val trailer = doc.select("div.rll-youtube-player iframe").attr("src") val trailer = doc.select("div.rll-youtube-player iframe").attr("src")
val tags = doc.select("div.z-info li").map { it.text() } val tags = doc.select("li.iifo").map { it.select("span.z-s-i").text()+" "+it.select("h8").text() }
val rating = doc.select("body > div.new-info.hide-mobile > div > div.z-imdb > div").text()?.toRatingInt()
val recommendations = doc.select("article.poster").mapNotNull { element ->
element.toSearchResponse()
}
return newMovieLoadResponse( return newMovieLoadResponse(
title, title,
@ -95,6 +103,8 @@ class Fushaar : MainAPI() {
this.year = year this.year = year
this.tags = tags this.tags = tags
this.plot = synopsis this.plot = synopsis
this.rating = rating
this.recommendations = recommendations
addTrailer(trailer) addTrailer(trailer)
} }
} }
@ -107,15 +117,14 @@ class Fushaar : MainAPI() {
callback: (ExtractorLink) -> Unit callback: (ExtractorLink) -> Unit
): Boolean { ): Boolean {
app.get(data).document app.get(data).document
.select("#fancyboxID-8 > script").map { .select("#fancyboxID-download > center > a:nth-child(n+19),#fancyboxID-1 > center > a:nth-child(n+16)").map {
callback.invoke( callback.invoke(
ExtractorLink( ExtractorLink(
source = this.name, source = this.name,
name = name, name = name,
url = it.html().substring(252,384), url = it.attr("href"),
referer = this.mainUrl, referer = this.mainUrl,
quality = Qualities.Unknown.value, quality = it.text().getIntFromText() ?: Qualities.Unknown.value,
isM3u8 = true
) )
) )
} }