mirror of
https://github.com/recloudstream/cloudstream-extensions-multilingual.git
synced 2024-08-15 03:15:14 +00:00
Applied PR changes
This commit is contained in:
parent
4956581cbc
commit
e52b320927
2 changed files with 39 additions and 51 deletions
|
@ -23,5 +23,5 @@ cloudstream {
|
||||||
"AsianDrama",
|
"AsianDrama",
|
||||||
)
|
)
|
||||||
|
|
||||||
iconUrl = "https://www.google.com/s2/favicons?domain=pinoymovieshub.ph&sz=%size%"
|
iconUrl = "https://www.google.com/s2/favicons?domain=www.pinoymovieshub.ph&sz=%size%"
|
||||||
}
|
}
|
|
@ -3,7 +3,6 @@ package com.lagradost
|
||||||
import android.util.Log
|
import android.util.Log
|
||||||
import com.fasterxml.jackson.annotation.JsonProperty
|
import com.fasterxml.jackson.annotation.JsonProperty
|
||||||
import com.lagradost.cloudstream3.*
|
import com.lagradost.cloudstream3.*
|
||||||
import com.lagradost.cloudstream3.mvvm.logError
|
|
||||||
import com.lagradost.cloudstream3.utils.AppUtils
|
import com.lagradost.cloudstream3.utils.AppUtils
|
||||||
import com.lagradost.cloudstream3.utils.ExtractorLink
|
import com.lagradost.cloudstream3.utils.ExtractorLink
|
||||||
import com.lagradost.cloudstream3.utils.loadExtractor
|
import com.lagradost.cloudstream3.utils.loadExtractor
|
||||||
|
@ -23,7 +22,6 @@ class PinoyMoviesHub : MainAPI() {
|
||||||
page: Int,
|
page: Int,
|
||||||
request: MainPageRequest
|
request: MainPageRequest
|
||||||
): HomePageResponse {
|
): HomePageResponse {
|
||||||
val all = ArrayList<HomePageList>()
|
|
||||||
val doc = app.get(mainUrl).document
|
val doc = app.get(mainUrl).document
|
||||||
val rows = listOfNotNull(
|
val rows = listOfNotNull(
|
||||||
Pair("Suggestion", "div.items.featured"),
|
Pair("Suggestion", "div.items.featured"),
|
||||||
|
@ -40,24 +38,20 @@ class PinoyMoviesHub : MainAPI() {
|
||||||
val maindoc = doc.selectFirst("div.module")
|
val maindoc = doc.selectFirst("div.module")
|
||||||
?.select("div.content.full_width_layout.full")
|
?.select("div.content.full_width_layout.full")
|
||||||
|
|
||||||
rows.forEach { pair ->
|
val all = rows.mapNotNull { pair ->
|
||||||
// Fetch row title
|
// Fetch row title
|
||||||
val title = pair.first
|
val title = pair.first
|
||||||
// Fetch list of items and map
|
// Fetch list of items and map
|
||||||
//Log.i(TAG, "Title => $title")
|
//Log.i(TAG, "Title => $title")
|
||||||
maindoc?.select(pair.second)?.let { inner ->
|
val results = maindoc?.select(pair.second)?.select("article").getResults(this.name)
|
||||||
//Log.i(TAG, "inner => $inner")
|
if (results.isEmpty()) {
|
||||||
val results = inner.select("article").getResults(this.name)
|
return@mapNotNull null
|
||||||
if (results.isNotEmpty()) {
|
}
|
||||||
all.add(
|
|
||||||
HomePageList(
|
HomePageList(
|
||||||
name = title,
|
name = title,
|
||||||
list = results,
|
list = results,
|
||||||
isHorizontalImages = false
|
isHorizontalImages = false
|
||||||
)
|
)
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return HomePageResponse(all)
|
return HomePageResponse(all)
|
||||||
}
|
}
|
||||||
|
@ -128,7 +122,6 @@ class PinoyMoviesHub : MainAPI() {
|
||||||
callback: (ExtractorLink) -> Unit
|
callback: (ExtractorLink) -> Unit
|
||||||
): Boolean {
|
): Boolean {
|
||||||
|
|
||||||
try {
|
|
||||||
//Log.i(TAG, "Loading ajax request..")
|
//Log.i(TAG, "Loading ajax request..")
|
||||||
val requestLink = "${mainUrl}/wp-admin/admin-ajax.php"
|
val requestLink = "${mainUrl}/wp-admin/admin-ajax.php"
|
||||||
val action = "doo_player_ajax"
|
val action = "doo_player_ajax"
|
||||||
|
@ -161,11 +154,6 @@ class PinoyMoviesHub : MainAPI() {
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (e: Exception) {
|
|
||||||
//Log.i(TAG, "Error => $e")
|
|
||||||
logError(e)
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue