diff --git a/app/src/main/kotlin/it/vfsfitvnm/vimusic/service/PlayerService.kt b/app/src/main/kotlin/it/vfsfitvnm/vimusic/service/PlayerService.kt index eb6ec5c..7b754fd 100644 --- a/app/src/main/kotlin/it/vfsfitvnm/vimusic/service/PlayerService.kt +++ b/app/src/main/kotlin/it/vfsfitvnm/vimusic/service/PlayerService.kt @@ -698,7 +698,7 @@ class PlayerService : InvincibleService(), Player.Listener, PlaybackStatsListene itag = format.itag, mimeType = format.mimeType, bitrate = format.bitrate, - loudnessDb = body.playerConfig?.audioConfig?.loudnessDb?.toFloat(), + loudnessDb = body.playerConfig?.audioConfig?.loudnessDb?.toFloat()?.plus(7), contentLength = format.contentLength, lastModified = format.lastModified ) diff --git a/app/src/main/kotlin/it/vfsfitvnm/vimusic/ui/screens/player/StatsForNerds.kt b/app/src/main/kotlin/it/vfsfitvnm/vimusic/ui/screens/player/StatsForNerds.kt index 5d44780..fd1f879 100644 --- a/app/src/main/kotlin/it/vfsfitvnm/vimusic/ui/screens/player/StatsForNerds.kt +++ b/app/src/main/kotlin/it/vfsfitvnm/vimusic/ui/screens/player/StatsForNerds.kt @@ -205,7 +205,7 @@ fun StatsForNerds( itag = format.itag, mimeType = format.mimeType, bitrate = format.bitrate, - loudnessDb = response.playerConfig?.audioConfig?.loudnessDb?.toFloat(), + loudnessDb = response.playerConfig?.audioConfig?.loudnessDb?.toFloat()?.plus(7), contentLength = format.contentLength, lastModified = format.lastModified ) diff --git a/innertube/src/main/kotlin/it/vfsfitvnm/youtubemusic/models/Context.kt b/innertube/src/main/kotlin/it/vfsfitvnm/youtubemusic/models/Context.kt index f5a451a..b3a0e89 100644 --- a/innertube/src/main/kotlin/it/vfsfitvnm/youtubemusic/models/Context.kt +++ b/innertube/src/main/kotlin/it/vfsfitvnm/youtubemusic/models/Context.kt @@ -13,7 +13,7 @@ data class Context( val clientVersion: String, val platform: String, val hl: String = "en", - val visitorData: String? = null, + val visitorData: String = "CgtEUlRINDFjdm1YayjX1pSaBg%3D%3D", val androidSdkVersion: Int? = null, val userAgent: String? = null ) @@ -29,17 +29,16 @@ data class Context( clientName = "WEB_REMIX", clientVersion = "1.20220918", platform = "DESKTOP", - visitorData = "CgtsZG1ySnZiQWtSbyiMjuGSBg%3D%3D" ) ) val DefaultAndroid = Context( client = Client( - clientName = "ANDROID", - clientVersion = "17.36.4", + clientName = "ANDROID_MUSIC", + clientVersion = "5.28.1", platform = "MOBILE", androidSdkVersion = 30, - userAgent = "com.google.android.youtube/17.36.4 (Linux; U; Android 11) gzip" + userAgent = "com.google.android.apps.youtube.music/5.28.1 (Linux; U; Android 11) gzip" ) ) @@ -47,8 +46,7 @@ data class Context( client = Client( clientName = "TVHTML5_SIMPLY_EMBEDDED_PLAYER", clientVersion = "2.0", - platform = "TV", - visitorData = null, + platform = "TV" ) ) } diff --git a/innertube/src/main/kotlin/it/vfsfitvnm/youtubemusic/requests/Player.kt b/innertube/src/main/kotlin/it/vfsfitvnm/youtubemusic/requests/Player.kt index fbf3ffc..824c233 100644 --- a/innertube/src/main/kotlin/it/vfsfitvnm/youtubemusic/requests/Player.kt +++ b/innertube/src/main/kotlin/it/vfsfitvnm/youtubemusic/requests/Player.kt @@ -6,7 +6,6 @@ import io.ktor.client.request.post import io.ktor.client.request.setBody import io.ktor.http.ContentType import io.ktor.http.contentType -import io.ktor.http.userAgent import it.vfsfitvnm.youtubemusic.Innertube import it.vfsfitvnm.youtubemusic.models.Context import it.vfsfitvnm.youtubemusic.models.PlayerResponse @@ -17,7 +16,6 @@ import kotlinx.serialization.Serializable suspend fun Innertube.player(body: PlayerBody) = runCatchingNonCancellable { val response = client.post(player) { setBody(body) - body.context.client.userAgent?.let(::userAgent) mask("playabilityStatus.status,playerConfig.audioConfig,streamingData.adaptiveFormats,videoDetails.videoId") }.body()