mirror of
https://github.com/hexated/cloudstream-extensions-hexated.git
synced 2024-08-15 00:03:22 +00:00
fixed home 123tv
This commit is contained in:
parent
22bf305a59
commit
3a8810ff2c
1 changed files with 18 additions and 9 deletions
|
@ -30,21 +30,30 @@ class OnetwothreeTv : MainAPI() {
|
||||||
|
|
||||||
override suspend fun getMainPage(page: Int, request: MainPageRequest): HomePageResponse {
|
override suspend fun getMainPage(page: Int, request: MainPageRequest): HomePageResponse {
|
||||||
|
|
||||||
val document = if(request.name.contains("USA")) {
|
val document = if (request.name.contains("USA")) {
|
||||||
app.post( "$mainUrl/wp-admin/admin-ajax.php" , data = mapOf(
|
app.post(
|
||||||
|
"$mainUrl/wp-admin/admin-ajax.php", data = mapOf(
|
||||||
"action" to "_123tv_load_more_videos_from_category",
|
"action" to "_123tv_load_more_videos_from_category",
|
||||||
"cat_id" to request.data,
|
"cat_id" to request.data,
|
||||||
"page_num" to "${page.minus(1)}"
|
"page_num" to "${page.minus(1)}"
|
||||||
), headers = mapOf(
|
), headers = mapOf(
|
||||||
"X-Requested-With" to "XMLHttpRequest"
|
"X-Requested-With" to "XMLHttpRequest"
|
||||||
)).document
|
)
|
||||||
|
).document
|
||||||
} else {
|
} else {
|
||||||
app.get(request.data).document
|
app.get(request.data).document
|
||||||
}
|
}
|
||||||
val home = document.select("div.col-md-3.col-sm-6").mapNotNull {
|
val home = document.select("div.col-md-3.col-sm-6").mapNotNull {
|
||||||
it.toSearchResult()
|
it.toSearchResult()
|
||||||
}
|
}
|
||||||
return newHomePageResponse(request.name, home)
|
return newHomePageResponse(
|
||||||
|
list = HomePageList(
|
||||||
|
name = request.name,
|
||||||
|
list = home,
|
||||||
|
isHorizontalImages = true
|
||||||
|
),
|
||||||
|
hasNext = true
|
||||||
|
)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue