mirror of
https://github.com/recloudstream/cloudstream-extensions-multilingual.git
synced 2024-08-15 03:15:14 +00:00
streamingcommunity poster
This commit is contained in:
parent
5a2c1598ba
commit
9f76d8c303
1 changed files with 9 additions and 8 deletions
|
@ -170,9 +170,9 @@ class StreamingcommunityProvider: MainAPI() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
companion object {
|
// companion object {
|
||||||
val posterMap = hashMapOf<String, String>()
|
// val posterMap = hashMapOf<String, String>()
|
||||||
}
|
// }
|
||||||
|
|
||||||
override suspend fun getMainPage(page: Int, request : MainPageRequest): HomePageResponse {
|
override suspend fun getMainPage(page: Int, request : MainPageRequest): HomePageResponse {
|
||||||
val items = ArrayList<HomePageList>()
|
val items = ArrayList<HomePageList>()
|
||||||
|
@ -191,7 +191,7 @@ class StreamingcommunityProvider: MainAPI() {
|
||||||
val ip = translateip(searchr.images[0].proxyID.toInt())
|
val ip = translateip(searchr.images[0].proxyID.toInt())
|
||||||
val posterurl = "https://$ip/images/$number/$img"
|
val posterurl = "https://$ip/images/$number/$img"
|
||||||
val videourl = "$mainUrl/titles/$id-$name"
|
val videourl = "$mainUrl/titles/$id-$name"
|
||||||
posterMap[videourl] = posterurl
|
//posterMap[videourl] = posterurl
|
||||||
val data = app.post("$mainUrl/api/titles/preview/$id", referer = mainUrl).text
|
val data = app.post("$mainUrl/api/titles/preview/$id", referer = mainUrl).text
|
||||||
val datajs = parseJson<Moviedata>(data)
|
val datajs = parseJson<Moviedata>(data)
|
||||||
val type: TvType = if (datajs.type == "movie") {
|
val type: TvType = if (datajs.type == "movie") {
|
||||||
|
@ -239,7 +239,7 @@ class StreamingcommunityProvider: MainAPI() {
|
||||||
val datajs = parseJson<Moviedata>(data)
|
val datajs = parseJson<Moviedata>(data)
|
||||||
val posterurl = "https://$ip/images/$number/$img"
|
val posterurl = "https://$ip/images/$number/$img"
|
||||||
val videourl = "$mainUrl/titles/$id-$name"
|
val videourl = "$mainUrl/titles/$id-$name"
|
||||||
posterMap[videourl] = posterurl
|
//posterMap[videourl] = posterurl
|
||||||
if (datajs.type == "movie") {
|
if (datajs.type == "movie") {
|
||||||
val type = TvType.Movie
|
val type = TvType.Movie
|
||||||
MovieSearchResponse(
|
MovieSearchResponse(
|
||||||
|
@ -271,7 +271,8 @@ class StreamingcommunityProvider: MainAPI() {
|
||||||
override suspend fun load(url: String): LoadResponse {
|
override suspend fun load(url: String): LoadResponse {
|
||||||
|
|
||||||
val document = app.get(url).document
|
val document = app.get(url).document
|
||||||
val poster = posterMap[url]
|
val poster = Regex("url\\('(.*)'").find(document.selectFirst("div.title-wrap")?.attributes()
|
||||||
|
?.get("style") ?: "")?.groupValues?.last() //posterMap[url]
|
||||||
val id = url.substringBefore("-").filter { it.isDigit() }
|
val id = url.substringBefore("-").filter { it.isDigit() }
|
||||||
val data = app.post("$mainUrl/api/titles/preview/$id", referer = mainUrl).text
|
val data = app.post("$mainUrl/api/titles/preview/$id", referer = mainUrl).text
|
||||||
|
|
||||||
|
@ -307,7 +308,7 @@ class StreamingcommunityProvider: MainAPI() {
|
||||||
val videourl = "$mainUrl/titles/$idcorr-$name"
|
val videourl = "$mainUrl/titles/$idcorr-$name"
|
||||||
val posterurl = "https://$ip/images/$number/$img"
|
val posterurl = "https://$ip/images/$number/$img"
|
||||||
|
|
||||||
posterMap[videourl] = posterurl
|
//posterMap[videourl] = posterurl
|
||||||
val typecorr: TvType = if (datajscorrel.type == "movie") {
|
val typecorr: TvType = if (datajscorrel.type == "movie") {
|
||||||
TvType.Movie
|
TvType.Movie
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue