mirror of
https://github.com/recloudstream/cloudstream-extensions-multilingual.git
synced 2024-08-15 03:15:14 +00:00
[Provider] Pinoymovieshub (#30)
* [Provider] Pinoy Movies Hub * Minor cleanups * Applied PR changes * Parse episode list and date * Applied PR suggestions. - Fetch movie Id from episode link on loadLinks * Minor cleanups
This commit is contained in:
parent
4ea018faba
commit
5db1331939
6 changed files with 361 additions and 13 deletions
|
@ -21,18 +21,16 @@ class PinoyMoviePediaProvider : MainAPI() {
|
|||
val document = app.get(mainUrl).document
|
||||
val mainbody = document.getElementsByTag("body")
|
||||
// All rows will be hardcoded bc of the nature of the site
|
||||
val rows = listOf(
|
||||
val rows = listOfNotNull(
|
||||
Pair("Latest Movies", "featured-titles"),
|
||||
Pair("Movies", "dt-movies"),
|
||||
Pair("Digitally Restored", "genre_digitally-restored"),
|
||||
Pair("Action", "genre_action"),
|
||||
Pair("Romance", "genre_romance"),
|
||||
Pair("Comedy", "genre_comedy"),
|
||||
Pair("Family", "genre_family")
|
||||
).toMutableList()
|
||||
if (settingsForProvider.enableAdult) {
|
||||
rows.add(Pair("Adult +18", "genre_pinay-sexy-movies"))
|
||||
}
|
||||
Pair("Family", "genre_family"),
|
||||
if (settingsForProvider.enableAdult) Pair("Adult +18", "genre_pinay-sexy-movies") else null
|
||||
)
|
||||
rows.forEach { item ->
|
||||
val title = item.first
|
||||
val inner = mainbody?.select("div#${item.second} > article")
|
||||
|
|
|
@ -79,7 +79,7 @@ class PinoyMoviesEsProvider : MainAPI() {
|
|||
)
|
||||
}?.distinctBy { c -> c.url } ?: listOf()
|
||||
//Add to list of homepages
|
||||
if (!elements.isNullOrEmpty()) {
|
||||
if (elements.isNotEmpty()) {
|
||||
all.add(
|
||||
HomePageList(
|
||||
title, elements
|
||||
|
@ -106,15 +106,13 @@ class PinoyMoviesEsProvider : MainAPI() {
|
|||
all.addAll(homepage1)
|
||||
}
|
||||
//2nd rows
|
||||
val listOfRows = listOf(
|
||||
val listOfRows = listOfNotNull(
|
||||
Pair("Action", "genre_action"),
|
||||
Pair("Comedy", "genre_comedy"),
|
||||
Pair("Romance", "genre_romance"),
|
||||
Pair("Horror", "genre_horror")
|
||||
).toMutableList()
|
||||
if (settingsForProvider.enableAdult) {
|
||||
listOfRows.add(Pair("Rated-R", "genre_rated-r"))
|
||||
}
|
||||
Pair("Horror", "genre_horror"),
|
||||
if (settingsForProvider.enableAdult) Pair("Rated-R", "genre_rated-r") else null
|
||||
)
|
||||
val homepage2 = getRowElements(
|
||||
mainbody = mainbody,
|
||||
rows = listOfRows,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue