New homepage Sflix

master
Swissky 2024-06-30 22:24:16 +02:00
parent f5bcdeebff
commit 208663513b
2 changed files with 34 additions and 4 deletions

View File

@ -2,17 +2,15 @@
> Attempt to write some plugins for cloudstream > Attempt to write some plugins for cloudstream
Mnemosyne provider
* Sflix (WIP from scratch) :x: * Sflix (WIP from scratch) :x:
* HiAnime (from Rowdy-Avocado) :white_check_mark: * HiAnime (from Rowdy-Avocado) :white_check_mark:
* Aniwave (from Rowdy-Avocado) :white_check_mark: * Aniwave (from Rowdy-Avocado) :white_check_mark:
* SuperStream (from Hexated) :white_check_mark: * SuperStream (from Hexated) :white_check_mark:
* SoraStream (from Hexated) :white_check_mark:
* ZoroTV (TODO from scratch) :x: * ZoroTV (TODO from scratch) :x:
* Onstream (TODO from scratch) :x: * Onstream (TODO from scratch) :x:
* SoraStream (from Hexated) :x:
* HDToday :x: * HDToday :x:

View File

@ -53,7 +53,7 @@ class ExampleProvider(val plugin: TestPlugin) : MainAPI() {
} }
override val mainPage = mainPageOf( /*override val mainPage = mainPageOf(
"tv-show" to "TV Show", "tv-show" to "TV Show",
"movie" to "Movie", "movie" to "Movie",
"top-imdb" to "Top-IMDB", "top-imdb" to "Top-IMDB",
@ -83,6 +83,38 @@ class ExampleProvider(val plugin: TestPlugin) : MainAPI() {
), ),
hasNext = true hasNext = true
) )
}*/
override suspend fun getMainPage(page: Int, request: MainPageRequest): HomePageResponse {
val html = app.get("$mainUrl/home").text
val document = Jsoup.parse(html)
val all = ArrayList<HomePageList>()
val map = mapOf(
"Trending Movies" to "div#trending-movies",
"Trending TV Shows" to "div#trending-tv",
// "Latest Movies" to "div#trending-tv", // film_list-wrap
// "Latest TV Shows" to "div#trending-tv", // film_list-wrap
)
map.forEach {
all.add(HomePageList(
it.key,
document.select(it.value).select("div.flw-item").map { element ->
element.toSearchResult()
}
))
}
document.select("section.block_area.block_area_home.section-id-02").forEach {
val title = it.select("h2.cat-heading").text().trim()
val elements = it.select("div.flw-item").map { element ->
element.toSearchResult()
}
all.add(HomePageList(title, elements))
}
return HomePageResponse(all)
} }