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 { 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(
"action" to "_123tv_load_more_videos_from_category", "$mainUrl/wp-admin/admin-ajax.php", data = mapOf(
"cat_id" to request.data, "action" to "_123tv_load_more_videos_from_category",
"page_num" to "${page.minus(1)}" "cat_id" to request.data,
), headers = mapOf( "page_num" to "${page.minus(1)}"
"X-Requested-With" to "XMLHttpRequest" ), headers = mapOf(
)).document "X-Requested-With" to "XMLHttpRequest"
)
).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
)
} }