mirror of
https://github.com/recloudstream/cloudstream.git
synced 2024-08-15 01:53:11 +00:00
[Feature] Add quality to pinoymoviepedia (#911)
This commit is contained in:
parent
f9b151ea8c
commit
b78a76d927
1 changed files with 20 additions and 17 deletions
|
@ -1,9 +1,9 @@
|
|||
package com.lagradost.cloudstream3.movieproviders
|
||||
|
||||
import com.fasterxml.jackson.module.kotlin.readValue
|
||||
import com.lagradost.cloudstream3.*
|
||||
import com.lagradost.cloudstream3.extractors.FEmbed
|
||||
import com.lagradost.cloudstream3.utils.AppUtils.toJson
|
||||
import com.lagradost.cloudstream3.utils.AppUtils.tryParseJson
|
||||
import com.lagradost.cloudstream3.utils.ExtractorLink
|
||||
import com.lagradost.cloudstream3.utils.loadExtractor
|
||||
|
||||
|
@ -53,21 +53,22 @@ class PinoyMoviePediaProvider : MainAPI() {
|
|||
name = urlTitle.select("h3")?.text() ?: ""
|
||||
year = titleYear?.select("span")?.text()?.takeLast(4)?.toIntOrNull()
|
||||
}
|
||||
// Get year from name
|
||||
if (year == null) {
|
||||
// Get year from name
|
||||
val rex = Regex("\\((\\d+)")
|
||||
year = rex.find(name)?.value?.replace("(", "")?.toIntOrNull()
|
||||
}
|
||||
//Get quality
|
||||
val qual = getQualityFromString(it.selectFirst("span.quality")?.text())
|
||||
|
||||
val tvType = TvType.Movie
|
||||
MovieSearchResponse(
|
||||
name,
|
||||
link,
|
||||
this.name,
|
||||
tvType,
|
||||
image,
|
||||
year,
|
||||
null,
|
||||
name = name,
|
||||
url = link,
|
||||
apiName = this.name,
|
||||
TvType.Movie,
|
||||
posterUrl = image,
|
||||
year = year,
|
||||
quality = qual
|
||||
)
|
||||
}?.distinctBy { c -> c.url } ?: listOf()
|
||||
// Add
|
||||
|
@ -93,14 +94,16 @@ class PinoyMoviePediaProvider : MainAPI() {
|
|||
val title = details.select("div.title")?.text() ?: ""
|
||||
val year = details.select("div.meta > span.year")?.text()?.toIntOrNull()
|
||||
val image = inner.select("div.image > div > a > img")?.attr("src")
|
||||
val qual = getQualityFromString(it.selectFirst("span.quality")?.text())
|
||||
|
||||
MovieSearchResponse(
|
||||
title,
|
||||
link,
|
||||
this.name,
|
||||
name = title,
|
||||
url = link,
|
||||
apiName = this.name,
|
||||
TvType.Movie,
|
||||
image,
|
||||
year
|
||||
posterUrl = image,
|
||||
year = year,
|
||||
quality = qual
|
||||
)
|
||||
}?.distinctBy { c -> c.url } ?: listOf()
|
||||
}
|
||||
|
@ -149,7 +152,7 @@ class PinoyMoviePediaProvider : MainAPI() {
|
|||
playcontainer?.select("iframe")?.forEach { item ->
|
||||
val lnk = item?.attr("src")?.trim() ?: ""
|
||||
//Log.i(this.name, "Result => (lnk) $lnk")
|
||||
if (lnk.isNotBlank()) {
|
||||
if (lnk.isNotEmpty()) {
|
||||
listOfLinks.add(lnk)
|
||||
}
|
||||
}
|
||||
|
@ -219,7 +222,7 @@ class PinoyMoviePediaProvider : MainAPI() {
|
|||
): Boolean {
|
||||
// parse movie servers
|
||||
var count = 0
|
||||
mapper.readValue<List<String>>(data).apmap { link ->
|
||||
tryParseJson<List<String>>(data)?.apmap { link ->
|
||||
count++
|
||||
if (link.contains("fembed.com")) {
|
||||
val extractor = FEmbed()
|
||||
|
|
Loading…
Reference in a new issue