From 0a97217ce8fef36062256d42a18e670b3471c7ec Mon Sep 17 00:00:00 2001 From: Blatzar <46196380+Blatzar@users.noreply.github.com> Date: Mon, 25 Jul 2022 20:35:44 +0200 Subject: [PATCH] fixed Filman --- .../movieproviders/FilmanProvider.kt | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/app/src/main/java/com/lagradost/cloudstream3/movieproviders/FilmanProvider.kt b/app/src/main/java/com/lagradost/cloudstream3/movieproviders/FilmanProvider.kt index 8561568e..e5738de4 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/movieproviders/FilmanProvider.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/movieproviders/FilmanProvider.kt @@ -18,9 +18,8 @@ class FilmanProvider : MainAPI() { ) override suspend fun getMainPage(): HomePageResponse { - val response = app.get(mainUrl).text - val document = Jsoup.parse(response) - val lists = document.select(".item-list,.series-list") + val document = app.get(mainUrl).document + val lists = document.select("div#item-list") val categories = ArrayList() for (l in lists) { val title = l.parent()!!.select("h3").text() @@ -53,17 +52,16 @@ class FilmanProvider : MainAPI() { override suspend fun search(query: String): List { val url = "$mainUrl/wyszukiwarka?phrase=$query" - val response = app.get(url).text - val document = Jsoup.parse(response) - val lists = document.select("#advanced-search > div") - val movies = lists[1].select(".item") - val series = lists[3].select(".item") + val document = app.get(url).document + val lists = document.select("div#item-list") + val movies = lists[0].select(".poster > a") + val series = lists[1].select(".poster > a") if (movies.isEmpty() && series.isEmpty()) return ArrayList() fun getVideos(type: TvType, items: Elements): List { return items.map { i -> val href = i.attr("href") val img = i.selectFirst("> img")!!.attr("src").replace("/thumb/", "/big/") - val name = i.selectFirst(".title")!!.text() + val name = i.attr("title") if (type === TvType.TvSeries) { TvSeriesSearchResponse( name, @@ -83,8 +81,7 @@ class FilmanProvider : MainAPI() { } override suspend fun load(url: String): LoadResponse { - val response = app.get(url).text - val document = Jsoup.parse(response) + val document = app.get(url).document val documentTitle = document.select("title").text().trim() if (documentTitle.startsWith("Logowanie")) {