fixed home 123tv

This commit is contained in:
hexated 2022-09-22 00:00:49 +07:00
parent 22bf305a59
commit 3a8810ff2c

View file

@ -31,20 +31,29 @@ 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(
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
)
).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
)
}