mirror of
https://github.com/hexated/cloudstream-extensions-hexated.git
synced 2024-08-15 00:03:22 +00:00
updated idlix
This commit is contained in:
parent
c9d20f4d7b
commit
40e1ddfc6e
2 changed files with 19 additions and 5 deletions
|
@ -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%"
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue