mirror of
https://github.com/recloudstream/cloudstream-extensions-multilingual.git
synced 2024-08-15 03:15:14 +00:00
[Feature] Enable nsfw on Pinoy movie providers homepage (#7)
This commit is contained in:
parent
0164c86f81
commit
a30277322a
4 changed files with 22 additions and 15 deletions
|
@ -6,8 +6,8 @@ cloudstream {
|
|||
language = "tl"
|
||||
// All of these properties are optional, you can safely remove them
|
||||
|
||||
// description = "Lorem Ipsum"
|
||||
// authors = listOf("Cloudburst")
|
||||
description = "Pinoy HD Movies - High Definition"
|
||||
authors = listOf("Jace")
|
||||
|
||||
/**
|
||||
* Status int as the following:
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
// use an integer for version numbers
|
||||
version = 1
|
||||
version = 2
|
||||
|
||||
|
||||
cloudstream {
|
||||
|
@ -7,7 +7,7 @@ cloudstream {
|
|||
// All of these properties are optional, you can safely remove them
|
||||
|
||||
description = "Includes PinoyMoviePediaProvider and PinoyMoviesEsProvider"
|
||||
// authors = listOf("Cloudburst")
|
||||
authors = listOf("Jace")
|
||||
|
||||
/**
|
||||
* Status int as the following:
|
||||
|
|
|
@ -21,7 +21,7 @@ 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: List<Pair<String, String>> = listOf(
|
||||
val rows = listOf(
|
||||
Pair("Latest Movies", "featured-titles"),
|
||||
Pair("Movies", "dt-movies"),
|
||||
Pair("Digitally Restored", "genre_digitally-restored"),
|
||||
|
@ -29,8 +29,10 @@ class PinoyMoviePediaProvider : MainAPI() {
|
|||
Pair("Romance", "genre_romance"),
|
||||
Pair("Comedy", "genre_comedy"),
|
||||
Pair("Family", "genre_family")
|
||||
//Pair("Adult +18", "genre_pinay-sexy-movies")
|
||||
)
|
||||
).toMutableList()
|
||||
if (settingsForProvider.enableAdult) {
|
||||
rows.add(Pair("Adult +18", "genre_pinay-sexy-movies"))
|
||||
}
|
||||
rows.forEach { item ->
|
||||
val title = item.first
|
||||
val inner = mainbody?.select("div#${item.second} > article")
|
||||
|
|
|
@ -106,14 +106,19 @@ class PinoyMoviesEsProvider : MainAPI() {
|
|||
all.addAll(homepage1)
|
||||
}
|
||||
//2nd rows
|
||||
val homepage2 = getRowElements(
|
||||
mainbody, listOf(
|
||||
val listOfRows = listOf(
|
||||
Pair("Action", "genre_action"),
|
||||
Pair("Comedy", "genre_comedy"),
|
||||
Pair("Romance", "genre_romance"),
|
||||
Pair("Horror", "genre_horror")
|
||||
//Pair("Rated-R", "genre_rated-r")
|
||||
), "#"
|
||||
).toMutableList()
|
||||
if (settingsForProvider.enableAdult) {
|
||||
listOfRows.add(Pair("Rated-R", "genre_rated-r"))
|
||||
}
|
||||
val homepage2 = getRowElements(
|
||||
mainbody = mainbody,
|
||||
rows = listOfRows,
|
||||
sep = "#"
|
||||
)
|
||||
if (homepage2.isNotEmpty()) {
|
||||
all.addAll(homepage2)
|
||||
|
@ -127,7 +132,7 @@ class PinoyMoviesEsProvider : MainAPI() {
|
|||
val document = app.get(url, interceptor = DdosGuardKiller(true))
|
||||
.document.select("div#archive-content > article")
|
||||
|
||||
return document?.mapNotNull {
|
||||
return document.mapNotNull {
|
||||
// Fetch details
|
||||
val urlTitle = it?.select("div.data") ?: return@mapNotNull null
|
||||
val link = urlTitle.select("a")?.attr("href") ?: return@mapNotNull null
|
||||
|
|
Loading…
Reference in a new issue