Change android youtube client
This commit is contained in:
parent
fa4fd276b3
commit
493fc75345
4 changed files with 7 additions and 11 deletions
|
@ -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
|
||||
)
|
||||
|
|
|
@ -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
|
||||
)
|
||||
|
|
|
@ -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"
|
||||
)
|
||||
)
|
||||
}
|
||||
|
|
|
@ -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<PlayerResponse>()
|
||||
|
||||
|
|
Loading…
Reference in a new issue