Skip to content

Commit

Permalink
Added 1080p to StreamingCommunity
Browse files Browse the repository at this point in the history
  • Loading branch information
doGior committed Oct 1, 2024
1 parent 1f31eb2 commit 6c905ea
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 12 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package it.dogior.doesStream


import android.util.Log
import com.lagradost.cloudstream3.SubtitleFile
import com.lagradost.cloudstream3.app
Expand All @@ -20,7 +21,7 @@ class StreamingCommunityExtractor : ExtractorApi() {
subtitleCallback: (SubtitleFile) -> Unit,
callback: (ExtractorLink) -> Unit
) {
val TAG = "StreaminCommunityExtractor:getUrl"
val TAG = "StreamingCommunityExtractor:getUrl"
Log.d(TAG,"REFERER: $referer URL: $url")

if (url.isNotEmpty()) {
Expand All @@ -39,18 +40,25 @@ class StreamingCommunityExtractor : ExtractorApi() {

}

suspend fun getPlaylistLink(data: String): String {
val TAG = "StreaminCommunityExtractor:getPlaylistLink"
val iframeUrl = app.get(data).document
suspend fun getPlaylistLink(url: String): String {
val TAG = "StreamingCommunityExtractor:getPlaylistLink"

Log.d(TAG, url)
val iframeUrl = app.get(url).document
.select("iframe").attr("src")

Log.w(TAG, "IFRAME URL: $iframeUrl")
val headers = mapOf(
"Accept" to "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8",
"Host" to iframeUrl.toHttpUrl().host,
"Referer" to "$mainUrl/"
"Sec-Fetch-Dest" to "iframe",
"Sec-Fetch-Mode" to "navigate",
"Sec-Fetch-Site" to "cross-site",
)

val iframe = app.get(iframeUrl, headers = headers).document
Log.d(TAG, "TEST: ${iframe.body()}")

val script =
iframe.selectFirst("script:containsData(masterPlaylist)")!!.data().replace("\\", "")
.replace("\n", "").replace("\t", "")
Expand All @@ -61,10 +69,6 @@ class StreamingCommunityExtractor : ExtractorApi() {
.substringBefore(" window.canPlayFHD")
// val windowCanPlayFHD = script.substringAfter("window.canPlayFHD = ")
Log.d(TAG, "SCRIPT: $script")
// Log.d(TAG, "windowVideo: $windowVideo")
// Log.d(TAG, "windowStreams: $windowStreams")
Log.d(TAG, "windowMasterPlaylist: $windowMasterPlaylist")
// Log.d(TAG, "windowCanPlayFHD: $windowCanPlayFHD")

val servers = parseJson<List<Server>>(windowStreams)
Log.d(TAG, "Server List: $servers")
Expand All @@ -76,11 +80,12 @@ class StreamingCommunityExtractor : ExtractorApi() {
.replace("'", "\"")
.replace(" ", "")
.replace(",}", "}")
Log.d(TAG, "windowMasterPlaylist: $mP")

val masterPlaylist = parseJson<MasterPlaylist>(mP)
Log.d(TAG, "MasterPlaylist Obj: $masterPlaylist")

val masterPlaylistUrl = "${masterPlaylist.url}&token=${masterPlaylist.params.token}&expires=${masterPlaylist.params.expires}&b=1"
val masterPlaylistUrl = "${masterPlaylist.url}&token=${masterPlaylist.params.token}&expires=${masterPlaylist.params.expires}&h=1"
return masterPlaylistUrl
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ class StreamingCommunity : MainAPI() {
val movie = MovieLoadResponse(
name = title.name,
url = url,
dataUrl = "$mainUrl/iframe/${title.id}",
dataUrl = "$mainUrl/iframe/${title.id}&canPlayFHD=1",
type = TvType.Movie,
apiName = this.name,
plot = title.plot,
Expand Down Expand Up @@ -243,7 +243,7 @@ class StreamingCommunity : MainAPI() {
responseEpisodes.forEach { ep ->
episodeList.add(
Episode(
data = "$mainUrl/iframe/${title.id}?episode_id=${ep.id}",
data = "$mainUrl/iframe/${title.id}?episode_id=${ep.id}&canPlayFHD=1",
name = ep.name,
posterUrl = props.cdnUrl + "/images/" + ep.getCover(),
description = ep.plot,
Expand Down

0 comments on commit 6c905ea

Please sign in to comment.