mirror of
https://github.com/LuanRT/YouTube.js.git
synced 2026-07-02 04:58:42 +00:00
* feat(Innertube): Add method to get a community post * feat(Innertube): add a method to get Community Post comments * Follow naming conventions of the project instead of using C# conventions --------- Co-authored-by: absidue <48293849+absidue@users.noreply.github.com>
491 lines
14 KiB
TypeScript
491 lines
14 KiB
TypeScript
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
// versions:
|
|
// protoc-gen-ts_proto v2.2.0
|
|
// protoc v5.29.2
|
|
// source: youtube/api/pfiinnertube/playback_context.proto
|
|
|
|
/* eslint-disable */
|
|
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
|
|
|
export const protobufPackage = "youtube.api.pfiinnertube";
|
|
|
|
export interface PlaybackContext {
|
|
contentPlaybackContext?: PlaybackContext_ContentPlaybackContext | undefined;
|
|
}
|
|
|
|
export interface PlaybackContext_ContentPlaybackContext {
|
|
deviceSignals?: string | undefined;
|
|
revShareClientId?: string | undefined;
|
|
timeSinceLastAdSeconds?: number | undefined;
|
|
lactMilliseconds?: number | undefined;
|
|
autoplaysSinceLastAd?: number | undefined;
|
|
vis?: number | undefined;
|
|
fling?: boolean | undefined;
|
|
splay?: boolean | undefined;
|
|
autoplay?: boolean | undefined;
|
|
timeOfLastInstreamPrerollAd?: number | undefined;
|
|
currentUrl?: string | undefined;
|
|
referer?: string | undefined;
|
|
loadAnnotationsByDemand?: boolean | undefined;
|
|
autoCaptionsDefaultOn?:
|
|
| boolean
|
|
| undefined;
|
|
/** optional ForceAdParameters force_ad_parameters = 25; */
|
|
slicedBread?: boolean | undefined;
|
|
autonav?: boolean | undefined;
|
|
trailer?:
|
|
| boolean
|
|
| undefined;
|
|
/**
|
|
* optional MdxPlaybackContext mdx_context = 31;
|
|
* optional LivePlaybackContext live_context = 32;
|
|
*/
|
|
playerWidthPixels?: number | undefined;
|
|
playerHeightPixels?:
|
|
| number
|
|
| undefined;
|
|
/** optional Html5Preference html5_preference = 36; */
|
|
snd?: number | undefined;
|
|
vnd?:
|
|
| number
|
|
| undefined;
|
|
/** optional UnpluggedContentPlaybackContext unplugged_context = 40; */
|
|
uao?: number | undefined;
|
|
mutedAutoplay?:
|
|
| boolean
|
|
| undefined;
|
|
/** optional AutonavSettingsState autonav_state = 45; */
|
|
enablePrivacyFilter?: boolean | undefined;
|
|
isLivingRoomDeeplink?: boolean | undefined;
|
|
signatureTimestamp?:
|
|
| number
|
|
| undefined;
|
|
/** optional TrailerPlaybackContext trailer_context = 49; */
|
|
isInlinePlaybackNoAd?: boolean | undefined;
|
|
isInlineUnmutedPlayback?:
|
|
| boolean
|
|
| undefined;
|
|
/**
|
|
* optional CustomTabContext custom_tab_context = 52;
|
|
* optional VideoPlaybackPosition player_playback_position = 54;
|
|
*/
|
|
playPackageVersion?:
|
|
| number
|
|
| undefined;
|
|
/**
|
|
* optional CoWatchPlaybackContext co_watch_context = 56;
|
|
* optional WatchAmbientModePlaybackContext watch_ambient_mode_context = 57;
|
|
* optional CompositeVideoPlaybackContext composite_video_context = 58;
|
|
*/
|
|
isSequenceEntry?: boolean | undefined;
|
|
}
|
|
|
|
function createBasePlaybackContext(): PlaybackContext {
|
|
return { contentPlaybackContext: undefined };
|
|
}
|
|
|
|
export const PlaybackContext: MessageFns<PlaybackContext> = {
|
|
encode(message: PlaybackContext, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
if (message.contentPlaybackContext !== undefined) {
|
|
PlaybackContext_ContentPlaybackContext.encode(message.contentPlaybackContext, writer.uint32(10).fork()).join();
|
|
}
|
|
return writer;
|
|
},
|
|
|
|
decode(input: BinaryReader | Uint8Array, length?: number): PlaybackContext {
|
|
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
let end = length === undefined ? reader.len : reader.pos + length;
|
|
const message = createBasePlaybackContext();
|
|
while (reader.pos < end) {
|
|
const tag = reader.uint32();
|
|
switch (tag >>> 3) {
|
|
case 1:
|
|
if (tag !== 10) {
|
|
break;
|
|
}
|
|
|
|
message.contentPlaybackContext = PlaybackContext_ContentPlaybackContext.decode(reader, reader.uint32());
|
|
continue;
|
|
}
|
|
if ((tag & 7) === 4 || tag === 0) {
|
|
break;
|
|
}
|
|
reader.skip(tag & 7);
|
|
}
|
|
return message;
|
|
},
|
|
};
|
|
|
|
function createBasePlaybackContext_ContentPlaybackContext(): PlaybackContext_ContentPlaybackContext {
|
|
return {
|
|
deviceSignals: undefined,
|
|
revShareClientId: undefined,
|
|
timeSinceLastAdSeconds: undefined,
|
|
lactMilliseconds: undefined,
|
|
autoplaysSinceLastAd: undefined,
|
|
vis: undefined,
|
|
fling: undefined,
|
|
splay: undefined,
|
|
autoplay: undefined,
|
|
timeOfLastInstreamPrerollAd: undefined,
|
|
currentUrl: undefined,
|
|
referer: undefined,
|
|
loadAnnotationsByDemand: undefined,
|
|
autoCaptionsDefaultOn: undefined,
|
|
slicedBread: undefined,
|
|
autonav: undefined,
|
|
trailer: undefined,
|
|
playerWidthPixels: undefined,
|
|
playerHeightPixels: undefined,
|
|
snd: undefined,
|
|
vnd: undefined,
|
|
uao: undefined,
|
|
mutedAutoplay: undefined,
|
|
enablePrivacyFilter: undefined,
|
|
isLivingRoomDeeplink: undefined,
|
|
signatureTimestamp: undefined,
|
|
isInlinePlaybackNoAd: undefined,
|
|
isInlineUnmutedPlayback: undefined,
|
|
playPackageVersion: undefined,
|
|
isSequenceEntry: undefined,
|
|
};
|
|
}
|
|
|
|
export const PlaybackContext_ContentPlaybackContext: MessageFns<PlaybackContext_ContentPlaybackContext> = {
|
|
encode(message: PlaybackContext_ContentPlaybackContext, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
if (message.deviceSignals !== undefined) {
|
|
writer.uint32(10).string(message.deviceSignals);
|
|
}
|
|
if (message.revShareClientId !== undefined) {
|
|
writer.uint32(26).string(message.revShareClientId);
|
|
}
|
|
if (message.timeSinceLastAdSeconds !== undefined) {
|
|
writer.uint32(32).uint32(message.timeSinceLastAdSeconds);
|
|
}
|
|
if (message.lactMilliseconds !== undefined) {
|
|
writer.uint32(40).int64(message.lactMilliseconds);
|
|
}
|
|
if (message.autoplaysSinceLastAd !== undefined) {
|
|
writer.uint32(48).uint32(message.autoplaysSinceLastAd);
|
|
}
|
|
if (message.vis !== undefined) {
|
|
writer.uint32(64).uint32(message.vis);
|
|
}
|
|
if (message.fling !== undefined) {
|
|
writer.uint32(72).bool(message.fling);
|
|
}
|
|
if (message.splay !== undefined) {
|
|
writer.uint32(80).bool(message.splay);
|
|
}
|
|
if (message.autoplay !== undefined) {
|
|
writer.uint32(88).bool(message.autoplay);
|
|
}
|
|
if (message.timeOfLastInstreamPrerollAd !== undefined) {
|
|
writer.uint32(104).uint64(message.timeOfLastInstreamPrerollAd);
|
|
}
|
|
if (message.currentUrl !== undefined) {
|
|
writer.uint32(122).string(message.currentUrl);
|
|
}
|
|
if (message.referer !== undefined) {
|
|
writer.uint32(130).string(message.referer);
|
|
}
|
|
if (message.loadAnnotationsByDemand !== undefined) {
|
|
writer.uint32(184).bool(message.loadAnnotationsByDemand);
|
|
}
|
|
if (message.autoCaptionsDefaultOn !== undefined) {
|
|
writer.uint32(192).bool(message.autoCaptionsDefaultOn);
|
|
}
|
|
if (message.slicedBread !== undefined) {
|
|
writer.uint32(216).bool(message.slicedBread);
|
|
}
|
|
if (message.autonav !== undefined) {
|
|
writer.uint32(232).bool(message.autonav);
|
|
}
|
|
if (message.trailer !== undefined) {
|
|
writer.uint32(240).bool(message.trailer);
|
|
}
|
|
if (message.playerWidthPixels !== undefined) {
|
|
writer.uint32(272).int32(message.playerWidthPixels);
|
|
}
|
|
if (message.playerHeightPixels !== undefined) {
|
|
writer.uint32(280).int32(message.playerHeightPixels);
|
|
}
|
|
if (message.snd !== undefined) {
|
|
writer.uint32(296).int32(message.snd);
|
|
}
|
|
if (message.vnd !== undefined) {
|
|
writer.uint32(304).int32(message.vnd);
|
|
}
|
|
if (message.uao !== undefined) {
|
|
writer.uint32(328).int32(message.uao);
|
|
}
|
|
if (message.mutedAutoplay !== undefined) {
|
|
writer.uint32(352).bool(message.mutedAutoplay);
|
|
}
|
|
if (message.enablePrivacyFilter !== undefined) {
|
|
writer.uint32(368).bool(message.enablePrivacyFilter);
|
|
}
|
|
if (message.isLivingRoomDeeplink !== undefined) {
|
|
writer.uint32(376).bool(message.isLivingRoomDeeplink);
|
|
}
|
|
if (message.signatureTimestamp !== undefined) {
|
|
writer.uint32(384).uint32(message.signatureTimestamp);
|
|
}
|
|
if (message.isInlinePlaybackNoAd !== undefined) {
|
|
writer.uint32(400).bool(message.isInlinePlaybackNoAd);
|
|
}
|
|
if (message.isInlineUnmutedPlayback !== undefined) {
|
|
writer.uint32(408).bool(message.isInlineUnmutedPlayback);
|
|
}
|
|
if (message.playPackageVersion !== undefined) {
|
|
writer.uint32(440).int64(message.playPackageVersion);
|
|
}
|
|
if (message.isSequenceEntry !== undefined) {
|
|
writer.uint32(480).bool(message.isSequenceEntry);
|
|
}
|
|
return writer;
|
|
},
|
|
|
|
decode(input: BinaryReader | Uint8Array, length?: number): PlaybackContext_ContentPlaybackContext {
|
|
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
let end = length === undefined ? reader.len : reader.pos + length;
|
|
const message = createBasePlaybackContext_ContentPlaybackContext();
|
|
while (reader.pos < end) {
|
|
const tag = reader.uint32();
|
|
switch (tag >>> 3) {
|
|
case 1:
|
|
if (tag !== 10) {
|
|
break;
|
|
}
|
|
|
|
message.deviceSignals = reader.string();
|
|
continue;
|
|
case 3:
|
|
if (tag !== 26) {
|
|
break;
|
|
}
|
|
|
|
message.revShareClientId = reader.string();
|
|
continue;
|
|
case 4:
|
|
if (tag !== 32) {
|
|
break;
|
|
}
|
|
|
|
message.timeSinceLastAdSeconds = reader.uint32();
|
|
continue;
|
|
case 5:
|
|
if (tag !== 40) {
|
|
break;
|
|
}
|
|
|
|
message.lactMilliseconds = longToNumber(reader.int64());
|
|
continue;
|
|
case 6:
|
|
if (tag !== 48) {
|
|
break;
|
|
}
|
|
|
|
message.autoplaysSinceLastAd = reader.uint32();
|
|
continue;
|
|
case 8:
|
|
if (tag !== 64) {
|
|
break;
|
|
}
|
|
|
|
message.vis = reader.uint32();
|
|
continue;
|
|
case 9:
|
|
if (tag !== 72) {
|
|
break;
|
|
}
|
|
|
|
message.fling = reader.bool();
|
|
continue;
|
|
case 10:
|
|
if (tag !== 80) {
|
|
break;
|
|
}
|
|
|
|
message.splay = reader.bool();
|
|
continue;
|
|
case 11:
|
|
if (tag !== 88) {
|
|
break;
|
|
}
|
|
|
|
message.autoplay = reader.bool();
|
|
continue;
|
|
case 13:
|
|
if (tag !== 104) {
|
|
break;
|
|
}
|
|
|
|
message.timeOfLastInstreamPrerollAd = longToNumber(reader.uint64());
|
|
continue;
|
|
case 15:
|
|
if (tag !== 122) {
|
|
break;
|
|
}
|
|
|
|
message.currentUrl = reader.string();
|
|
continue;
|
|
case 16:
|
|
if (tag !== 130) {
|
|
break;
|
|
}
|
|
|
|
message.referer = reader.string();
|
|
continue;
|
|
case 23:
|
|
if (tag !== 184) {
|
|
break;
|
|
}
|
|
|
|
message.loadAnnotationsByDemand = reader.bool();
|
|
continue;
|
|
case 24:
|
|
if (tag !== 192) {
|
|
break;
|
|
}
|
|
|
|
message.autoCaptionsDefaultOn = reader.bool();
|
|
continue;
|
|
case 27:
|
|
if (tag !== 216) {
|
|
break;
|
|
}
|
|
|
|
message.slicedBread = reader.bool();
|
|
continue;
|
|
case 29:
|
|
if (tag !== 232) {
|
|
break;
|
|
}
|
|
|
|
message.autonav = reader.bool();
|
|
continue;
|
|
case 30:
|
|
if (tag !== 240) {
|
|
break;
|
|
}
|
|
|
|
message.trailer = reader.bool();
|
|
continue;
|
|
case 34:
|
|
if (tag !== 272) {
|
|
break;
|
|
}
|
|
|
|
message.playerWidthPixels = reader.int32();
|
|
continue;
|
|
case 35:
|
|
if (tag !== 280) {
|
|
break;
|
|
}
|
|
|
|
message.playerHeightPixels = reader.int32();
|
|
continue;
|
|
case 37:
|
|
if (tag !== 296) {
|
|
break;
|
|
}
|
|
|
|
message.snd = reader.int32();
|
|
continue;
|
|
case 38:
|
|
if (tag !== 304) {
|
|
break;
|
|
}
|
|
|
|
message.vnd = reader.int32();
|
|
continue;
|
|
case 41:
|
|
if (tag !== 328) {
|
|
break;
|
|
}
|
|
|
|
message.uao = reader.int32();
|
|
continue;
|
|
case 44:
|
|
if (tag !== 352) {
|
|
break;
|
|
}
|
|
|
|
message.mutedAutoplay = reader.bool();
|
|
continue;
|
|
case 46:
|
|
if (tag !== 368) {
|
|
break;
|
|
}
|
|
|
|
message.enablePrivacyFilter = reader.bool();
|
|
continue;
|
|
case 47:
|
|
if (tag !== 376) {
|
|
break;
|
|
}
|
|
|
|
message.isLivingRoomDeeplink = reader.bool();
|
|
continue;
|
|
case 48:
|
|
if (tag !== 384) {
|
|
break;
|
|
}
|
|
|
|
message.signatureTimestamp = reader.uint32();
|
|
continue;
|
|
case 50:
|
|
if (tag !== 400) {
|
|
break;
|
|
}
|
|
|
|
message.isInlinePlaybackNoAd = reader.bool();
|
|
continue;
|
|
case 51:
|
|
if (tag !== 408) {
|
|
break;
|
|
}
|
|
|
|
message.isInlineUnmutedPlayback = reader.bool();
|
|
continue;
|
|
case 55:
|
|
if (tag !== 440) {
|
|
break;
|
|
}
|
|
|
|
message.playPackageVersion = longToNumber(reader.int64());
|
|
continue;
|
|
case 60:
|
|
if (tag !== 480) {
|
|
break;
|
|
}
|
|
|
|
message.isSequenceEntry = reader.bool();
|
|
continue;
|
|
}
|
|
if ((tag & 7) === 4 || tag === 0) {
|
|
break;
|
|
}
|
|
reader.skip(tag & 7);
|
|
}
|
|
return message;
|
|
},
|
|
};
|
|
|
|
function longToNumber(int64: { toString(): string }): number {
|
|
const num = globalThis.Number(int64.toString());
|
|
if (num > globalThis.Number.MAX_SAFE_INTEGER) {
|
|
throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER");
|
|
}
|
|
if (num < globalThis.Number.MIN_SAFE_INTEGER) {
|
|
throw new globalThis.Error("Value is smaller than Number.MIN_SAFE_INTEGER");
|
|
}
|
|
return num;
|
|
}
|
|
|
|
export interface MessageFns<T> {
|
|
encode(message: T, writer?: BinaryWriter): BinaryWriter;
|
|
decode(input: BinaryReader | Uint8Array, length?: number): T;
|
|
}
|