streamingcommunity poster

This commit is contained in:
antonydp 2022-11-02 23:54:54 +01:00 committed by GitHub
parent 5a2c1598ba
commit 9f76d8c303
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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 {
@ -440,4 +441,4 @@ class StreamingcommunityProvider: MainAPI() {
getM3u8Qualities(link, data, URI(link).host).forEach(callback) getM3u8Qualities(link, data, URI(link).host).forEach(callback)
return true return true
} }
} }