[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:
Jace 2022-10-11 03:45:52 +08:00 committed by GitHub
parent 4ea018faba
commit 5db1331939
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 361 additions and 13 deletions

View file

@ -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")

View file

@ -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,