fixed Filman

This commit is contained in:
Blatzar 2022-07-25 20:35:44 +02:00
parent 8aeefaa82d
commit 0a97217ce8

View file

@ -18,9 +18,8 @@ class FilmanProvider : MainAPI() {
) )
override suspend fun getMainPage(): HomePageResponse { override suspend fun getMainPage(): HomePageResponse {
val response = app.get(mainUrl).text val document = app.get(mainUrl).document
val document = Jsoup.parse(response) val lists = document.select("div#item-list")
val lists = document.select(".item-list,.series-list")
val categories = ArrayList<HomePageList>() val categories = ArrayList<HomePageList>()
for (l in lists) { for (l in lists) {
val title = l.parent()!!.select("h3").text() val title = l.parent()!!.select("h3").text()
@ -53,17 +52,16 @@ class FilmanProvider : MainAPI() {
override suspend fun search(query: String): List<SearchResponse> { override suspend fun search(query: String): List<SearchResponse> {
val url = "$mainUrl/wyszukiwarka?phrase=$query" val url = "$mainUrl/wyszukiwarka?phrase=$query"
val response = app.get(url).text val document = app.get(url).document
val document = Jsoup.parse(response) val lists = document.select("div#item-list")
val lists = document.select("#advanced-search > div") val movies = lists[0].select(".poster > a")
val movies = lists[1].select(".item") val series = lists[1].select(".poster > a")
val series = lists[3].select(".item")
if (movies.isEmpty() && series.isEmpty()) return ArrayList() if (movies.isEmpty() && series.isEmpty()) return ArrayList()
fun getVideos(type: TvType, items: Elements): List<SearchResponse> { fun getVideos(type: TvType, items: Elements): List<SearchResponse> {
return items.map { i -> return items.map { i ->
val href = i.attr("href") val href = i.attr("href")
val img = i.selectFirst("> img")!!.attr("src").replace("/thumb/", "/big/") 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) { if (type === TvType.TvSeries) {
TvSeriesSearchResponse( TvSeriesSearchResponse(
name, name,
@ -83,8 +81,7 @@ class FilmanProvider : MainAPI() {
} }
override suspend fun load(url: String): LoadResponse { override suspend fun load(url: String): LoadResponse {
val response = app.get(url).text val document = app.get(url).document
val document = Jsoup.parse(response)
val documentTitle = document.select("title").text().trim() val documentTitle = document.select("title").text().trim()
if (documentTitle.startsWith("Logowanie")) { if (documentTitle.startsWith("Logowanie")) {