chore: clean up

This commit is contained in:
Luan
2024-09-13 14:09:38 -03:00
parent b7b680c4f1
commit ecbf0dc8d3
4 changed files with 8 additions and 68 deletions

3
.gitignore vendored
View File

@@ -70,8 +70,5 @@ bundle/*.cjs
bundle/*.cjs.*
deno/
# VSCode files
.vscode/
# MacOS
.DS_Store

8
.vscode/settings.json vendored Normal file
View File

@@ -0,0 +1,8 @@
{
"typescript.tsdk": "node_modules\\typescript\\lib",
"protoc": {
"options": [
"--proto_path=protos",
]
}
}

31
deno.lock generated
View File

@@ -1,31 +0,0 @@
{
"version": "3",
"remote": {
"https://deno.land/std@0.148.0/async/abortable.ts": "87aa7230be8360c24ad437212311c9e8d4328854baec27b4c7abb26e85515c06",
"https://deno.land/std@0.148.0/async/deadline.ts": "48ac998d7564969f3e6ec6b6f9bf0217ebd00239b1b2292feba61272d5dd58d0",
"https://deno.land/std@0.148.0/async/debounce.ts": "564273ef242bcfcda19a439132f940db8694173abffc159ea34f07d18fc42620",
"https://deno.land/std@0.148.0/async/deferred.ts": "bc18e28108252c9f67dfca2bbc4587c3cbf3aeb6e155f8c864ca8ecff992b98a",
"https://deno.land/std@0.148.0/async/delay.ts": "cbbdf1c87d1aed8edc7bae13592fb3e27e3106e0748f089c263390d4f49e5f6c",
"https://deno.land/std@0.148.0/async/mod.ts": "9852cd8ed897ab2d41a8fbee611d574e97898327db5c19d9d58e41126473f02c",
"https://deno.land/std@0.148.0/async/mux_async_iterator.ts": "5b4aca6781ad0f2e19ccdf1d1a1c092ccd3e00d52050d9c27c772658c8367256",
"https://deno.land/std@0.148.0/async/pool.ts": "ef9eb97b388543acbf0ac32647121e4dbe629236899586c4d4311a8770fbb239",
"https://deno.land/std@0.148.0/async/tee.ts": "bcfae0017ebb718cf4eef9e2420e8675d91cb1bcc0ed9b668681af6e6caad846",
"https://deno.land/std@0.148.0/http/server.ts": "0b0a9f3abfcfecead944b31ee9098a0c11a59b0495bf873ee200eb80e7441483"
},
"workspace": {
"packageJson": {
"dependencies": [
"npm:@bufbuild/protobuf@^2.0.0",
"npm:@eslint/js@^9.9.0",
"npm:@stylistic/eslint-plugin@^2.6.4",
"npm:@types/eslint__js@^8.42.3",
"npm:eslint@^9.9.0",
"npm:globals@^15.9.0",
"npm:ts-proto@^2.2.0",
"npm:typescript-eslint@^8.2.0",
"npm:typescript@^5.5.4",
"npm:youtubei.js@^10.4.0"
]
}
}
}

34
test.ts
View File

@@ -1,34 +0,0 @@
import Innertube, { UniversalCache } from 'youtubei.js';
import { GoogleVideo, Protos } from './dist/src/index.js';
const pot = 'MogByekTEuMCHffJ1fWU29jibLXb2em_4I0sBL3WX8kzmtnI2VOVIlJJjZ7mCf1E-4DaRwrPPqBXdL2ECFrjdNt2vIdAiTgbN44Q1asvZdjBr0bWFJsIzQRXUSXBRZDPq0IRZHTNc_B8ItbgV6yx7kJ4FOgkDsqj-_lubvsyWHjnq85WqGxEut11eQ==';
const innertube = await Innertube.create({
cache: new UniversalCache(true),
po_token: pot,
visitor_data: 'CgtHelk0ajJwY185SSi91OO2BjIKCgJCUhIEGgAgZzoKILKg8r3TybrsZg%3D%3D',
});
const info = await innertube.getBasicInfo('nVSXA2t3F0U');
const audioFormat = info.chooseFormat({
quality: "best",
format: "mp4",
type: 'audio',
});
const url = audioFormat.decipher(innertube.session.player);
const response = await fetch(url + `&range=4583871-5785063&ump=1&srfvp=1`, {
method: 'POST',
});
const data = await response.arrayBuffer();
let dataBuffer = new GoogleVideo.ChunkedDataBuffer([new Uint8Array(data)]);
const ump = new GoogleVideo.UMP(dataBuffer);
ump.parse((part) => {
console.log(part);
});