fixed home 123tv

This commit is contained in:
hexated 2022-09-22 00:00:49 +07:00
parent 22bf305a59
commit 3a8810ff2c
1 changed files with 18 additions and 9 deletions

View File

@ -30,21 +30,30 @@ class OnetwothreeTv : MainAPI() {
override suspend fun getMainPage(page: Int, request: MainPageRequest): HomePageResponse {
val document = if(request.name.contains("USA")) {
app.post( "$mainUrl/wp-admin/admin-ajax.php" , data = mapOf(
"action" to "_123tv_load_more_videos_from_category",
"cat_id" to request.data,
"page_num" to "${page.minus(1)}"
), headers = mapOf(
"X-Requested-With" to "XMLHttpRequest"
)).document
val document = if (request.name.contains("USA")) {
app.post(
"$mainUrl/wp-admin/admin-ajax.php", data = mapOf(
"action" to "_123tv_load_more_videos_from_category",
"cat_id" to request.data,
"page_num" to "${page.minus(1)}"
), headers = mapOf(
"X-Requested-With" to "XMLHttpRequest"
)
).document
} else {
app.get(request.data).document
}
val home = document.select("div.col-md-3.col-sm-6").mapNotNull {
it.toSearchResult()
}
return newHomePageResponse(request.name, home)
return newHomePageResponse(
list = HomePageList(
name = request.name,
list = home,
isHorizontalImages = true
),
hasNext = true
)
}