diff --git a/src/youtube_onesie_provider.ts b/src/youtube_onesie_provider.ts index f88f4c18a..4839e5155 100644 --- a/src/youtube_onesie_provider.ts +++ b/src/youtube_onesie_provider.ts @@ -108,34 +108,38 @@ export default class YoutubeOnesieProvider { args: OnesieRequestArgs, ): Promise { const { videoId, poToken, clientConfig, innertube } = args; - const { clientKeyData, encryptedClientKey, onesieUstreamerConfig } = clientConfig; - const clonedInnerTubeContext: Context = structuredClone(innertube.session.context); - - // Change or remove these if you want to use a different client. I chose TVHTML5 purely for testing. - clonedInnerTubeContext.client.clientName = Constants.CLIENTS.TV.NAME; - clonedInnerTubeContext.client.clientVersion = Constants.CLIENTS.TV.VERSION; - - const params: Record = { - playbackContext: { - contentPlaybackContext: { - vis: 0, - splay: false, - lactMilliseconds: '-1', - signatureTimestamp: innertube.session.player?.sts - } - }, - videoId - }; - - if (poToken) { - params.serviceIntegrityDimensions = {}; - params.serviceIntegrityDimensions.poToken = poToken; - } - - const playerRequestJson = { - context: clonedInnerTubeContext, - ...params - }; + const { clientKeyData, encryptedClientKey, onesieUstreamerConfig } = + clientConfig; + const clonedInnerTubeContext: Context = structuredClone( + innertube.session.context, + ); + + // Change or remove these if you want to use a different client. I chose TVHTML5 purely for testing. + clonedInnerTubeContext.client.clientName = Constants.CLIENTS.TV.NAME; + clonedInnerTubeContext.client.clientVersion = + Constants.CLIENTS.TV.VERSION; + + const params: Record = { + playbackContext: { + contentPlaybackContext: { + vis: 0, + splay: false, + lactMilliseconds: "-1", + signatureTimestamp: innertube.session.player?.sts, + }, + }, + videoId, + }; + + if (poToken) { + params.serviceIntegrityDimensions = {}; + params.serviceIntegrityDimensions.poToken = poToken; + } + + const playerRequestJson = { + context: clonedInnerTubeContext, + ...params, + }; const headers = [ {