updated idlix

This commit is contained in:
hexated 2022-09-30 16:02:16 +07:00
parent 7cc37e316f
commit fa0ee2866f
2 changed files with 19 additions and 5 deletions

View file

@ -1,5 +1,5 @@
// use an integer for version numbers
version = 2
version = 3
cloudstream {
@ -20,6 +20,8 @@ cloudstream {
tvTypes = listOf(
"TvSeries",
"Movie",
"Anime",
"AsianDrama",
)
iconUrl = "https://www.google.com/s2/favicons?domain=94.103.82.88&sz=%size%"

View file

@ -19,15 +19,19 @@ class IdlixProvider : MainAPI() {
override val supportedTypes = setOf(
TvType.Movie,
TvType.TvSeries,
TvType.Anime,
TvType.AsianDrama
)
override val mainPage = mainPageOf(
"$mainUrl/" to "Featured",
"$mainUrl/trending/page/?get=movies" to "Trending Movies",
"$mainUrl/trending/page/?get=tv" to "Trending TV Series",
"$mainUrl/movie/page/" to "Movie Terbaru",
"$mainUrl/tvseries/page/" to "TV Series Terbaru",
"$mainUrl/season/page/" to "Season Terbaru",
"$mainUrl/episode/page/" to "Episode Terbaru",
"$mainUrl/network/netflix/page/" to "Netflix",
"$mainUrl/genre/anime/page/" to "Anime",
"$mainUrl/genre/drama-korea/page/" to "Drama Korea",
)
override suspend fun getMainPage(
@ -35,8 +39,16 @@ class IdlixProvider : MainAPI() {
request: MainPageRequest
): HomePageResponse {
val url = request.data.split("?")
val document = app.get("${url.first()}$page/?${url.lastOrNull()}").document
val home = document.select("div.items.full article, div#archive-content article").mapNotNull {
val document = if (request.name == "Featured") {
app.get(request.data).document
} else {
app.get("${url.first()}$page/?${url.lastOrNull()}").document
}
val home = (if (request.name == "Featured") {
document.select("div.items.featured article")
} else {
document.select("div.items.full article, div#archive-content article")
}).mapNotNull {
it.toSearchResult()
}
return newHomePageResponse(request.name, home)