mirror of
https://github.com/recloudstream/cloudstream-extensions-multilingual.git
synced 2024-08-15 03:15:14 +00:00
fixed PhimmoichillProvider
This commit is contained in:
parent
0bfba1ba5d
commit
3ba228c881
2 changed files with 16 additions and 17 deletions
|
@ -1,5 +1,5 @@
|
||||||
// use an integer for version numbers
|
// use an integer for version numbers
|
||||||
version = 1
|
version = 2
|
||||||
|
|
||||||
|
|
||||||
cloudstream {
|
cloudstream {
|
||||||
|
@ -7,7 +7,7 @@ cloudstream {
|
||||||
// All of these properties are optional, you can safely remove them
|
// All of these properties are optional, you can safely remove them
|
||||||
|
|
||||||
// description = "Lorem Ipsum"
|
// description = "Lorem Ipsum"
|
||||||
// authors = listOf("Cloudburst")
|
authors = listOf("Hexated")
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Status int as the following:
|
* Status int as the following:
|
||||||
|
|
|
@ -8,7 +8,6 @@ import com.lagradost.cloudstream3.mvvm.safeApiCall
|
||||||
import com.lagradost.cloudstream3.utils.*
|
import com.lagradost.cloudstream3.utils.*
|
||||||
import org.jsoup.nodes.Element
|
import org.jsoup.nodes.Element
|
||||||
import java.net.URLDecoder
|
import java.net.URLDecoder
|
||||||
import java.util.ArrayList
|
|
||||||
|
|
||||||
class PhimmoichillProvider : MainAPI() {
|
class PhimmoichillProvider : MainAPI() {
|
||||||
override var mainUrl = "https://phimmoichill.net"
|
override var mainUrl = "https://phimmoichill.net"
|
||||||
|
@ -97,7 +96,9 @@ class PhimmoichillProvider : MainAPI() {
|
||||||
document.select("ul.entry-meta.block-film li:nth-child(7) span").text().toRatingInt()
|
document.select("ul.entry-meta.block-film li:nth-child(7) span").text().toRatingInt()
|
||||||
val actors = document.select("ul.entry-meta.block-film li:last-child a").map { it.text() }
|
val actors = document.select("ul.entry-meta.block-film li:last-child a").map { it.text() }
|
||||||
val recommendations = document.select("ul#list-film-realted li.item").map {
|
val recommendations = document.select("ul#list-film-realted li.item").map {
|
||||||
it.toSearchResult()
|
it.toSearchResult().apply {
|
||||||
|
this.posterUrl = decode(it.selectFirst("img")!!.attr("data-src").substringAfter("url="))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return if (tvType == TvType.TvSeries) {
|
return if (tvType == TvType.TvSeries) {
|
||||||
|
@ -145,24 +146,21 @@ class PhimmoichillProvider : MainAPI() {
|
||||||
): Boolean {
|
): Boolean {
|
||||||
val document = app.get(data).document
|
val document = app.get(data).document
|
||||||
|
|
||||||
val key = document.select("div#content script").mapNotNull { script ->
|
val key = document.select("div#content script")
|
||||||
if (script.data().contains("filmInfo.episodeID =")) {
|
.find { it.data().contains("filmInfo.episodeID =") }?.data()?.let { script ->
|
||||||
val id = script.data().substringAfter("filmInfo.episodeID = parseInt('")
|
val id = script.substringAfter("filmInfo.episodeID = parseInt('")
|
||||||
.substringBefore("');")
|
|
||||||
app.post(
|
app.post(
|
||||||
// Not mainUrl
|
// Not mainUrl
|
||||||
url = "https://phimmoichills.net/pmplayer.php",
|
url = "https://phimmoichills.net/pmplayer.php",
|
||||||
data = mapOf("qcao" to id),
|
data = mapOf("qcao" to id, "sv" to "0"),
|
||||||
referer = data,
|
referer = data,
|
||||||
headers = mapOf(
|
headers = mapOf(
|
||||||
"X-Requested-With" to "XMLHttpRequest",
|
"X-Requested-With" to "XMLHttpRequest",
|
||||||
"Content-Type" to "application/x-www-form-urlencoded; charset=UTF-8"
|
"Content-Type" to "application/x-www-form-urlencoded; charset=UTF-8"
|
||||||
)
|
)
|
||||||
).text.also { println("HERERERR $it") }.substringAfterLast("iniPlayers(\"").substringBefore("\",")
|
).text.substringAfterLast("iniPlayers(\"")
|
||||||
} else {
|
.substringBefore("\",")
|
||||||
null
|
|
||||||
}
|
}
|
||||||
}.first()
|
|
||||||
|
|
||||||
listOf(
|
listOf(
|
||||||
Pair("https://so-trym.topphimmoi.org/hlspm/$key", "PMFAST"),
|
Pair("https://so-trym.topphimmoi.org/hlspm/$key", "PMFAST"),
|
||||||
|
@ -197,10 +195,11 @@ class PhimmoichillProvider : MainAPI() {
|
||||||
playList ?: return@safeApiCall,
|
playList ?: return@safeApiCall,
|
||||||
referer = "$mainUrl/",
|
referer = "$mainUrl/",
|
||||||
quality = Qualities.P1080.value,
|
quality = Qualities.P1080.value,
|
||||||
headers = mapOf(
|
headers = if (source == "PMHLS") {
|
||||||
// "If-None-Match" to "*",
|
mapOf("Origin" to mainUrl)
|
||||||
"Origin" to mainUrl,
|
} else {
|
||||||
)
|
mapOf()
|
||||||
|
}
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue