Skip to content

Commit

Permalink
fix playlist response
Browse files Browse the repository at this point in the history
  • Loading branch information
crackededed committed Jun 26, 2024
1 parent 394246b commit 8d9ce98
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ android {
minSdk = 21
targetSdk = 34
versionCode = 121
versionName = "2.32.5"
versionName = "2.32.6"
}

buildTypes {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ class PlayerRepository @Inject constructor(
).toString()
}

suspend fun loadStreamPlaylistResponse(url: String, proxyMultivariantPlaylist: Boolean, proxyHost: String?, proxyPort: Int?, proxyUser: String?, proxyPassword: String?): ResponseBody = withContext(Dispatchers.IO) {
suspend fun loadStreamPlaylistResponse(url: String, proxyMultivariantPlaylist: Boolean, proxyHost: String?, proxyPort: Int?, proxyUser: String?, proxyPassword: String?): String = withContext(Dispatchers.IO) {
okHttpClient.newBuilder().apply {
if (proxyMultivariantPlaylist && !proxyHost.isNullOrBlank() && proxyPort != null) {
proxy(Proxy(Proxy.Type.HTTP, InetSocketAddress(proxyHost, proxyPort)))
Expand All @@ -84,7 +84,7 @@ class PlayerRepository @Inject constructor(
}
}
}.build().newCall(Request.Builder().url(url).build()).execute().use { response ->
response.body
response.body.string()
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ class StreamPlayerViewModel @Inject constructor(
val url = playerRepository.loadStreamPlaylistUrl(gqlHeaders, channelLogin, randomDeviceId, xDeviceId, playerType, supportedCodecs, proxyPlaybackAccessToken, proxyHost, proxyPort, proxyUser, proxyPassword, enableIntegrity)
if (proxyMultivariantPlaylist) {
val response = playerRepository.loadStreamPlaylistResponse(url, true, proxyHost, proxyPort, proxyUser, proxyPassword)
Base64.encodeToString(response.source().readByteArray(), Base64.DEFAULT)
Base64.encodeToString(response.toByteArray(), Base64.DEFAULT)
} else {
url
}
Expand Down

0 comments on commit 8d9ce98

Please sign in to comment.