mirror of
https://github.com/LuanRT/YouTube.js.git
synced 2026-06-13 01:22:11 +00:00
refactor: Migrate to ts-proto (#752)
* refactor: Add extracted protos * refactor: Remove old stuff and update affected code * chore(package): Update `build:proto` script * chore(ClientInfo): Rename `androidSdkVersion` to `android_sdk_version` * chore: remove refs to old proto file * refactor(sabr_request): Rename `Gw` to `media_type` * chore(sabr_request): Fix typo in field num * feat(parser): Parse `video_playback_ustreamer_config` and `server_abr_streaming_url` * refactor: update protos * chore(package): streamline clean and build scripts * chore: update package.json * chore: update npmignore * chore(protos): Remove unneeded definitions See https://github.com/LuanRT/googlevideo for video playback proto definitions. * chore(package): add `rimraf` dependency
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { Innertube, Proto, UniversalCache, Utils } from '../../../../bundle/browser';
|
||||
import { Innertube, ProtoUtils, UniversalCache, Utils } from '../../../../bundle/browser';
|
||||
import BG from 'bgutils-js';
|
||||
|
||||
// @ts-ignore - Shaka's TS support is not the best.
|
||||
@@ -13,7 +13,7 @@ const form = document.querySelector('form') as HTMLFormElement;
|
||||
|
||||
|
||||
async function main() {
|
||||
const visitorData = Proto.encodeVisitorData(Utils.generateRandomString(11), Math.floor(Date.now() / 1000));
|
||||
const visitorData = ProtoUtils.encodeVisitorData(Utils.generateRandomString(11), Math.floor(Date.now() / 1000));
|
||||
const poToken = await getPo(visitorData);
|
||||
|
||||
const yt = await Innertube.create({
|
||||
|
||||
Reference in New Issue
Block a user