Skip to content

Commit

Permalink
chore: update deps
Browse files Browse the repository at this point in the history
  • Loading branch information
LuanRT committed Dec 10, 2024
1 parent 96004ce commit 7a106dc
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 36 deletions.
21 changes: 11 additions & 10 deletions examples/downloader/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion examples/downloader/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"cli-progress": "^3.12.0",
"fluent-ffmpeg": "^2.1.3",
"shaka-player": "^4.11.2",
"youtubei.js": "github:LuanRT/YouTube.js#refactor/update-protos"
"youtubei.js": "^12.1.0"
},
"devDependencies": {
"@types/cli-progress": "^3.11.6",
Expand Down
27 changes: 20 additions & 7 deletions examples/onesie-request/main.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Innertube, { Constants, UniversalCache } from 'youtubei.js';
import { type Context, Endpoints, YT } from 'youtubei.js';
import { type Context, YT } from 'youtubei.js';
import GoogleVideo, { base64ToU8, PART, Protos, QUALITY } from '../../dist/src/index.js';
import { decryptResponse, encryptRequest } from './utils.js';

Expand Down Expand Up @@ -67,14 +67,27 @@ async function prepareOnesieRequest(args: OnesieRequestArgs): Promise<OnesieRequ
// 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,
...Endpoints.PlayerEndpoint.build({
video_id: videoId,
po_token: poToken,
sts: innertube.session.player?.sts
})
...params
};

const headers = [ {
Expand Down
31 changes: 14 additions & 17 deletions examples/onesie-request/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion examples/onesie-request/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@
"author": "",
"license": "ISC",
"dependencies": {
"youtubei.js": "^11.0.1"
"youtubei.js": "^12.1.0"
}
}

0 comments on commit 7a106dc

Please sign in to comment.