fixed PhimmoichillProvider

This commit is contained in:
hexated 2022-09-06 02:44:51 +07:00
parent 0bfba1ba5d
commit 3ba228c881
2 changed files with 16 additions and 17 deletions

View file

@ -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 = "Lorem Ipsum"
// authors = listOf("Cloudburst")
authors = listOf("Hexated")
/**
* Status int as the following:

View file

@ -8,7 +8,6 @@ import com.lagradost.cloudstream3.mvvm.safeApiCall
import com.lagradost.cloudstream3.utils.*
import org.jsoup.nodes.Element
import java.net.URLDecoder
import java.util.ArrayList
class PhimmoichillProvider : MainAPI() {
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()
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 {
it.toSearchResult()
it.toSearchResult().apply {
this.posterUrl = decode(it.selectFirst("img")!!.attr("data-src").substringAfter("url="))
}
}
return if (tvType == TvType.TvSeries) {
@ -145,24 +146,21 @@ class PhimmoichillProvider : MainAPI() {
): Boolean {
val document = app.get(data).document
val key = document.select("div#content script").mapNotNull { script ->
if (script.data().contains("filmInfo.episodeID =")) {
val id = script.data().substringAfter("filmInfo.episodeID = parseInt('")
.substringBefore("');")
val key = document.select("div#content script")
.find { it.data().contains("filmInfo.episodeID =") }?.data()?.let { script ->
val id = script.substringAfter("filmInfo.episodeID = parseInt('")
app.post(
// Not mainUrl
url = "https://phimmoichills.net/pmplayer.php",
data = mapOf("qcao" to id),
data = mapOf("qcao" to id, "sv" to "0"),
referer = data,
headers = mapOf(
"X-Requested-With" to "XMLHttpRequest",
"Content-Type" to "application/x-www-form-urlencoded; charset=UTF-8"
)
).text.also { println("HERERERR $it") }.substringAfterLast("iniPlayers(\"").substringBefore("\",")
} else {
null
).text.substringAfterLast("iniPlayers(\"")
.substringBefore("\",")
}
}.first()
listOf(
Pair("https://so-trym.topphimmoi.org/hlspm/$key", "PMFAST"),
@ -197,10 +195,11 @@ class PhimmoichillProvider : MainAPI() {
playList ?: return@safeApiCall,
referer = "$mainUrl/",
quality = Qualities.P1080.value,
headers = mapOf(
// "If-None-Match" to "*",
"Origin" to mainUrl,
)
headers = if (source == "PMHLS") {
mapOf("Origin" to mainUrl)
} else {
mapOf()
}
)
)
}