Skip to content

Commit

Permalink
Prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
Brainicism committed Dec 13, 2024
1 parent efffa53 commit 121ae05
Showing 1 changed file with 32 additions and 28 deletions.
60 changes: 32 additions & 28 deletions src/youtube_onesie_provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,34 +108,38 @@ export default class YoutubeOnesieProvider {
args: OnesieRequestArgs,
): Promise<OnesieRequest> {
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<string, any> = {
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(

Check warning on line 113 in src/youtube_onesie_provider.ts

View workflow job for this annotation

GitHub Actions / build

Expected blank line before this statement
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<string, any> = {
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 = [
{
Expand Down

0 comments on commit 121ae05

Please sign in to comment.