diff --git a/deno/package.json b/deno/package.json index 39505cd1..10dde764 100644 --- a/deno/package.json +++ b/deno/package.json @@ -1,6 +1,6 @@ { "name": "youtubei.js", - "version": "7.0.0", + "version": "8.0.0", "description": "A wrapper around YouTube's private API. Supports YouTube, YouTube Music, YouTube Kids and YouTube Studio (WIP).", "type": "module", "types": "./dist/src/platform/lib.d.ts", @@ -89,6 +89,9 @@ "tslib": "^2.5.0", "undici": "^5.19.1" }, + "overrides": { + "typescript": "^5.0.0" + }, "devDependencies": { "@types/glob": "^8.1.0", "@types/jest": "^28.1.7", diff --git a/deno/src/Innertube.ts b/deno/src/Innertube.ts index 55927c48..8cb85046 100644 --- a/deno/src/Innertube.ts +++ b/deno/src/Innertube.ts @@ -14,6 +14,7 @@ import NotificationsMenu from './parser/youtube/NotificationsMenu.ts'; import Playlist from './parser/youtube/Playlist.ts'; import Search from './parser/youtube/Search.ts'; import VideoInfo from './parser/youtube/VideoInfo.ts'; +import ShortsVideoInfo from './parser/ytshorts/VideoInfo.ts'; import { Kids, Music, Studio } from './core/clients/index.ts'; import { AccountManager, InteractionManager, PlaylistManager } from './core/managers/index.ts'; @@ -30,7 +31,8 @@ import { NextEndpoint, PlayerEndpoint, ResolveURLEndpoint, - SearchEndpoint + SearchEndpoint, + Reel } from './core/endpoints/index.ts'; import { GetUnseenCountEndpoint } from './core/endpoints/notification/index.ts'; @@ -39,6 +41,7 @@ import type { ApiResponse } from './core/Actions.ts'; import { type IBrowseResponse, type IParsedResponse } from './parser/types/index.ts'; import type { INextRequest } from './types/index.ts'; import type { DownloadOptions, FormatOptions } from './types/FormatUtils.ts'; +import { encodeReelSequence } from './proto/index.ts'; export type InnertubeConfig = SessionOptions; @@ -131,6 +134,32 @@ export default class Innertube { return new VideoInfo([ response ], this.actions, cpn); } + /** + * Retrieves shorts info. + * @param short_id - The short id. + * @param client - The client to use. + */ + async getShortsWatchItem(short_id: string, client?: InnerTubeClient): Promise { + throwIfMissing({ short_id }); + + const watchResponse = this.actions.execute( + Reel.WatchEndpoint.PATH, Reel.WatchEndpoint.build({ + short_id: short_id, + client: client + }) + ); + + const sequenceResponse = this.actions.execute( + Reel.WatchSequenceEndpoint.PATH, Reel.WatchSequenceEndpoint.build({ + sequenceParams: encodeReelSequence(short_id) + }) + ); + + const response = await Promise.all([ watchResponse, sequenceResponse ]); + + return new ShortsVideoInfo(response, this.actions); + } + /** * Searches a given query. * @param query - The search query. diff --git a/deno/src/core/Actions.ts b/deno/src/core/Actions.ts index 58a23070..347eea7f 100644 --- a/deno/src/core/Actions.ts +++ b/deno/src/core/Actions.ts @@ -1,4 +1,4 @@ -import Parser, { NavigateAction } from '../parser/index.ts'; +import { Parser, NavigateAction } from '../parser/index.ts'; import { InnertubeError } from '../utils/Utils.ts'; import type Session from './Session.ts'; @@ -16,7 +16,7 @@ export interface ApiResponse { data: IRawResponse; } -export type InnertubeEndpoint = '/player' | '/search' | '/browse' | '/next' | '/updated_metadata' | '/notification/get_notification_menu' | string; +export type InnertubeEndpoint = '/player' | '/search' | '/browse' | '/next' | '/reel' | '/updated_metadata' | '/notification/get_notification_menu' | string; export type ParsedResponse = T extends '/player' ? IPlayerResponse : diff --git a/deno/src/core/Player.ts b/deno/src/core/Player.ts index 9dfad9a0..a9c25fd8 100644 --- a/deno/src/core/Player.ts +++ b/deno/src/core/Player.ts @@ -10,7 +10,6 @@ import type { FetchFunction } from '../types/PlatformShim.ts'; */ export default class Player { #nsig_sc; - #nsig_cache; #sig_sc; #sig_sc_timestamp; #player_id; @@ -22,8 +21,6 @@ export default class Player { this.#sig_sc_timestamp = signature_timestamp; this.#player_id = player_id; - - this.#nsig_cache = new Map(); } static async create(cache: ICache | undefined, fetch: FetchFunction = Platform.shim.fetch): Promise { diff --git a/deno/src/core/clients/Kids.ts b/deno/src/core/clients/Kids.ts index 2418e858..170b9bf4 100644 --- a/deno/src/core/clients/Kids.ts +++ b/deno/src/core/clients/Kids.ts @@ -1,4 +1,4 @@ -import Parser from '../../parser/index.ts'; +import { Parser } from '../../parser/index.ts'; import Channel from '../../parser/ytkids/Channel.ts'; import HomeFeed from '../../parser/ytkids/HomeFeed.ts'; import Search from '../../parser/ytkids/Search.ts'; diff --git a/deno/src/core/endpoints/index.ts b/deno/src/core/endpoints/index.ts index 8e64dd6e..2ec24637 100644 --- a/deno/src/core/endpoints/index.ts +++ b/deno/src/core/endpoints/index.ts @@ -15,5 +15,6 @@ export * as Music from './music/index.ts'; export * as Notification from './notification/index.ts'; export * as Playlist from './playlist/index.ts'; export * as Subscription from './subscription/index.ts'; +export * as Reel from './reel/index.ts'; export * as Upload from './upload/index.ts'; export * as Kids from './kids/index.ts'; \ No newline at end of file diff --git a/deno/src/core/endpoints/reel/WatchEndpoint.ts b/deno/src/core/endpoints/reel/WatchEndpoint.ts new file mode 100644 index 00000000..37ba1b56 --- /dev/null +++ b/deno/src/core/endpoints/reel/WatchEndpoint.ts @@ -0,0 +1,18 @@ +import type { IReelWatchRequest, ReelWatchEndpointOptions } from '../../../types/index.ts'; + +export const PATH = '/reel/reel_item_watch'; + +/** + * Builds a `/reel/reel_watch_sequence` request payload. + * @param opts - The options to use. + * @returns The payload. + */ +export function build(opts: ReelWatchEndpointOptions): IReelWatchRequest { + return { + playerRequest: { + videoId: opts.short_id, + params: opts.params ?? 'CAUwAg%3D%3D' + }, + params: opts.params ?? 'CAUwAg%3D%3D' + }; +} \ No newline at end of file diff --git a/deno/src/core/endpoints/reel/WatchSequenceEndpoint.ts b/deno/src/core/endpoints/reel/WatchSequenceEndpoint.ts new file mode 100644 index 00000000..5f025853 --- /dev/null +++ b/deno/src/core/endpoints/reel/WatchSequenceEndpoint.ts @@ -0,0 +1,14 @@ +import type { IReelSequenceRequest, ReelWatchSequenceEndpointOptions } from '../../../types/index.ts'; + +export const PATH = '/reel/reel_watch_sequence'; + +/** + * Builds a `/reel/reel_watch_sequence` request payload. + * @param opts - The options to use. + * @returns The payload. + */ +export function build(opts: ReelWatchSequenceEndpointOptions): IReelSequenceRequest { + return { + sequenceParams: opts.sequenceParams + }; +} \ No newline at end of file diff --git a/deno/src/core/endpoints/reel/index.ts b/deno/src/core/endpoints/reel/index.ts new file mode 100644 index 00000000..c01b26b0 --- /dev/null +++ b/deno/src/core/endpoints/reel/index.ts @@ -0,0 +1,2 @@ +export * as WatchEndpoint from './WatchEndpoint.ts'; +export * as WatchSequenceEndpoint from './WatchSequenceEndpoint.ts'; \ No newline at end of file diff --git a/deno/src/core/mixins/Feed.ts b/deno/src/core/mixins/Feed.ts index e7cee5ea..db8ae75d 100644 --- a/deno/src/core/mixins/Feed.ts +++ b/deno/src/core/mixins/Feed.ts @@ -1,5 +1,5 @@ import type { Memo, ObservedArray, SuperParsedResult, YTNode } from '../../parser/helpers.ts'; -import Parser, { ReloadContinuationItemsCommand } from '../../parser/index.ts'; +import { Parser, ReloadContinuationItemsCommand } from '../../parser/index.ts'; import { concatMemos, InnertubeError } from '../../utils/Utils.ts'; import type Actions from '../Actions.ts'; @@ -177,7 +177,7 @@ export default class Feed { * Checks if the feed has continuation. */ get has_continuation(): boolean { - return (this.#memo.get('ContinuationItem') || []).length > 0; + return this.#getBodyContinuations().length > 0; } /** @@ -193,7 +193,7 @@ export default class Feed { return response; } - this.#continuation = this.#memo.getType(ContinuationItem); + this.#continuation = this.#getBodyContinuations(); if (this.#continuation) return this.getContinuationData(); @@ -208,4 +208,14 @@ export default class Feed { throw new InnertubeError('Could not get continuation data'); return new Feed(this.actions, continuation_data, true); } + + #getBodyContinuations(): ObservedArray { + if (this.#page.header_memo) { + const header_continuations = this.#page.header_memo.getType(ContinuationItem); + + return this.#memo.getType(ContinuationItem).filter((continuation) => !header_continuations.includes(continuation)) as ObservedArray; + } + + return this.#memo.getType(ContinuationItem); + } } \ No newline at end of file diff --git a/deno/src/core/mixins/MediaInfo.ts b/deno/src/core/mixins/MediaInfo.ts index cb7f57eb..aaacebc4 100644 --- a/deno/src/core/mixins/MediaInfo.ts +++ b/deno/src/core/mixins/MediaInfo.ts @@ -6,7 +6,7 @@ import * as FormatUtils from '../../utils/FormatUtils.ts'; import { InnertubeError } from '../../utils/Utils.ts'; import type Format from '../../parser/classes/misc/Format.ts'; import type { INextResponse, IPlayerResponse } from '../../parser/index.ts'; -import Parser from '../../parser/index.ts'; +import { Parser } from '../../parser/index.ts'; import type { DashOptions } from '../../types/DashOptions.ts'; import PlayerStoryboardSpec from '../../parser/classes/PlayerStoryboardSpec.ts'; import { getStreamingInfo } from '../../utils/StreamingInfo.ts'; diff --git a/deno/src/parser/classes/AboutChannel.ts b/deno/src/parser/classes/AboutChannel.ts new file mode 100644 index 00000000..3b72462e --- /dev/null +++ b/deno/src/parser/classes/AboutChannel.ts @@ -0,0 +1,18 @@ +import { YTNode } from '../helpers.ts'; +import { Parser, type RawNode } from '../index.ts'; +import AboutChannelView from './AboutChannelView.ts'; +import Button from './Button.ts'; + +export default class AboutChannel extends YTNode { + static type = 'AboutChannel'; + + metadata: AboutChannelView | null; + share_channel: Button | null; + + constructor(data: RawNode) { + super(); + + this.metadata = Parser.parseItem(data.metadata, AboutChannelView); + this.share_channel = Parser.parseItem(data.shareChannel, Button); + } +} \ No newline at end of file diff --git a/deno/src/parser/classes/AboutChannelView.ts b/deno/src/parser/classes/AboutChannelView.ts new file mode 100644 index 00000000..82fc1786 --- /dev/null +++ b/deno/src/parser/classes/AboutChannelView.ts @@ -0,0 +1,87 @@ +import type { ObservedArray } from '../helpers.ts'; +import { YTNode } from '../helpers.ts'; +import { Parser, type RawNode } from '../index.ts'; +import ChannelExternalLinkView from './ChannelExternalLinkView.ts'; +import NavigationEndpoint from './NavigationEndpoint.ts'; +import Text from './misc/Text.ts'; + +export default class AboutChannelView extends YTNode { + static type = 'AboutChannelView'; + + description?: string; + description_label?: Text; + country?: string; + custom_links_label?: Text; + subscriber_count?: string; + view_count?: string; + joined_date?: Text; + canonical_channel_url?: string; + channel_id?: string; + additional_info_label?: Text; + custom_url_on_tap?: NavigationEndpoint; + video_count?: string; + sign_in_for_business_email?: Text; + links: ObservedArray; + + constructor(data: RawNode) { + super(); + + if (Reflect.has(data, 'description')) { + this.description = data.description; + } + + if (Reflect.has(data, 'descriptionLabel')) { + this.description_label = Text.fromAttributed(data.descriptionLabel); + } + + if (Reflect.has(data, 'country')) { + this.country = data.country; + } + + if (Reflect.has(data, 'customLinksLabel')) { + this.custom_links_label = Text.fromAttributed(data.customLinksLabel); + } + + if (Reflect.has(data, 'subscriberCountText')) { + this.subscriber_count = data.subscriberCountText; + } + + if (Reflect.has(data, 'viewCountText')) { + this.view_count = data.viewCountText; + } + + if (Reflect.has(data, 'joinedDateText')) { + this.joined_date = Text.fromAttributed(data.joinedDateText); + } + + if (Reflect.has(data, 'canonicalChannelUrl')) { + this.canonical_channel_url = data.canonicalChannelUrl; + } + + if (Reflect.has(data, 'channelId')) { + this.channel_id = data.channelId; + } + + if (Reflect.has(data, 'additionalInfoLabel')) { + this.additional_info_label = Text.fromAttributed(data.additionalInfoLabel); + } + + if (Reflect.has(data, 'customUrlOnTap')) { + this.custom_url_on_tap = new NavigationEndpoint(data.customUrlOnTap); + } + + if (Reflect.has(data, 'videoCountText')) { + this.video_count = data.videoCountText; + } + + if (Reflect.has(data, 'signInForBusinessEmail')) { + this.sign_in_for_business_email = Text.fromAttributed(data.signInForBusinessEmail); + } + + if (Reflect.has(data, 'links')) { + this.links = Parser.parseArray(data.links, ChannelExternalLinkView); + } else { + this.links = [] as unknown as ObservedArray; + } + } +} \ No newline at end of file diff --git a/deno/src/parser/classes/AccountItemSection.ts b/deno/src/parser/classes/AccountItemSection.ts index 6c591b69..708f91c5 100644 --- a/deno/src/parser/classes/AccountItemSection.ts +++ b/deno/src/parser/classes/AccountItemSection.ts @@ -1,4 +1,4 @@ -import Parser from '../index.ts'; +import { Parser } from '../index.ts'; import AccountItemSectionHeader from './AccountItemSectionHeader.ts'; import NavigationEndpoint from './NavigationEndpoint.ts'; import Text from './misc/Text.ts'; diff --git a/deno/src/parser/classes/AccountSectionList.ts b/deno/src/parser/classes/AccountSectionList.ts index faec5a61..7ea455d0 100644 --- a/deno/src/parser/classes/AccountSectionList.ts +++ b/deno/src/parser/classes/AccountSectionList.ts @@ -1,4 +1,4 @@ -import Parser from '../index.ts'; +import { Parser } from '../index.ts'; import AccountChannel from './AccountChannel.ts'; import AccountItemSection from './AccountItemSection.ts'; diff --git a/deno/src/parser/classes/BackstagePost.ts b/deno/src/parser/classes/BackstagePost.ts index 20bc1629..8683ca0d 100644 --- a/deno/src/parser/classes/BackstagePost.ts +++ b/deno/src/parser/classes/BackstagePost.ts @@ -1,5 +1,5 @@ import { YTNode } from '../helpers.ts'; -import Parser, { type RawNode } from '../index.ts'; +import { Parser, type RawNode } from '../index.ts'; import Button from './Button.ts'; import NavigationEndpoint from './NavigationEndpoint.ts'; import CommentActionButtons from './comments/CommentActionButtons.ts'; diff --git a/deno/src/parser/classes/BackstagePostThread.ts b/deno/src/parser/classes/BackstagePostThread.ts index ea20e0fd..ccc76930 100644 --- a/deno/src/parser/classes/BackstagePostThread.ts +++ b/deno/src/parser/classes/BackstagePostThread.ts @@ -1,4 +1,4 @@ -import Parser, { type RawNode } from '../index.ts'; +import { Parser, type RawNode } from '../index.ts'; import { YTNode } from '../helpers.ts'; export default class BackstagePostThread extends YTNode { diff --git a/deno/src/parser/classes/BrowseFeedActions.ts b/deno/src/parser/classes/BrowseFeedActions.ts index 03113935..47a8a073 100644 --- a/deno/src/parser/classes/BrowseFeedActions.ts +++ b/deno/src/parser/classes/BrowseFeedActions.ts @@ -1,4 +1,4 @@ -import Parser, { type RawNode } from '../index.ts'; +import { Parser, type RawNode } from '../index.ts'; import { type ObservedArray, YTNode } from '../helpers.ts'; export default class BrowseFeedActions extends YTNode { diff --git a/deno/src/parser/classes/ButtonView.ts b/deno/src/parser/classes/ButtonView.ts new file mode 100644 index 00000000..553ea71a --- /dev/null +++ b/deno/src/parser/classes/ButtonView.ts @@ -0,0 +1,28 @@ +import { YTNode } from '../helpers.ts'; +import type { RawNode } from '../index.ts'; +import NavigationEndpoint from './NavigationEndpoint.ts'; + +export default class ButtonView extends YTNode { + static type = 'ButtonView'; + + icon_name: string; + title: string; + accessibility_text: string; + style: string; + is_full_width: boolean; + type: string; + button_size: string; + on_tap: NavigationEndpoint; + + constructor(data: RawNode) { + super(); + this.icon_name = data.iconName; + this.title = data.title; + this.accessibility_text = data.accessibilityText; + this.style = data.style; + this.is_full_width = data.isFullWidth; + this.type = data.type; + this.button_size = data.buttonSize; + this.on_tap = new NavigationEndpoint(data.onTap); + } +} \ No newline at end of file diff --git a/deno/src/parser/classes/C4TabbedHeader.ts b/deno/src/parser/classes/C4TabbedHeader.ts index 3e77899e..1c8a5d04 100644 --- a/deno/src/parser/classes/C4TabbedHeader.ts +++ b/deno/src/parser/classes/C4TabbedHeader.ts @@ -1,8 +1,9 @@ import { YTNode } from '../helpers.ts'; -import Parser, { type RawNode } from '../index.ts'; +import { Parser, type RawNode } from '../index.ts'; import Button from './Button.ts'; import ChannelHeaderLinks from './ChannelHeaderLinks.ts'; import ChannelHeaderLinksView from './ChannelHeaderLinksView.ts'; +import ChannelTagline from './ChannelTagline.ts'; import SubscribeButton from './SubscribeButton.ts'; import Author from './misc/Author.ts'; import Text from './misc/Text.ts'; @@ -22,6 +23,7 @@ export default class C4TabbedHeader extends YTNode { header_links?: ChannelHeaderLinks | ChannelHeaderLinksView | null; channel_handle?: Text; channel_id?: string; + tagline?: ChannelTagline | null; constructor(data: RawNode) { super(); @@ -69,5 +71,9 @@ export default class C4TabbedHeader extends YTNode { if (Reflect.has(data, 'channelId')) { this.channel_id = data.channelId; } + + if (Reflect.has(data, 'tagline')) { + this.tagline = Parser.parseItem(data.tagline, ChannelTagline); + } } } \ No newline at end of file diff --git a/deno/src/parser/classes/Card.ts b/deno/src/parser/classes/Card.ts index f6a59913..58191ea6 100644 --- a/deno/src/parser/classes/Card.ts +++ b/deno/src/parser/classes/Card.ts @@ -1,4 +1,4 @@ -import Parser, { type RawNode } from '../index.ts'; +import { Parser, type RawNode } from '../index.ts'; import { YTNode } from '../helpers.ts'; export default class Card extends YTNode { diff --git a/deno/src/parser/classes/CardCollection.ts b/deno/src/parser/classes/CardCollection.ts index e3a64004..8453b853 100644 --- a/deno/src/parser/classes/CardCollection.ts +++ b/deno/src/parser/classes/CardCollection.ts @@ -1,5 +1,5 @@ import { YTNode, type ObservedArray } from '../helpers.ts'; -import Parser, { type RawNode } from '../index.ts'; +import { Parser, type RawNode } from '../index.ts'; import Text from './misc/Text.ts'; export default class CardCollection extends YTNode { diff --git a/deno/src/parser/classes/CarouselHeader.ts b/deno/src/parser/classes/CarouselHeader.ts index d55dff1b..82f66ecf 100644 --- a/deno/src/parser/classes/CarouselHeader.ts +++ b/deno/src/parser/classes/CarouselHeader.ts @@ -1,4 +1,4 @@ -import Parser, { type RawNode } from '../index.ts'; +import { Parser, type RawNode } from '../index.ts'; import { type ObservedArray, YTNode } from '../helpers.ts'; export default class CarouselHeader extends YTNode { diff --git a/deno/src/parser/classes/CarouselItem.ts b/deno/src/parser/classes/CarouselItem.ts index 0723a50c..85ccb423 100644 --- a/deno/src/parser/classes/CarouselItem.ts +++ b/deno/src/parser/classes/CarouselItem.ts @@ -1,4 +1,4 @@ -import Parser, { type RawNode } from '../index.ts'; +import { Parser, type RawNode } from '../index.ts'; import { type ObservedArray, YTNode } from '../helpers.ts'; import Thumbnail from './misc/Thumbnail.ts'; diff --git a/deno/src/parser/classes/CarouselLockup.ts b/deno/src/parser/classes/CarouselLockup.ts index 32737f24..c7b64f08 100644 --- a/deno/src/parser/classes/CarouselLockup.ts +++ b/deno/src/parser/classes/CarouselLockup.ts @@ -1,6 +1,6 @@ import { type ObservedArray, YTNode } from '../helpers.ts'; import InfoRow from './InfoRow.ts'; -import Parser, { type RawNode } from '../index.ts'; +import { Parser, type RawNode } from '../index.ts'; import CompactVideo from './CompactVideo.ts'; export default class CarouselLockup extends YTNode { diff --git a/deno/src/parser/classes/Channel.ts b/deno/src/parser/classes/Channel.ts index efe92936..04b709c5 100644 --- a/deno/src/parser/classes/Channel.ts +++ b/deno/src/parser/classes/Channel.ts @@ -1,5 +1,5 @@ import { YTNode } from '../helpers.ts'; -import Parser, { type RawNode } from '../index.ts'; +import { Parser, type RawNode } from '../index.ts'; import Button from './Button.ts'; import NavigationEndpoint from './NavigationEndpoint.ts'; import SubscribeButton from './SubscribeButton.ts'; diff --git a/deno/src/parser/classes/ChannelAboutFullMetadata.ts b/deno/src/parser/classes/ChannelAboutFullMetadata.ts index 5e037fdd..53b70334 100644 --- a/deno/src/parser/classes/ChannelAboutFullMetadata.ts +++ b/deno/src/parser/classes/ChannelAboutFullMetadata.ts @@ -1,5 +1,5 @@ import { YTNode, type ObservedArray } from '../helpers.ts'; -import Parser, { type RawNode } from '../index.ts'; +import { Parser, type RawNode } from '../index.ts'; import Button from './Button.ts'; import NavigationEndpoint from './NavigationEndpoint.ts'; import Text from './misc/Text.ts'; diff --git a/deno/src/parser/classes/ChannelExternalLinkView.ts b/deno/src/parser/classes/ChannelExternalLinkView.ts new file mode 100644 index 00000000..0440297d --- /dev/null +++ b/deno/src/parser/classes/ChannelExternalLinkView.ts @@ -0,0 +1,20 @@ +import { YTNode } from '../helpers.ts'; +import type { RawNode } from '../index.ts'; +import Text from './misc/Text.ts'; +import Thumbnail from './misc/Thumbnail.ts'; + +export default class ChannelExternalLinkView extends YTNode { + static type = 'ChannelExternalLinkView'; + + title: Text; + link: Text; + favicon: Thumbnail[]; + + constructor(data: RawNode) { + super(); + + this.title = Text.fromAttributed(data.title); + this.link = Text.fromAttributed(data.link); + this.favicon = data.favicon.sources.map((x: any) => new Thumbnail(x)).sort((a: Thumbnail, b: Thumbnail) => b.width - a.width); + } +} \ No newline at end of file diff --git a/deno/src/parser/classes/ChannelFeaturedContent.ts b/deno/src/parser/classes/ChannelFeaturedContent.ts index 0476ee61..70156479 100644 --- a/deno/src/parser/classes/ChannelFeaturedContent.ts +++ b/deno/src/parser/classes/ChannelFeaturedContent.ts @@ -1,5 +1,5 @@ import { type ObservedArray, YTNode } from '../helpers.ts'; -import Parser, { type RawNode } from '../index.ts'; +import { Parser, type RawNode } from '../index.ts'; import Text from './misc/Text.ts'; export default class ChannelFeaturedContent extends YTNode { diff --git a/deno/src/parser/classes/ChannelOwnerEmptyState.ts b/deno/src/parser/classes/ChannelOwnerEmptyState.ts new file mode 100644 index 00000000..c76e78a3 --- /dev/null +++ b/deno/src/parser/classes/ChannelOwnerEmptyState.ts @@ -0,0 +1,17 @@ +import { YTNode } from '../helpers.ts'; +import type { RawNode } from '../index.ts'; +import Text from './misc/Text.ts'; +import Thumbnail from './misc/Thumbnail.ts'; + +export default class ChannelOwnerEmptyState extends YTNode { + static type = 'ChannelOwnerEmptyState'; + + illustration: Thumbnail[]; + description: Text; + + constructor(data: RawNode) { + super(); + this.illustration = Thumbnail.fromResponse(data.illustration); + this.description = new Text(data.description); + } +} \ No newline at end of file diff --git a/deno/src/parser/classes/ChannelSubMenu.ts b/deno/src/parser/classes/ChannelSubMenu.ts index deae0458..f9cf4abd 100644 --- a/deno/src/parser/classes/ChannelSubMenu.ts +++ b/deno/src/parser/classes/ChannelSubMenu.ts @@ -1,5 +1,5 @@ import { YTNode } from '../helpers.ts'; -import Parser, { type RawNode } from '../index.ts'; +import { Parser, type RawNode } from '../index.ts'; import NavigationEndpoint from './NavigationEndpoint.ts'; export default class ChannelSubMenu extends YTNode { diff --git a/deno/src/parser/classes/ChannelTagline.ts b/deno/src/parser/classes/ChannelTagline.ts new file mode 100644 index 00000000..6d48c5cc --- /dev/null +++ b/deno/src/parser/classes/ChannelTagline.ts @@ -0,0 +1,44 @@ +import { YTNode } from '../helpers.ts'; +import { Parser, type RawNode } from '../index.ts'; +import NavigationEndpoint from './NavigationEndpoint.ts'; +import EngagementPanelSectionList from './EngagementPanelSectionList.ts'; + +export default class ChannelTagline extends YTNode { + static type = 'ChannelTagline'; + + content: string; + max_lines: number; + more_endpoint: { + show_engagement_panel_endpoint: { + engagement_panel: EngagementPanelSectionList | null, + engagement_panel_popup_type: string; + identifier: { + surface: string, + tag: string + } + } + } | NavigationEndpoint; + more_icon_type: string; + more_label: string; + target_id: string; + + constructor(data: RawNode) { + super(); + + this.content = data.content; + this.max_lines = data.maxLines; + this.more_endpoint = data.moreEndpoint.showEngagementPanelEndpoint ? { + show_engagement_panel_endpoint: { + engagement_panel: Parser.parseItem(data.moreEndpoint.showEngagementPanelEndpoint.engagementPanel, EngagementPanelSectionList), + engagement_panel_popup_type: data.moreEndpoint.showEngagementPanelEndpoint.engagementPanelPresentationConfigs.engagementPanelPopupPresentationConfig.popupType, + identifier: { + surface: data.moreEndpoint.showEngagementPanelEndpoint.identifier.surface, + tag: data.moreEndpoint.showEngagementPanelEndpoint.identifier.tag + } + } + } : new NavigationEndpoint(data.moreEndpoint); + this.more_icon_type = data.moreIcon.iconType; + this.more_label = data.moreLabel; + this.target_id = data.targetId; + } +} \ No newline at end of file diff --git a/deno/src/parser/classes/ChipCloud.ts b/deno/src/parser/classes/ChipCloud.ts index f6ea1ba4..e025d6ca 100644 --- a/deno/src/parser/classes/ChipCloud.ts +++ b/deno/src/parser/classes/ChipCloud.ts @@ -1,5 +1,5 @@ import { YTNode, type ObservedArray } from '../helpers.ts'; -import Parser, { type RawNode } from '../index.ts'; +import { Parser, type RawNode } from '../index.ts'; import Button from './Button.ts'; import ChipCloudChip from './ChipCloudChip.ts'; diff --git a/deno/src/parser/classes/ClipAdState.ts b/deno/src/parser/classes/ClipAdState.ts new file mode 100644 index 00000000..fbe2b5e5 --- /dev/null +++ b/deno/src/parser/classes/ClipAdState.ts @@ -0,0 +1,17 @@ +import { YTNode } from '../helpers.ts'; +import Text from './misc/Text.ts'; + +import type { RawNode } from '../types/index.ts'; + +export default class ClipAdState extends YTNode { + static type = 'ClipAdState'; + + title: Text; + body: Text; + + constructor(data: RawNode) { + super(); + this.title = new Text(data.title); + this.body = new Text(data.body); + } +} \ No newline at end of file diff --git a/deno/src/parser/classes/ClipCreation.ts b/deno/src/parser/classes/ClipCreation.ts new file mode 100644 index 00000000..33e6d8b5 --- /dev/null +++ b/deno/src/parser/classes/ClipCreation.ts @@ -0,0 +1,40 @@ +import { YTNode } from '../helpers.ts'; +import Thumbnail from './misc/Thumbnail.ts'; +import Button from './Button.ts'; +import ClipCreationTextInput from './ClipCreationTextInput.ts'; +import ClipCreationScrubber from './ClipCreationScrubber.ts'; +import ClipAdState from './ClipAdState.ts'; +import Text from './misc/Text.ts'; + +import { Parser } from '../index.ts'; + +import type { RawNode } from '../types/index.ts'; + +export default class ClipCreation extends YTNode { + static type = 'ClipCreation'; + + user_avatar: Thumbnail[]; + title_input: ClipCreationTextInput | null; + scrubber: ClipCreationScrubber | null; + save_button: Button | null; + display_name: Text; + publicity_label: string; + cancel_button: Button | null; + ad_state_overlay: ClipAdState | null; + external_video_id: string; + publicity_label_icon: string; + + constructor(data: RawNode) { + super(); + this.user_avatar = Thumbnail.fromResponse(data.userAvatar); + this.title_input = Parser.parseItem(data.titleInput, [ ClipCreationTextInput ]); + this.scrubber = Parser.parseItem(data.scrubber, [ ClipCreationScrubber ]); + this.save_button = Parser.parseItem(data.saveButton, [ Button ]); + this.display_name = new Text(data.displayName); + this.publicity_label = data.publicityLabel; + this.cancel_button = Parser.parseItem(data.cancelButton, [ Button ]); + this.ad_state_overlay = Parser.parseItem(data.adStateOverlay, [ ClipAdState ]); + this.external_video_id = data.externalVideoId; + this.publicity_label_icon = data.publicityLabelIcon; + } +} \ No newline at end of file diff --git a/deno/src/parser/classes/ClipCreationScrubber.ts b/deno/src/parser/classes/ClipCreationScrubber.ts new file mode 100644 index 00000000..26380ea6 --- /dev/null +++ b/deno/src/parser/classes/ClipCreationScrubber.ts @@ -0,0 +1,28 @@ +import { YTNode } from '../helpers.ts'; + +import type { RawNode } from '../types/index.ts'; + +export default class ClipCreationScrubber extends YTNode { + static type = 'ClipCreationScrubber'; + + length_template: string; + max_length_ms: number; + min_length_ms: number; + default_length_ms: number; + window_size_ms: number; + start_label?: string; + end_label?: string; + duration_label?: string; + + constructor(data: RawNode) { + super(); + this.length_template = data.lengthTemplate; + this.max_length_ms = data.maxLengthMs; + this.min_length_ms = data.minLengthMs; + this.default_length_ms = data.defaultLengthMs; + this.window_size_ms = data.windowSizeMs; + this.start_label = data.startAccessibility?.accessibilityData?.label; + this.end_label = data.endAccessibility?.accessibilityData?.label; + this.duration_label = data.durationAccessibility?.accessibilityData?.label; + } +} \ No newline at end of file diff --git a/deno/src/parser/classes/ClipCreationTextInput.ts b/deno/src/parser/classes/ClipCreationTextInput.ts new file mode 100644 index 00000000..c06d0424 --- /dev/null +++ b/deno/src/parser/classes/ClipCreationTextInput.ts @@ -0,0 +1,17 @@ +import { YTNode } from '../helpers.ts'; +import Text from './misc/Text.ts'; + +import type { RawNode } from '../types/index.ts'; + +export default class ClipCreationTextInput extends YTNode { + static type = 'ClipCreationTextInput'; + + placeholder_text: Text; + max_character_limit: number; + + constructor(data: RawNode) { + super(); + this.placeholder_text = new Text(data.placeholderText); + this.max_character_limit = data.maxCharacterLimit; + } +} \ No newline at end of file diff --git a/deno/src/parser/classes/ClipSection.ts b/deno/src/parser/classes/ClipSection.ts new file mode 100644 index 00000000..aaa03df6 --- /dev/null +++ b/deno/src/parser/classes/ClipSection.ts @@ -0,0 +1,19 @@ +import type { ObservedArray } from '../helpers.ts'; +import { YTNode } from '../helpers.ts'; + +import ClipCreation from './ClipCreation.ts'; + +import { Parser } from '../index.ts'; + +import type { RawNode } from '../types/index.ts'; + +export default class ClipSection extends YTNode { + static type = 'ClipSection'; + + contents: ObservedArray | null; + + constructor(data: RawNode) { + super(); + this.contents = Parser.parse(data.contents, true, [ ClipCreation ]); + } +} diff --git a/deno/src/parser/classes/Command.ts b/deno/src/parser/classes/Command.ts new file mode 100644 index 00000000..bcc4fedd --- /dev/null +++ b/deno/src/parser/classes/Command.ts @@ -0,0 +1,14 @@ +import { YTNode } from '../helpers.ts'; +import type { RawNode } from '../index.ts'; +import NavigationEndpoint from './NavigationEndpoint.ts'; + +export default class Command extends YTNode { + static type = 'Command'; + + endpoint: NavigationEndpoint; + + constructor(data: RawNode) { + super(); + this.endpoint = new NavigationEndpoint(data); + } +} \ No newline at end of file diff --git a/deno/src/parser/classes/CompactChannel.ts b/deno/src/parser/classes/CompactChannel.ts index d3704d18..ddc5f12a 100644 --- a/deno/src/parser/classes/CompactChannel.ts +++ b/deno/src/parser/classes/CompactChannel.ts @@ -1,5 +1,5 @@ import { YTNode } from '../helpers.ts'; -import Parser, { type RawNode } from '../index.ts'; +import { Parser, type RawNode } from '../index.ts'; import NavigationEndpoint from './NavigationEndpoint.ts'; import Menu from './menus/Menu.ts'; import Text from './misc/Text.ts'; diff --git a/deno/src/parser/classes/CompactMovie.ts b/deno/src/parser/classes/CompactMovie.ts index 684b5f28..d3fe6481 100644 --- a/deno/src/parser/classes/CompactMovie.ts +++ b/deno/src/parser/classes/CompactMovie.ts @@ -1,6 +1,6 @@ import { YTNode, type ObservedArray } from '../helpers.ts'; import type { RawNode } from '../index.ts'; -import Parser from '../index.ts'; +import { Parser } from '../index.ts'; import Author from './misc/Author.ts'; import NavigationEndpoint from './NavigationEndpoint.ts'; import Text from './misc/Text.ts'; diff --git a/deno/src/parser/classes/CompactVideo.ts b/deno/src/parser/classes/CompactVideo.ts index 0100c829..aefbbdf2 100644 --- a/deno/src/parser/classes/CompactVideo.ts +++ b/deno/src/parser/classes/CompactVideo.ts @@ -1,6 +1,6 @@ import { timeToSeconds } from '../../utils/Utils.ts'; import { YTNode, type ObservedArray, type SuperParsedResult } from '../helpers.ts'; -import Parser, { type RawNode } from '../index.ts'; +import { Parser, type RawNode } from '../index.ts'; import Menu from './menus/Menu.ts'; import MetadataBadge from './MetadataBadge.ts'; import Author from './misc/Author.ts'; diff --git a/deno/src/parser/classes/ConfirmDialog.ts b/deno/src/parser/classes/ConfirmDialog.ts index d95f40b3..4d5472bd 100644 --- a/deno/src/parser/classes/ConfirmDialog.ts +++ b/deno/src/parser/classes/ConfirmDialog.ts @@ -1,4 +1,4 @@ -import Parser, { type RawNode } from '../index.ts'; +import { Parser, type RawNode } from '../index.ts'; import Text from './misc/Text.ts'; import Button from './Button.ts'; import { YTNode } from '../helpers.ts'; diff --git a/deno/src/parser/classes/ContentMetadataView.ts b/deno/src/parser/classes/ContentMetadataView.ts new file mode 100644 index 00000000..fea4afdc --- /dev/null +++ b/deno/src/parser/classes/ContentMetadataView.ts @@ -0,0 +1,26 @@ +import { YTNode } from '../helpers.ts'; +import type { RawNode } from '../index.ts'; +import { Text } from '../misc.ts'; + +export type MetadataRow = { + metadata_parts: { + text: Text; + }[]; +}; + +export default class ContentMetadataView extends YTNode { + static type = 'ContentMetadataView'; + + metadata_rows: MetadataRow[]; + delimiter: string; + + constructor(data: RawNode) { + super(); + this.metadata_rows = data.metadataRows.map((row: RawNode) => ({ + metadata_parts: row.metadataParts.map((part: RawNode) => ({ + text: Text.fromAttributed(part.text) + })) + })); + this.delimiter = data.delimiter; + } +} \ No newline at end of file diff --git a/deno/src/parser/classes/ContinuationItem.ts b/deno/src/parser/classes/ContinuationItem.ts index 8ed7906b..9880402f 100644 --- a/deno/src/parser/classes/ContinuationItem.ts +++ b/deno/src/parser/classes/ContinuationItem.ts @@ -1,5 +1,5 @@ import { YTNode } from '../helpers.ts'; -import Parser, { type RawNode } from '../index.ts'; +import { Parser, type RawNode } from '../index.ts'; import Button from './Button.ts'; import NavigationEndpoint from './NavigationEndpoint.ts'; diff --git a/deno/src/parser/classes/ConversationBar.ts b/deno/src/parser/classes/ConversationBar.ts index 418b230a..3531eb84 100644 --- a/deno/src/parser/classes/ConversationBar.ts +++ b/deno/src/parser/classes/ConversationBar.ts @@ -1,5 +1,5 @@ import { YTNode } from '../helpers.ts'; -import Parser, { type RawNode } from '../index.ts'; +import { Parser, type RawNode } from '../index.ts'; import Message from './Message.ts'; export default class ConversationBar extends YTNode { diff --git a/deno/src/parser/classes/CopyLink.ts b/deno/src/parser/classes/CopyLink.ts index fb9f43d7..f7c72c83 100644 --- a/deno/src/parser/classes/CopyLink.ts +++ b/deno/src/parser/classes/CopyLink.ts @@ -1,5 +1,5 @@ import { YTNode } from '../helpers.ts'; -import Parser, { type RawNode } from '../index.ts'; +import { Parser, type RawNode } from '../index.ts'; import Button from './Button.ts'; export default class CopyLink extends YTNode { diff --git a/deno/src/parser/classes/CreatePlaylistDialog.ts b/deno/src/parser/classes/CreatePlaylistDialog.ts index 6a3ab98a..bda438c9 100644 --- a/deno/src/parser/classes/CreatePlaylistDialog.ts +++ b/deno/src/parser/classes/CreatePlaylistDialog.ts @@ -1,5 +1,5 @@ import { YTNode } from '../helpers.ts'; -import Parser, { type RawNode } from '../index.ts'; +import { Parser, type RawNode } from '../index.ts'; import Button from './Button.ts'; import Dropdown from './Dropdown.ts'; import Text from './misc/Text.ts'; diff --git a/deno/src/parser/classes/DecoratedPlayerBar.ts b/deno/src/parser/classes/DecoratedPlayerBar.ts index f0ffb85b..20feb65d 100644 --- a/deno/src/parser/classes/DecoratedPlayerBar.ts +++ b/deno/src/parser/classes/DecoratedPlayerBar.ts @@ -1,6 +1,6 @@ import { YTNode } from '../helpers.ts'; import type { RawNode } from '../index.ts'; -import Parser from '../index.ts'; +import { Parser } from '../index.ts'; import Button from './Button.ts'; import MultiMarkersPlayerBar from './MultiMarkersPlayerBar.ts'; diff --git a/deno/src/parser/classes/DefaultPromoPanel.ts b/deno/src/parser/classes/DefaultPromoPanel.ts index 7d52c510..66307d20 100644 --- a/deno/src/parser/classes/DefaultPromoPanel.ts +++ b/deno/src/parser/classes/DefaultPromoPanel.ts @@ -1,5 +1,5 @@ import { YTNode } from '../helpers.ts'; -import Parser, { type RawNode } from '../index.ts'; +import { Parser, type RawNode } from '../index.ts'; import NavigationEndpoint from './NavigationEndpoint.ts'; import Text from './misc/Text.ts'; diff --git a/deno/src/parser/classes/Dropdown.ts b/deno/src/parser/classes/Dropdown.ts index 49be6a31..709f9e78 100644 --- a/deno/src/parser/classes/Dropdown.ts +++ b/deno/src/parser/classes/Dropdown.ts @@ -1,5 +1,5 @@ import { YTNode, type ObservedArray } from '../helpers.ts'; -import Parser, { type RawNode } from '../index.ts'; +import { Parser, type RawNode } from '../index.ts'; import DropdownItem from './DropdownItem.ts'; export default class Dropdown extends YTNode { diff --git a/deno/src/parser/classes/Element.ts b/deno/src/parser/classes/Element.ts index 4020a667..51903f9a 100644 --- a/deno/src/parser/classes/Element.ts +++ b/deno/src/parser/classes/Element.ts @@ -1,4 +1,4 @@ -import Parser, { type RawNode } from '../index.ts'; +import { Parser, type RawNode } from '../index.ts'; import ChildElement from './misc/ChildElement.ts'; import { type ObservedArray, YTNode, observe } from '../helpers.ts'; diff --git a/deno/src/parser/classes/EmergencyOnebox.ts b/deno/src/parser/classes/EmergencyOnebox.ts index cb79039a..222459b9 100644 --- a/deno/src/parser/classes/EmergencyOnebox.ts +++ b/deno/src/parser/classes/EmergencyOnebox.ts @@ -1,5 +1,5 @@ import { YTNode } from '../helpers.ts'; -import Parser, { type RawNode } from '../index.ts'; +import { Parser, type RawNode } from '../index.ts'; import Menu from './menus/Menu.ts'; import Text from './misc/Text.ts'; diff --git a/deno/src/parser/classes/EndScreenVideo.ts b/deno/src/parser/classes/EndScreenVideo.ts index 1cfd7fc4..a6933126 100644 --- a/deno/src/parser/classes/EndScreenVideo.ts +++ b/deno/src/parser/classes/EndScreenVideo.ts @@ -1,5 +1,5 @@ import { type ObservedArray, YTNode } from '../helpers.ts'; -import Parser, { type RawNode } from '../index.ts'; +import { Parser, type RawNode } from '../index.ts'; import Author from './misc/Author.ts'; import Text from './misc/Text.ts'; import Thumbnail from './misc/Thumbnail.ts'; diff --git a/deno/src/parser/classes/Endscreen.ts b/deno/src/parser/classes/Endscreen.ts index 2828c284..01ef7cd8 100644 --- a/deno/src/parser/classes/Endscreen.ts +++ b/deno/src/parser/classes/Endscreen.ts @@ -1,4 +1,4 @@ -import Parser from '../index.ts'; +import { Parser } from '../index.ts'; import { type ObservedArray, YTNode } from '../helpers.ts'; export default class Endscreen extends YTNode { diff --git a/deno/src/parser/classes/EndscreenElement.ts b/deno/src/parser/classes/EndscreenElement.ts index 573fa359..1053ef9c 100644 --- a/deno/src/parser/classes/EndscreenElement.ts +++ b/deno/src/parser/classes/EndscreenElement.ts @@ -1,4 +1,4 @@ -import Parser, { type RawNode } from '../index.ts'; +import { Parser, type RawNode } from '../index.ts'; import Thumbnail from './misc/Thumbnail.ts'; import NavigationEndpoint from './NavigationEndpoint.ts'; import Text from './misc/Text.ts'; diff --git a/deno/src/parser/classes/EngagementPanelSectionList.ts b/deno/src/parser/classes/EngagementPanelSectionList.ts index 83f24332..2660379b 100644 --- a/deno/src/parser/classes/EngagementPanelSectionList.ts +++ b/deno/src/parser/classes/EngagementPanelSectionList.ts @@ -1,26 +1,36 @@ import { YTNode } from '../helpers.ts'; -import Parser, { type RawNode } from '../index.ts'; +import { Parser, type RawNode } from '../index.ts'; +import ClipSection from './ClipSection.ts'; import ContinuationItem from './ContinuationItem.ts'; import EngagementPanelTitleHeader from './EngagementPanelTitleHeader.ts'; import MacroMarkersList from './MacroMarkersList.ts'; import ProductList from './ProductList.ts'; import SectionList from './SectionList.ts'; import StructuredDescriptionContent from './StructuredDescriptionContent.ts'; +import VideoAttributeView from './VideoAttributeView.ts'; export default class EngagementPanelSectionList extends YTNode { static type = 'EngagementPanelSectionList'; header: EngagementPanelTitleHeader | null; - content: SectionList | ContinuationItem | StructuredDescriptionContent | MacroMarkersList | ProductList | null; + content: VideoAttributeView | SectionList | ContinuationItem | ClipSection | StructuredDescriptionContent | MacroMarkersList | ProductList | null; target_id?: string; panel_identifier?: string; + identifier?: { + surface: string, + tag: string + }; visibility?: string; constructor(data: RawNode) { super(); this.header = Parser.parseItem(data.header, EngagementPanelTitleHeader); - this.content = Parser.parseItem(data.content, [ SectionList, ContinuationItem, StructuredDescriptionContent, MacroMarkersList, ProductList ]); + this.content = Parser.parseItem(data.content, [ VideoAttributeView, SectionList, ContinuationItem, ClipSection, StructuredDescriptionContent, MacroMarkersList, ProductList ]); this.panel_identifier = data.panelIdentifier; + this.identifier = data.identifier ? { + surface: data.identifier.surface, + tag: data.identifier.tag + } : undefined; this.target_id = data.targetId; this.visibility = data.visibility; } diff --git a/deno/src/parser/classes/ExpandableMetadata.ts b/deno/src/parser/classes/ExpandableMetadata.ts index bd529e83..f1febc23 100644 --- a/deno/src/parser/classes/ExpandableMetadata.ts +++ b/deno/src/parser/classes/ExpandableMetadata.ts @@ -1,5 +1,5 @@ import { YTNode } from '../helpers.ts'; -import Parser, { type RawNode } from '../index.ts'; +import { Parser, type RawNode } from '../index.ts'; import Button from './Button.ts'; import HorizontalCardList from './HorizontalCardList.ts'; import HorizontalList from './HorizontalList.ts'; diff --git a/deno/src/parser/classes/ExpandableTab.ts b/deno/src/parser/classes/ExpandableTab.ts index aa727949..d57bbe4f 100644 --- a/deno/src/parser/classes/ExpandableTab.ts +++ b/deno/src/parser/classes/ExpandableTab.ts @@ -1,5 +1,5 @@ import { YTNode } from '../helpers.ts'; -import Parser, { type RawNode } from '../index.ts'; +import { Parser, type RawNode } from '../index.ts'; import NavigationEndpoint from './NavigationEndpoint.ts'; export default class ExpandableTab extends YTNode { diff --git a/deno/src/parser/classes/ExpandedShelfContents.ts b/deno/src/parser/classes/ExpandedShelfContents.ts index 933964b4..4e097a63 100644 --- a/deno/src/parser/classes/ExpandedShelfContents.ts +++ b/deno/src/parser/classes/ExpandedShelfContents.ts @@ -1,4 +1,4 @@ -import Parser, { type RawNode } from '../index.ts'; +import { Parser, type RawNode } from '../index.ts'; import { type ObservedArray, YTNode } from '../helpers.ts'; export default class ExpandedShelfContents extends YTNode { diff --git a/deno/src/parser/classes/FeedFilterChipBar.ts b/deno/src/parser/classes/FeedFilterChipBar.ts index f7cefb2f..93fcf4fd 100644 --- a/deno/src/parser/classes/FeedFilterChipBar.ts +++ b/deno/src/parser/classes/FeedFilterChipBar.ts @@ -1,5 +1,5 @@ import { YTNode, type ObservedArray } from '../helpers.ts'; -import Parser, { type RawNode } from '../index.ts'; +import { Parser, type RawNode } from '../index.ts'; import ChipCloudChip from './ChipCloudChip.ts'; export default class FeedFilterChipBar extends YTNode { diff --git a/deno/src/parser/classes/FeedNudge.ts b/deno/src/parser/classes/FeedNudge.ts new file mode 100644 index 00000000..0243f54b --- /dev/null +++ b/deno/src/parser/classes/FeedNudge.ts @@ -0,0 +1,25 @@ +import { YTNode } from '../helpers.ts'; +import { NavigationEndpoint } from '../nodes.ts'; + +import type { RawNode } from '../types/index.ts'; + +export default class FeedNudge extends YTNode { + static type = 'FeedNudge'; + + title: Text; + subtitle: Text; + endpoint: NavigationEndpoint; + apply_modernized_style: boolean; + trim_style: string; + background_style: string; + + constructor(data: RawNode) { + super(); + this.title = new Text(data.title); + this.subtitle = new Text(data.subtitle); + this.endpoint = new NavigationEndpoint(data.impressionEndpoint); + this.apply_modernized_style = data.applyModernizedStyle; + this.trim_style = data.trimStyle; + this.background_style = data.backgroundStyle; + } +} \ No newline at end of file diff --git a/deno/src/parser/classes/FlexibleActionsView.ts b/deno/src/parser/classes/FlexibleActionsView.ts new file mode 100644 index 00000000..a28d3f10 --- /dev/null +++ b/deno/src/parser/classes/FlexibleActionsView.ts @@ -0,0 +1,22 @@ +import { type ObservedArray, YTNode } from '../helpers.ts'; +import { Parser, type RawNode } from '../index.ts'; +import ButtonView from './ButtonView.ts'; + +export type ActionRow = { + actions: ObservedArray; +}; + +export default class FlexibleActionsView extends YTNode { + static type = 'FlexibleActionsView'; + + actions_rows: ActionRow[]; + style: string; + + constructor(data: RawNode) { + super(); + this.actions_rows = data.actionsRows.map((row: RawNode) => ({ + actions: Parser.parseArray(row.actions, ButtonView) + })); + this.style = data.style; + } +} \ No newline at end of file diff --git a/deno/src/parser/classes/GameCard.ts b/deno/src/parser/classes/GameCard.ts index 64806124..0d44ed25 100644 --- a/deno/src/parser/classes/GameCard.ts +++ b/deno/src/parser/classes/GameCard.ts @@ -1,5 +1,5 @@ import { YTNode } from '../helpers.ts'; -import Parser, { type RawNode } from '../index.ts'; +import { Parser, type RawNode } from '../index.ts'; export default class GameCard extends YTNode { static type = 'GameCard'; diff --git a/deno/src/parser/classes/Grid.ts b/deno/src/parser/classes/Grid.ts index 93457316..9905757c 100644 --- a/deno/src/parser/classes/Grid.ts +++ b/deno/src/parser/classes/Grid.ts @@ -1,5 +1,5 @@ import { YTNode, type ObservedArray } from '../helpers.ts'; -import Parser, { type RawNode } from '../index.ts'; +import { Parser, type RawNode } from '../index.ts'; export default class Grid extends YTNode { static type = 'Grid'; diff --git a/deno/src/parser/classes/GridChannel.ts b/deno/src/parser/classes/GridChannel.ts index de71999e..ef2cdd7b 100644 --- a/deno/src/parser/classes/GridChannel.ts +++ b/deno/src/parser/classes/GridChannel.ts @@ -1,5 +1,5 @@ import { YTNode } from '../helpers.ts'; -import Parser, { type RawNode } from '../index.ts'; +import { Parser, type RawNode } from '../index.ts'; import Author from './misc/Author.ts'; import Text from './misc/Text.ts'; import NavigationEndpoint from './NavigationEndpoint.ts'; diff --git a/deno/src/parser/classes/GridMix.ts b/deno/src/parser/classes/GridMix.ts index 5b181971..e9a4020a 100644 --- a/deno/src/parser/classes/GridMix.ts +++ b/deno/src/parser/classes/GridMix.ts @@ -1,5 +1,5 @@ import { YTNode, type ObservedArray } from '../helpers.ts'; -import Parser, { type RawNode } from '../index.ts'; +import { Parser, type RawNode } from '../index.ts'; import NavigationEndpoint from './NavigationEndpoint.ts'; import Text from './misc/Text.ts'; import Thumbnail from './misc/Thumbnail.ts'; diff --git a/deno/src/parser/classes/GridMovie.ts b/deno/src/parser/classes/GridMovie.ts index 936c4c1b..68e3439d 100644 --- a/deno/src/parser/classes/GridMovie.ts +++ b/deno/src/parser/classes/GridMovie.ts @@ -1,5 +1,5 @@ import { YTNode, type ObservedArray } from '../helpers.ts'; -import Parser, { type RawNode } from '../index.ts'; +import { Parser, type RawNode } from '../index.ts'; import MetadataBadge from './MetadataBadge.ts'; import NavigationEndpoint from './NavigationEndpoint.ts'; import Text from './misc/Text.ts'; diff --git a/deno/src/parser/classes/GridPlaylist.ts b/deno/src/parser/classes/GridPlaylist.ts index 7155f148..12a1d5c5 100644 --- a/deno/src/parser/classes/GridPlaylist.ts +++ b/deno/src/parser/classes/GridPlaylist.ts @@ -1,5 +1,5 @@ import { YTNode, type ObservedArray } from '../helpers.ts'; -import Parser, { type RawNode } from '../index.ts'; +import { Parser, type RawNode } from '../index.ts'; import Author from './misc/Author.ts'; import Text from './misc/Text.ts'; import Thumbnail from './misc/Thumbnail.ts'; diff --git a/deno/src/parser/classes/GridVideo.ts b/deno/src/parser/classes/GridVideo.ts index fbcf8c3e..a0d75714 100644 --- a/deno/src/parser/classes/GridVideo.ts +++ b/deno/src/parser/classes/GridVideo.ts @@ -1,5 +1,5 @@ import { YTNode, type ObservedArray } from '../helpers.ts'; -import Parser, { type RawNode } from '../index.ts'; +import { Parser, type RawNode } from '../index.ts'; import NavigationEndpoint from './NavigationEndpoint.ts'; import Menu from './menus/Menu.ts'; import Author from './misc/Author.ts'; diff --git a/deno/src/parser/classes/Heatmap.ts b/deno/src/parser/classes/Heatmap.ts index 36d2192a..ab59ed9d 100644 --- a/deno/src/parser/classes/Heatmap.ts +++ b/deno/src/parser/classes/Heatmap.ts @@ -1,4 +1,4 @@ -import Parser, { type RawNode } from '../index.ts'; +import { Parser, type RawNode } from '../index.ts'; import HeatMarker from './HeatMarker.ts'; import { type ObservedArray, YTNode } from '../helpers.ts'; diff --git a/deno/src/parser/classes/HorizontalCardList.ts b/deno/src/parser/classes/HorizontalCardList.ts index 8091dfa2..ac2bcd92 100644 --- a/deno/src/parser/classes/HorizontalCardList.ts +++ b/deno/src/parser/classes/HorizontalCardList.ts @@ -1,22 +1,23 @@ -import Parser, { type RawNode } from '../index.ts'; +import { Parser, type RawNode } from '../index.ts'; import { type ObservedArray, YTNode } from '../helpers.ts'; import SearchRefinementCard from './SearchRefinementCard.ts'; import Button from './Button.ts'; import MacroMarkersListItem from './MacroMarkersListItem.ts'; import GameCard from './GameCard.ts'; import VideoCard from './VideoCard.ts'; +import VideoAttributeView from './VideoAttributeView.ts'; export default class HorizontalCardList extends YTNode { static type = 'HorizontalCardList'; - cards: ObservedArray; + cards: ObservedArray; header: YTNode; previous_button: Button | null; next_button: Button | null; constructor(data: RawNode) { super(); - this.cards = Parser.parseArray(data.cards, [ SearchRefinementCard, MacroMarkersListItem, GameCard, VideoCard ]); + this.cards = Parser.parseArray(data.cards, [ VideoAttributeView, SearchRefinementCard, MacroMarkersListItem, GameCard, VideoCard ]); this.header = Parser.parseItem(data.header); this.previous_button = Parser.parseItem(data.previousButton, Button); this.next_button = Parser.parseItem(data.nextButton, Button); diff --git a/deno/src/parser/classes/HorizontalList.ts b/deno/src/parser/classes/HorizontalList.ts index fa0e7c10..6a20b695 100644 --- a/deno/src/parser/classes/HorizontalList.ts +++ b/deno/src/parser/classes/HorizontalList.ts @@ -1,4 +1,4 @@ -import Parser, { type RawNode } from '../index.ts'; +import { Parser, type RawNode } from '../index.ts'; import { type ObservedArray, YTNode } from '../helpers.ts'; export default class HorizontalList extends YTNode { diff --git a/deno/src/parser/classes/HorizontalMovieList.ts b/deno/src/parser/classes/HorizontalMovieList.ts index a4c5b488..a473d511 100644 --- a/deno/src/parser/classes/HorizontalMovieList.ts +++ b/deno/src/parser/classes/HorizontalMovieList.ts @@ -1,4 +1,4 @@ -import Parser, { type RawNode } from '../index.ts'; +import { Parser, type RawNode } from '../index.ts'; import { type ObservedArray, YTNode } from '../helpers.ts'; import Button from './Button.ts'; diff --git a/deno/src/parser/classes/InfoPanelContainer.ts b/deno/src/parser/classes/InfoPanelContainer.ts index 359e88e8..4c9f3948 100644 --- a/deno/src/parser/classes/InfoPanelContainer.ts +++ b/deno/src/parser/classes/InfoPanelContainer.ts @@ -1,5 +1,5 @@ import { YTNode } from '../helpers.ts'; -import Parser, { type RawNode } from '../index.ts'; +import { Parser, type RawNode } from '../index.ts'; import InfoPanelContent from './InfoPanelContent.ts'; import Menu from './menus/Menu.ts'; import Text from './misc/Text.ts'; diff --git a/deno/src/parser/classes/InteractiveTabbedHeader.ts b/deno/src/parser/classes/InteractiveTabbedHeader.ts index 11a0b47b..2b8ee07c 100644 --- a/deno/src/parser/classes/InteractiveTabbedHeader.ts +++ b/deno/src/parser/classes/InteractiveTabbedHeader.ts @@ -5,7 +5,7 @@ import Text from './misc/Text.ts'; import Thumbnail from './misc/Thumbnail.ts'; import { YTNode, type ObservedArray } from '../helpers.ts'; -import Parser, { type RawNode } from '../index.ts'; +import { Parser, type RawNode } from '../index.ts'; export default class InteractiveTabbedHeader extends YTNode { static type = 'InteractiveTabbedHeader'; diff --git a/deno/src/parser/classes/ItemSection.ts b/deno/src/parser/classes/ItemSection.ts index 791872f9..f92b2cb0 100644 --- a/deno/src/parser/classes/ItemSection.ts +++ b/deno/src/parser/classes/ItemSection.ts @@ -1,5 +1,5 @@ import { YTNode, type ObservedArray } from '../helpers.ts'; -import Parser, { type RawNode } from '../index.ts'; +import { Parser, type RawNode } from '../index.ts'; import ItemSectionHeader from './ItemSectionHeader.ts'; import ItemSectionTabbedHeader from './ItemSectionTabbedHeader.ts'; import CommentsHeader from './comments/CommentsHeader.ts'; diff --git a/deno/src/parser/classes/ItemSectionTabbedHeader.ts b/deno/src/parser/classes/ItemSectionTabbedHeader.ts index 5386452a..6e8f1576 100644 --- a/deno/src/parser/classes/ItemSectionTabbedHeader.ts +++ b/deno/src/parser/classes/ItemSectionTabbedHeader.ts @@ -1,5 +1,5 @@ import { YTNode, type ObservedArray } from '../helpers.ts'; -import Parser, { type RawNode } from '../index.ts'; +import { Parser, type RawNode } from '../index.ts'; import ItemSectionTab from './ItemSectionTab.ts'; import Text from './misc/Text.ts'; diff --git a/deno/src/parser/classes/LiveChat.ts b/deno/src/parser/classes/LiveChat.ts index 35b4a300..14350c5f 100644 --- a/deno/src/parser/classes/LiveChat.ts +++ b/deno/src/parser/classes/LiveChat.ts @@ -1,5 +1,5 @@ import { YTNode } from '../helpers.ts'; -import Parser, { type RawNode } from '../index.ts'; +import { Parser, type RawNode } from '../index.ts'; import Text from './misc/Text.ts'; export default class LiveChat extends YTNode { diff --git a/deno/src/parser/classes/LiveChatDialog.ts b/deno/src/parser/classes/LiveChatDialog.ts index 55b881c7..4c97c79e 100644 --- a/deno/src/parser/classes/LiveChatDialog.ts +++ b/deno/src/parser/classes/LiveChatDialog.ts @@ -1,5 +1,5 @@ import { YTNode } from '../helpers.ts'; -import Parser, { type RawNode } from '../index.ts'; +import { Parser, type RawNode } from '../index.ts'; import Button from './Button.ts'; import Text from './misc/Text.ts'; diff --git a/deno/src/parser/classes/LiveChatHeader.ts b/deno/src/parser/classes/LiveChatHeader.ts index 4f78f469..5af4c0d0 100644 --- a/deno/src/parser/classes/LiveChatHeader.ts +++ b/deno/src/parser/classes/LiveChatHeader.ts @@ -1,5 +1,5 @@ import { YTNode } from '../helpers.ts'; -import Parser, { type RawNode } from '../index.ts'; +import { Parser, type RawNode } from '../index.ts'; import Button from './Button.ts'; import SortFilterSubMenu from './SortFilterSubMenu.ts'; import Menu from './menus/Menu.ts'; diff --git a/deno/src/parser/classes/LiveChatItemList.ts b/deno/src/parser/classes/LiveChatItemList.ts index 65925cc4..a729781f 100644 --- a/deno/src/parser/classes/LiveChatItemList.ts +++ b/deno/src/parser/classes/LiveChatItemList.ts @@ -1,5 +1,5 @@ import { YTNode } from '../helpers.ts'; -import Parser, { type RawNode } from '../index.ts'; +import { Parser, type RawNode } from '../index.ts'; import Button from './Button.ts'; export default class LiveChatItemList extends YTNode { diff --git a/deno/src/parser/classes/LiveChatMessageInput.ts b/deno/src/parser/classes/LiveChatMessageInput.ts index baee5fbd..73120f71 100644 --- a/deno/src/parser/classes/LiveChatMessageInput.ts +++ b/deno/src/parser/classes/LiveChatMessageInput.ts @@ -1,5 +1,5 @@ import { YTNode } from '../helpers.ts'; -import Parser, { type RawNode } from '../index.ts'; +import { Parser, type RawNode } from '../index.ts'; import Button from './Button.ts'; import Text from './misc/Text.ts'; import Thumbnail from './misc/Thumbnail.ts'; diff --git a/deno/src/parser/classes/LiveChatParticipant.ts b/deno/src/parser/classes/LiveChatParticipant.ts index efabdf34..913d0f3d 100644 --- a/deno/src/parser/classes/LiveChatParticipant.ts +++ b/deno/src/parser/classes/LiveChatParticipant.ts @@ -1,5 +1,5 @@ import { YTNode, type ObservedArray } from '../helpers.ts'; -import Parser, { type RawNode } from '../index.ts'; +import { Parser, type RawNode } from '../index.ts'; import Text from './misc/Text.ts'; import Thumbnail from './misc/Thumbnail.ts'; diff --git a/deno/src/parser/classes/LiveChatParticipantsList.ts b/deno/src/parser/classes/LiveChatParticipantsList.ts index 218cb326..13bb32ff 100644 --- a/deno/src/parser/classes/LiveChatParticipantsList.ts +++ b/deno/src/parser/classes/LiveChatParticipantsList.ts @@ -1,5 +1,5 @@ import { YTNode, type ObservedArray } from '../helpers.ts'; -import Parser, { type RawNode } from '../index.ts'; +import { Parser, type RawNode } from '../index.ts'; import LiveChatParticipant from './LiveChatParticipant.ts'; import Text from './misc/Text.ts'; diff --git a/deno/src/parser/classes/MerchandiseShelf.ts b/deno/src/parser/classes/MerchandiseShelf.ts index c6fda253..a3d1fd17 100644 --- a/deno/src/parser/classes/MerchandiseShelf.ts +++ b/deno/src/parser/classes/MerchandiseShelf.ts @@ -1,5 +1,5 @@ import { YTNode, type ObservedArray } from '../helpers.ts'; -import Parser, { type RawNode } from '../index.ts'; +import { Parser, type RawNode } from '../index.ts'; export default class MerchandiseShelf extends YTNode { static type = 'MerchandiseShelf'; diff --git a/deno/src/parser/classes/MetadataRowContainer.ts b/deno/src/parser/classes/MetadataRowContainer.ts index 993eee17..6e80eab9 100644 --- a/deno/src/parser/classes/MetadataRowContainer.ts +++ b/deno/src/parser/classes/MetadataRowContainer.ts @@ -1,4 +1,4 @@ -import Parser, { type RawNode } from '../index.ts'; +import { Parser, type RawNode } from '../index.ts'; import { type ObservedArray, YTNode } from '../helpers.ts'; export default class MetadataRowContainer extends YTNode { diff --git a/deno/src/parser/classes/MetadataScreen.ts b/deno/src/parser/classes/MetadataScreen.ts index 467a020b..6daab5d9 100644 --- a/deno/src/parser/classes/MetadataScreen.ts +++ b/deno/src/parser/classes/MetadataScreen.ts @@ -1,4 +1,4 @@ -import Parser, { type RawNode } from '../index.ts'; +import { Parser, type RawNode } from '../index.ts'; import { YTNode } from '../helpers.ts'; export default class MetadataScreen extends YTNode { diff --git a/deno/src/parser/classes/Movie.ts b/deno/src/parser/classes/Movie.ts index 24cf74d6..89d2f366 100644 --- a/deno/src/parser/classes/Movie.ts +++ b/deno/src/parser/classes/Movie.ts @@ -1,6 +1,6 @@ import { timeToSeconds } from '../../utils/Utils.ts'; import { YTNode, type ObservedArray } from '../helpers.ts'; -import Parser, { type RawNode } from '../index.ts'; +import { Parser, type RawNode } from '../index.ts'; import NavigationEndpoint from './NavigationEndpoint.ts'; import Menu from './menus/Menu.ts'; import Author from './misc/Author.ts'; diff --git a/deno/src/parser/classes/MultiMarkersPlayerBar.ts b/deno/src/parser/classes/MultiMarkersPlayerBar.ts index 62a85ac3..d8130754 100644 --- a/deno/src/parser/classes/MultiMarkersPlayerBar.ts +++ b/deno/src/parser/classes/MultiMarkersPlayerBar.ts @@ -1,6 +1,6 @@ import { YTNode, observe, type ObservedArray } from '../helpers.ts'; import type { RawNode } from '../index.ts'; -import Parser from '../index.ts'; +import { Parser } from '../index.ts'; import Chapter from './Chapter.ts'; import Heatmap from './Heatmap.ts'; diff --git a/deno/src/parser/classes/MusicCardShelf.ts b/deno/src/parser/classes/MusicCardShelf.ts index c0e4652a..c7b3e308 100644 --- a/deno/src/parser/classes/MusicCardShelf.ts +++ b/deno/src/parser/classes/MusicCardShelf.ts @@ -1,5 +1,5 @@ import { YTNode, type ObservedArray } from '../helpers.ts'; -import Parser, { type RawNode } from '../index.ts'; +import { Parser, type RawNode } from '../index.ts'; import Button from './Button.ts'; import Menu from './menus/Menu.ts'; import Text from './misc/Text.ts'; diff --git a/deno/src/parser/classes/MusicCarouselShelf.ts b/deno/src/parser/classes/MusicCarouselShelf.ts index b81b93f8..5ff4c0f8 100644 --- a/deno/src/parser/classes/MusicCarouselShelf.ts +++ b/deno/src/parser/classes/MusicCarouselShelf.ts @@ -1,5 +1,5 @@ import { YTNode, type ObservedArray } from '../helpers.ts'; -import Parser, { type RawNode } from '../index.ts'; +import { Parser, type RawNode } from '../index.ts'; import MusicCarouselShelfBasicHeader from './MusicCarouselShelfBasicHeader.ts'; import MusicMultiRowListItem from './MusicMultiRowListItem.ts'; diff --git a/deno/src/parser/classes/MusicCarouselShelfBasicHeader.ts b/deno/src/parser/classes/MusicCarouselShelfBasicHeader.ts index a4d206c9..84813e4b 100644 --- a/deno/src/parser/classes/MusicCarouselShelfBasicHeader.ts +++ b/deno/src/parser/classes/MusicCarouselShelfBasicHeader.ts @@ -1,5 +1,5 @@ import { type ObservedArray, YTNode } from '../helpers.ts'; -import Parser, { type RawNode } from '../index.ts'; +import { Parser, type RawNode } from '../index.ts'; import Button from './Button.ts'; import IconLink from './IconLink.ts'; import MusicThumbnail from './MusicThumbnail.ts'; diff --git a/deno/src/parser/classes/MusicDetailHeader.ts b/deno/src/parser/classes/MusicDetailHeader.ts index 563ee8bd..cffa16dd 100644 --- a/deno/src/parser/classes/MusicDetailHeader.ts +++ b/deno/src/parser/classes/MusicDetailHeader.ts @@ -1,5 +1,5 @@ import { YTNode, type ObservedArray } from '../helpers.ts'; -import Parser, { type RawNode } from '../index.ts'; +import { Parser, type RawNode } from '../index.ts'; import type NavigationEndpoint from './NavigationEndpoint.ts'; import Text from './misc/Text.ts'; import type TextRun from './misc/TextRun.ts'; diff --git a/deno/src/parser/classes/MusicEditablePlaylistDetailHeader.ts b/deno/src/parser/classes/MusicEditablePlaylistDetailHeader.ts index 2eccabf6..58fdb580 100644 --- a/deno/src/parser/classes/MusicEditablePlaylistDetailHeader.ts +++ b/deno/src/parser/classes/MusicEditablePlaylistDetailHeader.ts @@ -1,4 +1,4 @@ -import Parser, { type RawNode } from '../index.ts'; +import { Parser, type RawNode } from '../index.ts'; import { YTNode } from '../helpers.ts'; export default class MusicEditablePlaylistDetailHeader extends YTNode { diff --git a/deno/src/parser/classes/MusicElementHeader.ts b/deno/src/parser/classes/MusicElementHeader.ts index 4ee9819a..581b428c 100644 --- a/deno/src/parser/classes/MusicElementHeader.ts +++ b/deno/src/parser/classes/MusicElementHeader.ts @@ -1,4 +1,4 @@ -import Parser, { type RawNode } from '../index.ts'; +import { Parser, type RawNode } from '../index.ts'; import Element from './Element.ts'; import { YTNode } from '../helpers.ts'; diff --git a/deno/src/parser/classes/MusicHeader.ts b/deno/src/parser/classes/MusicHeader.ts index c1ecd3a7..0b6e0245 100644 --- a/deno/src/parser/classes/MusicHeader.ts +++ b/deno/src/parser/classes/MusicHeader.ts @@ -1,4 +1,4 @@ -import Parser, { type RawNode } from '../index.ts'; +import { Parser, type RawNode } from '../index.ts'; import { YTNode } from '../helpers.ts'; import Text from './misc/Text.ts'; diff --git a/deno/src/parser/classes/MusicImmersiveHeader.ts b/deno/src/parser/classes/MusicImmersiveHeader.ts index 2225cb70..e5020913 100644 --- a/deno/src/parser/classes/MusicImmersiveHeader.ts +++ b/deno/src/parser/classes/MusicImmersiveHeader.ts @@ -1,5 +1,5 @@ import { YTNode } from '../helpers.ts'; -import Parser, { type RawNode } from '../index.ts'; +import { Parser, type RawNode } from '../index.ts'; import MusicThumbnail from './MusicThumbnail.ts'; import Text from './misc/Text.ts'; diff --git a/deno/src/parser/classes/MusicItemThumbnailOverlay.ts b/deno/src/parser/classes/MusicItemThumbnailOverlay.ts index 52bdbe6e..1633c4f0 100644 --- a/deno/src/parser/classes/MusicItemThumbnailOverlay.ts +++ b/deno/src/parser/classes/MusicItemThumbnailOverlay.ts @@ -1,4 +1,4 @@ -import Parser, { type RawNode } from '../index.ts'; +import { Parser, type RawNode } from '../index.ts'; import MusicPlayButton from './MusicPlayButton.ts'; import { YTNode } from '../helpers.ts'; diff --git a/deno/src/parser/classes/MusicPlaylistShelf.ts b/deno/src/parser/classes/MusicPlaylistShelf.ts index d4285968..bb6ffd68 100644 --- a/deno/src/parser/classes/MusicPlaylistShelf.ts +++ b/deno/src/parser/classes/MusicPlaylistShelf.ts @@ -1,5 +1,5 @@ import { YTNode, type ObservedArray } from '../helpers.ts'; -import Parser, { type RawNode } from '../index.ts'; +import { Parser, type RawNode } from '../index.ts'; import MusicResponsiveListItem from './MusicResponsiveListItem.ts'; export default class MusicPlaylistShelf extends YTNode { diff --git a/deno/src/parser/classes/MusicQueue.ts b/deno/src/parser/classes/MusicQueue.ts index dc85021e..2a36bb9b 100644 --- a/deno/src/parser/classes/MusicQueue.ts +++ b/deno/src/parser/classes/MusicQueue.ts @@ -1,4 +1,4 @@ -import Parser, { type RawNode } from '../index.ts'; +import { Parser, type RawNode } from '../index.ts'; import PlaylistPanel from './PlaylistPanel.ts'; import { YTNode } from '../helpers.ts'; diff --git a/deno/src/parser/classes/MusicResponsiveListItem.ts b/deno/src/parser/classes/MusicResponsiveListItem.ts index 46ccfb8a..cdea65dd 100644 --- a/deno/src/parser/classes/MusicResponsiveListItem.ts +++ b/deno/src/parser/classes/MusicResponsiveListItem.ts @@ -5,7 +5,7 @@ import { isTextRun, timeToSeconds } from '../../utils/Utils.ts'; import type { ObservedArray } from '../helpers.ts'; import type { RawNode } from '../index.ts'; -import Parser from '../index.ts'; +import { Parser } from '../index.ts'; import MusicItemThumbnailOverlay from './MusicItemThumbnailOverlay.ts'; import MusicResponsiveListItemFixedColumn from './MusicResponsiveListItemFixedColumn.ts'; import MusicResponsiveListItemFlexColumn from './MusicResponsiveListItemFlexColumn.ts'; diff --git a/deno/src/parser/classes/MusicShelf.ts b/deno/src/parser/classes/MusicShelf.ts index dfb62e39..8a39a093 100644 --- a/deno/src/parser/classes/MusicShelf.ts +++ b/deno/src/parser/classes/MusicShelf.ts @@ -1,5 +1,5 @@ import { YTNode, type ObservedArray } from '../helpers.ts'; -import Parser, { type RawNode } from '../index.ts'; +import { Parser, type RawNode } from '../index.ts'; import Button from './Button.ts'; import MusicResponsiveListItem from './MusicResponsiveListItem.ts'; import NavigationEndpoint from './NavigationEndpoint.ts'; diff --git a/deno/src/parser/classes/MusicSideAlignedItem.ts b/deno/src/parser/classes/MusicSideAlignedItem.ts index aa189580..63684907 100644 --- a/deno/src/parser/classes/MusicSideAlignedItem.ts +++ b/deno/src/parser/classes/MusicSideAlignedItem.ts @@ -1,5 +1,5 @@ import { YTNode, type ObservedArray } from '../helpers.ts'; -import Parser, { type RawNode } from '../index.ts'; +import { Parser, type RawNode } from '../index.ts'; export default class MusicSideAlignedItem extends YTNode { static type = 'MusicSideAlignedItem'; diff --git a/deno/src/parser/classes/MusicSortFilterButton.ts b/deno/src/parser/classes/MusicSortFilterButton.ts index 63b7c6f8..74730ae5 100644 --- a/deno/src/parser/classes/MusicSortFilterButton.ts +++ b/deno/src/parser/classes/MusicSortFilterButton.ts @@ -1,5 +1,5 @@ import { YTNode } from '../helpers.ts'; -import Parser, { type RawNode } from '../index.ts'; +import { Parser, type RawNode } from '../index.ts'; import MusicMultiSelectMenu from './menus/MusicMultiSelectMenu.ts'; import Text from './misc/Text.ts'; diff --git a/deno/src/parser/classes/MusicTastebuilderShelf.ts b/deno/src/parser/classes/MusicTastebuilderShelf.ts index 90cd5e70..b974dd65 100644 --- a/deno/src/parser/classes/MusicTastebuilderShelf.ts +++ b/deno/src/parser/classes/MusicTastebuilderShelf.ts @@ -1,4 +1,4 @@ -import Parser from '../index.ts'; +import { Parser } from '../index.ts'; import Button from './Button.ts'; import Text from './misc/Text.ts'; import MusicTastebuilderShelfThumbnail from './MusicTastebuilderShelfThumbnail.ts'; diff --git a/deno/src/parser/classes/MusicTwoRowItem.ts b/deno/src/parser/classes/MusicTwoRowItem.ts index 3a370691..48801c71 100644 --- a/deno/src/parser/classes/MusicTwoRowItem.ts +++ b/deno/src/parser/classes/MusicTwoRowItem.ts @@ -1,7 +1,7 @@ // TODO: Refactor this. import { YTNode, type SuperParsedResult } from '../helpers.ts'; -import Parser, { type RawNode } from '../index.ts'; +import { Parser, type RawNode } from '../index.ts'; import MusicItemThumbnailOverlay from './MusicItemThumbnailOverlay.ts'; import NavigationEndpoint from './NavigationEndpoint.ts'; import Menu from './menus/Menu.ts'; diff --git a/deno/src/parser/classes/MusicVisualHeader.ts b/deno/src/parser/classes/MusicVisualHeader.ts index 88cb52bf..25f4f108 100644 --- a/deno/src/parser/classes/MusicVisualHeader.ts +++ b/deno/src/parser/classes/MusicVisualHeader.ts @@ -1,5 +1,5 @@ import { YTNode } from '../helpers.ts'; -import Parser, { type RawNode } from '../index.ts'; +import { Parser, type RawNode } from '../index.ts'; import Menu from './menus/Menu.ts'; import Text from './misc/Text.ts'; import Thumbnail from './misc/Thumbnail.ts'; diff --git a/deno/src/parser/classes/NavigationEndpoint.ts b/deno/src/parser/classes/NavigationEndpoint.ts index ce98a877..f14efcdd 100644 --- a/deno/src/parser/classes/NavigationEndpoint.ts +++ b/deno/src/parser/classes/NavigationEndpoint.ts @@ -1,7 +1,7 @@ import type Actions from '../../core/Actions.ts'; import type { ApiResponse } from '../../core/Actions.ts'; import { YTNode } from '../helpers.ts'; -import Parser, { type RawNode } from '../index.ts'; +import { Parser, type RawNode } from '../index.ts'; import type { IParsedResponse } from '../types/ParsedResponse.ts'; import CreatePlaylistDialog from './CreatePlaylistDialog.ts'; import OpenPopupAction from './actions/OpenPopupAction.ts'; diff --git a/deno/src/parser/classes/Notification.ts b/deno/src/parser/classes/Notification.ts index 89584d32..b672e223 100644 --- a/deno/src/parser/classes/Notification.ts +++ b/deno/src/parser/classes/Notification.ts @@ -1,5 +1,5 @@ import { YTNode } from '../helpers.ts'; -import Parser, { type RawNode } from '../index.ts'; +import { Parser, type RawNode } from '../index.ts'; import Text from './misc/Text.ts'; import Thumbnail from './misc/Thumbnail.ts'; import NavigationEndpoint from './NavigationEndpoint.ts'; diff --git a/deno/src/parser/classes/PageHeader.ts b/deno/src/parser/classes/PageHeader.ts index 4fae0f05..acbad05f 100644 --- a/deno/src/parser/classes/PageHeader.ts +++ b/deno/src/parser/classes/PageHeader.ts @@ -1,5 +1,5 @@ import { YTNode } from '../helpers.ts'; -import Parser, { type RawNode } from '../index.ts'; +import { Parser, type RawNode } from '../index.ts'; import PageHeaderView from './PageHeaderView.ts'; export default class PageHeader extends YTNode { diff --git a/deno/src/parser/classes/PageHeaderView.ts b/deno/src/parser/classes/PageHeaderView.ts index 62aa9d9b..b18a781e 100644 --- a/deno/src/parser/classes/PageHeaderView.ts +++ b/deno/src/parser/classes/PageHeaderView.ts @@ -1,17 +1,23 @@ import { YTNode } from '../helpers.ts'; -import Parser, { type RawNode } from '../index.ts'; +import { Parser, type RawNode } from '../index.ts'; +import ContentMetadataView from './ContentMetadataView.ts'; import ContentPreviewImageView from './ContentPreviewImageView.ts'; import DynamicTextView from './DynamicTextView.ts'; +import FlexibleActionsView from './FlexibleActionsView.ts'; export default class PageHeaderView extends YTNode { static type = 'PageHeaderView'; - image: ContentPreviewImageView | null; title: DynamicTextView | null; + image: ContentPreviewImageView | null; + metadata: ContentMetadataView | null; + actions: FlexibleActionsView | null; constructor(data: RawNode) { super(); - this.image = Parser.parseItem(data.image, ContentPreviewImageView); this.title = Parser.parseItem(data.title, DynamicTextView); + this.image = Parser.parseItem(data.image, ContentPreviewImageView); + this.metadata = Parser.parseItem(data.metadata, ContentMetadataView); + this.actions = Parser.parseItem(data.actions, FlexibleActionsView); } } \ No newline at end of file diff --git a/deno/src/parser/classes/PivotButton.ts b/deno/src/parser/classes/PivotButton.ts new file mode 100644 index 00000000..8d1357ad --- /dev/null +++ b/deno/src/parser/classes/PivotButton.ts @@ -0,0 +1,28 @@ +import { type RawNode } from '../index.ts'; +import { YTNode } from '../helpers.ts'; +import Thumbnail from './misc/Thumbnail.ts'; +import NavigationEndpoint from './NavigationEndpoint.ts'; +import Text from './misc/Text.ts'; + +export default class PivotButton extends YTNode { + static type = 'PivotButton'; + + thumbnail: Thumbnail[]; + endpoint: NavigationEndpoint; + content_description: Text; + target_id: string; + sound_attribution_title: Text; + waveform_animation_style: string; + background_animation_style: string; + + constructor(data: RawNode) { + super(); + this.thumbnail = Thumbnail.fromResponse(data.thumbnail); + this.endpoint = new NavigationEndpoint(data.onClickCommand); + this.content_description = new Text(data.contentDescription); + this.target_id = data.targetId; + this.sound_attribution_title = new Text(data.soundAttributionTitle); + this.waveform_animation_style = data.waveformAnimationStyle; + this.background_animation_style = data.backgroundAnimationStyle; + } +} \ No newline at end of file diff --git a/deno/src/parser/classes/PlayerAnnotationsExpanded.ts b/deno/src/parser/classes/PlayerAnnotationsExpanded.ts index 5f91c86e..5f5be274 100644 --- a/deno/src/parser/classes/PlayerAnnotationsExpanded.ts +++ b/deno/src/parser/classes/PlayerAnnotationsExpanded.ts @@ -1,5 +1,5 @@ import { YTNode } from '../helpers.ts'; -import Parser, { type RawNode } from '../index.ts'; +import { Parser, type RawNode } from '../index.ts'; import Thumbnail from './misc/Thumbnail.ts'; import NavigationEndpoint from './NavigationEndpoint.ts'; diff --git a/deno/src/parser/classes/PlayerErrorMessage.ts b/deno/src/parser/classes/PlayerErrorMessage.ts index d90459f2..064e033b 100644 --- a/deno/src/parser/classes/PlayerErrorMessage.ts +++ b/deno/src/parser/classes/PlayerErrorMessage.ts @@ -1,5 +1,5 @@ import { YTNode } from '../helpers.ts'; -import Parser, { type RawNode } from '../index.ts'; +import { Parser, type RawNode } from '../index.ts'; import Button from './Button.ts'; import Text from './misc/Text.ts'; import Thumbnail from './misc/Thumbnail.ts'; diff --git a/deno/src/parser/classes/PlayerOverlay.ts b/deno/src/parser/classes/PlayerOverlay.ts index 02564684..d2cb39f6 100644 --- a/deno/src/parser/classes/PlayerOverlay.ts +++ b/deno/src/parser/classes/PlayerOverlay.ts @@ -1,5 +1,5 @@ import { YTNode, type ObservedArray } from '../helpers.ts'; -import Parser, { type RawNode } from '../index.ts'; +import { Parser, type RawNode } from '../index.ts'; import Button from './Button.ts'; import DecoratedPlayerBar from './DecoratedPlayerBar.ts'; import PlayerOverlayAutoplay from './PlayerOverlayAutoplay.ts'; diff --git a/deno/src/parser/classes/PlayerOverlayAutoplay.ts b/deno/src/parser/classes/PlayerOverlayAutoplay.ts index ec87b510..be8d8802 100644 --- a/deno/src/parser/classes/PlayerOverlayAutoplay.ts +++ b/deno/src/parser/classes/PlayerOverlayAutoplay.ts @@ -1,5 +1,5 @@ import { YTNode, type ObservedArray } from '../helpers.ts'; -import Parser, { type RawNode } from '../index.ts'; +import { Parser, type RawNode } from '../index.ts'; import Button from './Button.ts'; import Author from './misc/Author.ts'; import Text from './misc/Text.ts'; diff --git a/deno/src/parser/classes/Playlist.ts b/deno/src/parser/classes/Playlist.ts index 3ac84f75..95dae819 100644 --- a/deno/src/parser/classes/Playlist.ts +++ b/deno/src/parser/classes/Playlist.ts @@ -1,5 +1,5 @@ import { YTNode, type ObservedArray } from '../helpers.ts'; -import Parser, { type RawNode } from '../index.ts'; +import { Parser, type RawNode } from '../index.ts'; import NavigationEndpoint from './NavigationEndpoint.ts'; import PlaylistCustomThumbnail from './PlaylistCustomThumbnail.ts'; import PlaylistVideoThumbnail from './PlaylistVideoThumbnail.ts'; diff --git a/deno/src/parser/classes/PlaylistHeader.ts b/deno/src/parser/classes/PlaylistHeader.ts index 5ff89e17..25b1d602 100644 --- a/deno/src/parser/classes/PlaylistHeader.ts +++ b/deno/src/parser/classes/PlaylistHeader.ts @@ -1,6 +1,6 @@ import Text from './misc/Text.ts'; import Author from './misc/Author.ts'; -import Parser, { type RawNode } from '../index.ts'; +import { Parser, type RawNode } from '../index.ts'; import { YTNode } from '../helpers.ts'; export default class PlaylistHeader extends YTNode { diff --git a/deno/src/parser/classes/PlaylistPanel.ts b/deno/src/parser/classes/PlaylistPanel.ts index 5c90b1b6..f1a9de9b 100644 --- a/deno/src/parser/classes/PlaylistPanel.ts +++ b/deno/src/parser/classes/PlaylistPanel.ts @@ -1,5 +1,5 @@ import { YTNode, type ObservedArray } from '../helpers.ts'; -import Parser, { type RawNode } from '../index.ts'; +import { Parser, type RawNode } from '../index.ts'; import AutomixPreviewVideo from './AutomixPreviewVideo.ts'; import PlaylistPanelVideo from './PlaylistPanelVideo.ts'; import PlaylistPanelVideoWrapper from './PlaylistPanelVideoWrapper.ts'; diff --git a/deno/src/parser/classes/PlaylistPanelVideo.ts b/deno/src/parser/classes/PlaylistPanelVideo.ts index 8975c70d..a72cec8e 100644 --- a/deno/src/parser/classes/PlaylistPanelVideo.ts +++ b/deno/src/parser/classes/PlaylistPanelVideo.ts @@ -1,6 +1,6 @@ import { timeToSeconds } from '../../utils/Utils.ts'; import { YTNode, type ObservedArray } from '../helpers.ts'; -import Parser, { type RawNode } from '../index.ts'; +import { Parser, type RawNode } from '../index.ts'; import NavigationEndpoint from './NavigationEndpoint.ts'; import Text from './misc/Text.ts'; import type TextRun from './misc/TextRun.ts'; diff --git a/deno/src/parser/classes/PlaylistPanelVideoWrapper.ts b/deno/src/parser/classes/PlaylistPanelVideoWrapper.ts index ddb3062a..93805227 100644 --- a/deno/src/parser/classes/PlaylistPanelVideoWrapper.ts +++ b/deno/src/parser/classes/PlaylistPanelVideoWrapper.ts @@ -1,4 +1,4 @@ -import Parser, { type RawNode } from '../index.ts'; +import { Parser, type RawNode } from '../index.ts'; import { type ObservedArray, YTNode, observe } from '../helpers.ts'; import PlaylistPanelVideo from './PlaylistPanelVideo.ts'; diff --git a/deno/src/parser/classes/PlaylistSidebar.ts b/deno/src/parser/classes/PlaylistSidebar.ts index 42edbd8c..307e1004 100644 --- a/deno/src/parser/classes/PlaylistSidebar.ts +++ b/deno/src/parser/classes/PlaylistSidebar.ts @@ -1,4 +1,4 @@ -import Parser, { type RawNode } from '../index.ts'; +import { Parser, type RawNode } from '../index.ts'; import { type ObservedArray, YTNode } from '../helpers.ts'; export default class PlaylistSidebar extends YTNode { diff --git a/deno/src/parser/classes/PlaylistSidebarPrimaryInfo.ts b/deno/src/parser/classes/PlaylistSidebarPrimaryInfo.ts index bad1d95d..5a37d214 100644 --- a/deno/src/parser/classes/PlaylistSidebarPrimaryInfo.ts +++ b/deno/src/parser/classes/PlaylistSidebarPrimaryInfo.ts @@ -1,5 +1,5 @@ import { YTNode } from '../helpers.ts'; -import Parser, { type RawNode } from '../index.ts'; +import { Parser, type RawNode } from '../index.ts'; import NavigationEndpoint from './NavigationEndpoint.ts'; import Text from './misc/Text.ts'; diff --git a/deno/src/parser/classes/PlaylistSidebarSecondaryInfo.ts b/deno/src/parser/classes/PlaylistSidebarSecondaryInfo.ts index 221e62a1..123b9af9 100644 --- a/deno/src/parser/classes/PlaylistSidebarSecondaryInfo.ts +++ b/deno/src/parser/classes/PlaylistSidebarSecondaryInfo.ts @@ -1,5 +1,5 @@ import { YTNode } from '../helpers.ts'; -import Parser, { type RawNode } from '../index.ts'; +import { Parser, type RawNode } from '../index.ts'; export default class PlaylistSidebarSecondaryInfo extends YTNode { static type = 'PlaylistSidebarSecondaryInfo'; diff --git a/deno/src/parser/classes/PlaylistVideo.ts b/deno/src/parser/classes/PlaylistVideo.ts index d216339c..164e551b 100644 --- a/deno/src/parser/classes/PlaylistVideo.ts +++ b/deno/src/parser/classes/PlaylistVideo.ts @@ -1,5 +1,5 @@ import { YTNode, type ObservedArray } from '../helpers.ts'; -import Parser, { type RawNode } from '../index.ts'; +import { Parser, type RawNode } from '../index.ts'; import NavigationEndpoint from './NavigationEndpoint.ts'; import ThumbnailOverlayTimeStatus from './ThumbnailOverlayTimeStatus.ts'; import Menu from './menus/Menu.ts'; diff --git a/deno/src/parser/classes/PlaylistVideoList.ts b/deno/src/parser/classes/PlaylistVideoList.ts index fb089276..9662483e 100644 --- a/deno/src/parser/classes/PlaylistVideoList.ts +++ b/deno/src/parser/classes/PlaylistVideoList.ts @@ -1,4 +1,4 @@ -import Parser, { type RawNode } from '../index.ts'; +import { Parser, type RawNode } from '../index.ts'; import { type ObservedArray, YTNode } from '../helpers.ts'; export default class PlaylistVideoList extends YTNode { diff --git a/deno/src/parser/classes/PostMultiImage.ts b/deno/src/parser/classes/PostMultiImage.ts index cf14d6fd..dca13338 100644 --- a/deno/src/parser/classes/PostMultiImage.ts +++ b/deno/src/parser/classes/PostMultiImage.ts @@ -1,4 +1,4 @@ -import Parser, { type RawNode } from '../index.ts'; +import { Parser, type RawNode } from '../index.ts'; import BackstageImage from './BackstageImage.ts'; import { YTNode } from '../helpers.ts'; diff --git a/deno/src/parser/classes/ProductList.ts b/deno/src/parser/classes/ProductList.ts index 2c24c883..7f52061c 100644 --- a/deno/src/parser/classes/ProductList.ts +++ b/deno/src/parser/classes/ProductList.ts @@ -1,7 +1,7 @@ import type { ObservedArray} from '../helpers.ts'; import { YTNode } from '../helpers.ts'; import type { RawNode } from '../index.ts'; -import Parser from '../index.ts'; +import { Parser } from '../index.ts'; export default class ProductList extends YTNode { static type = 'ProductList'; diff --git a/deno/src/parser/classes/ProductListItem.ts b/deno/src/parser/classes/ProductListItem.ts index 98116b49..0ff3bfd3 100644 --- a/deno/src/parser/classes/ProductListItem.ts +++ b/deno/src/parser/classes/ProductListItem.ts @@ -1,6 +1,6 @@ import { YTNode } from '../helpers.ts'; import type { RawNode } from '../index.ts'; -import Parser from '../index.ts'; +import { Parser } from '../index.ts'; import { Text, Thumbnail } from '../misc.ts'; import Button from './Button.ts'; import NavigationEndpoint from './NavigationEndpoint.ts'; diff --git a/deno/src/parser/classes/ProfileColumn.ts b/deno/src/parser/classes/ProfileColumn.ts index a6adb12b..a4ea9f93 100644 --- a/deno/src/parser/classes/ProfileColumn.ts +++ b/deno/src/parser/classes/ProfileColumn.ts @@ -1,5 +1,5 @@ import { YTNode, type ObservedArray } from '../helpers.ts'; -import Parser, { type RawNode } from '../index.ts'; +import { Parser, type RawNode } from '../index.ts'; export default class ProfileColumn extends YTNode { static type = 'ProfileColumn'; diff --git a/deno/src/parser/classes/ProfileColumnStats.ts b/deno/src/parser/classes/ProfileColumnStats.ts index c0c0a06b..76c135f9 100644 --- a/deno/src/parser/classes/ProfileColumnStats.ts +++ b/deno/src/parser/classes/ProfileColumnStats.ts @@ -1,4 +1,4 @@ -import Parser, { type RawNode } from '../index.ts'; +import { Parser, type RawNode } from '../index.ts'; import { type ObservedArray, YTNode } from '../helpers.ts'; export default class ProfileColumnStats extends YTNode { diff --git a/deno/src/parser/classes/RecognitionShelf.ts b/deno/src/parser/classes/RecognitionShelf.ts index cd7ab8be..68cbb35b 100644 --- a/deno/src/parser/classes/RecognitionShelf.ts +++ b/deno/src/parser/classes/RecognitionShelf.ts @@ -1,4 +1,4 @@ -import Parser, { type RawNode } from '../index.ts'; +import { Parser, type RawNode } from '../index.ts'; import { YTNode } from '../helpers.ts'; import Button from './Button.ts'; import Text from './misc/Text.ts'; diff --git a/deno/src/parser/classes/ReelPlayerHeader.ts b/deno/src/parser/classes/ReelPlayerHeader.ts new file mode 100644 index 00000000..ad91641e --- /dev/null +++ b/deno/src/parser/classes/ReelPlayerHeader.ts @@ -0,0 +1,24 @@ +import { type RawNode } from '../index.ts'; +import { YTNode } from '../helpers.ts'; +import Thumbnail from './misc/Thumbnail.ts'; +import Author from './misc/Author.ts'; +import Text from './misc/Text.ts'; + +export default class ReelPlayerHeader extends YTNode { + static type = 'ReelPlayerHeader'; + + reel_title_text: Text; + timestamp_text: Text; + channel_title_text: Text; + channel_thumbnail: Thumbnail[]; + author: Author; + + constructor(data: RawNode) { + super(); + this.reel_title_text = new Text(data.reelTitleText); + this.timestamp_text = new Text(data.timestampText); + this.channel_title_text = new Text(data.channelTitleText); + this.channel_thumbnail = Thumbnail.fromResponse(data.channelThumbnail); + this.author = new Author(data.channelNavigationEndpoint, undefined); + } +} \ No newline at end of file diff --git a/deno/src/parser/classes/ReelPlayerOverlay.ts b/deno/src/parser/classes/ReelPlayerOverlay.ts new file mode 100644 index 00000000..536672fb --- /dev/null +++ b/deno/src/parser/classes/ReelPlayerOverlay.ts @@ -0,0 +1,39 @@ +import { Parser, type RawNode } from '../index.ts'; +import { YTNode } from '../helpers.ts'; +import Button from './Button.ts'; +import Menu from './menus/Menu.ts'; +import InfoPanelContainer from './InfoPanelContainer.ts'; +import LikeButton from './LikeButton.ts'; +import ReelPlayerHeader from './ReelPlayerHeader.ts'; +import PivotButton from './PivotButton.ts'; + +export default class ReelPlayerOverlay extends YTNode { + static type = 'ReelPlayerOverlay'; + + like_button: LikeButton | null; + reel_player_header_supported_renderers: ReelPlayerHeader | null; + menu: Menu | null; + next_item_button: Button | null; + prev_item_button: Button | null; + subscribe_button_renderer: Button | null; + style: string; + view_comments_button: Button | null; + share_button: Button | null; + pivot_button: PivotButton | null; + info_panel: InfoPanelContainer | null; + + constructor(data: RawNode) { + super(); + this.like_button = Parser.parseItem(data.likeButton, LikeButton); + this.reel_player_header_supported_renderers = Parser.parseItem(data.reelPlayerHeaderSupportedRenderers, ReelPlayerHeader); + this.menu = Parser.parseItem(data.menu, Menu); + this.next_item_button = Parser.parseItem(data.nextItemButton, Button); + this.prev_item_button = Parser.parseItem(data.prevItemButton, Button); + this.subscribe_button_renderer = Parser.parseItem(data.subscribeButtonRenderer, Button); + this.style = data.style; + this.view_comments_button = Parser.parseItem(data.viewCommentsButton, Button); + this.share_button = Parser.parseItem(data.shareButton, Button); + this.pivot_button = Parser.parseItem(data.pivotButton, PivotButton); + this.info_panel = Parser.parseItem(data.infoPanel, InfoPanelContainer); + } +} \ No newline at end of file diff --git a/deno/src/parser/classes/ReelShelf.ts b/deno/src/parser/classes/ReelShelf.ts index 4d4cb29b..8ed7f7d9 100644 --- a/deno/src/parser/classes/ReelShelf.ts +++ b/deno/src/parser/classes/ReelShelf.ts @@ -1,5 +1,5 @@ import { YTNode, type ObservedArray } from '../helpers.ts'; -import Parser, { type RawNode } from '../index.ts'; +import { Parser, type RawNode } from '../index.ts'; import NavigationEndpoint from './NavigationEndpoint.ts'; import Text from './misc/Text.ts'; diff --git a/deno/src/parser/classes/RelatedChipCloud.ts b/deno/src/parser/classes/RelatedChipCloud.ts index 71d88d95..b4e0c0bc 100644 --- a/deno/src/parser/classes/RelatedChipCloud.ts +++ b/deno/src/parser/classes/RelatedChipCloud.ts @@ -1,4 +1,4 @@ -import Parser, { type RawNode } from '../index.ts'; +import { Parser, type RawNode } from '../index.ts'; import { YTNode } from '../helpers.ts'; export default class RelatedChipCloud extends YTNode { diff --git a/deno/src/parser/classes/RichGrid.ts b/deno/src/parser/classes/RichGrid.ts index 25f6ddb6..b3f640e6 100644 --- a/deno/src/parser/classes/RichGrid.ts +++ b/deno/src/parser/classes/RichGrid.ts @@ -1,4 +1,4 @@ -import Parser, { type RawNode } from '../index.ts'; +import { Parser, type RawNode } from '../index.ts'; import { type ObservedArray, YTNode } from '../helpers.ts'; export default class RichGrid extends YTNode { diff --git a/deno/src/parser/classes/RichItem.ts b/deno/src/parser/classes/RichItem.ts index bfadd82f..4012405d 100644 --- a/deno/src/parser/classes/RichItem.ts +++ b/deno/src/parser/classes/RichItem.ts @@ -1,4 +1,4 @@ -import Parser, { type RawNode } from '../index.ts'; +import { Parser, type RawNode } from '../index.ts'; import { YTNode } from '../helpers.ts'; export default class RichItem extends YTNode { diff --git a/deno/src/parser/classes/RichMetadataRow.ts b/deno/src/parser/classes/RichMetadataRow.ts index e22c4d9c..3898c891 100644 --- a/deno/src/parser/classes/RichMetadataRow.ts +++ b/deno/src/parser/classes/RichMetadataRow.ts @@ -1,4 +1,4 @@ -import Parser, { type RawNode } from '../index.ts'; +import { Parser, type RawNode } from '../index.ts'; import { type ObservedArray, YTNode } from '../helpers.ts'; export default class RichMetadataRow extends YTNode { diff --git a/deno/src/parser/classes/RichSection.ts b/deno/src/parser/classes/RichSection.ts index 5e1b28a6..e73ad3f1 100644 --- a/deno/src/parser/classes/RichSection.ts +++ b/deno/src/parser/classes/RichSection.ts @@ -1,5 +1,5 @@ import { YTNode } from '../helpers.ts'; -import Parser, { type RawNode } from '../index.ts'; +import { Parser, type RawNode } from '../index.ts'; export default class RichSection extends YTNode { static type = 'RichSection'; diff --git a/deno/src/parser/classes/RichShelf.ts b/deno/src/parser/classes/RichShelf.ts index 53baaa6e..105e97df 100644 --- a/deno/src/parser/classes/RichShelf.ts +++ b/deno/src/parser/classes/RichShelf.ts @@ -1,5 +1,5 @@ import { YTNode, type ObservedArray } from '../helpers.ts'; -import Parser, { type RawNode } from '../index.ts'; +import { Parser, type RawNode } from '../index.ts'; import NavigationEndpoint from './NavigationEndpoint.ts'; import Text from './misc/Text.ts'; diff --git a/deno/src/parser/classes/SearchBox.ts b/deno/src/parser/classes/SearchBox.ts index a61da06a..d4a851fa 100644 --- a/deno/src/parser/classes/SearchBox.ts +++ b/deno/src/parser/classes/SearchBox.ts @@ -1,5 +1,5 @@ import { YTNode } from '../helpers.ts'; -import Parser, { type RawNode } from '../index.ts'; +import { Parser, type RawNode } from '../index.ts'; import Button from './Button.ts'; import NavigationEndpoint from './NavigationEndpoint.ts'; import Text from './misc/Text.ts'; diff --git a/deno/src/parser/classes/SearchSubMenu.ts b/deno/src/parser/classes/SearchSubMenu.ts index c79583bf..2d0c3e8c 100644 --- a/deno/src/parser/classes/SearchSubMenu.ts +++ b/deno/src/parser/classes/SearchSubMenu.ts @@ -1,6 +1,6 @@ import { type ObservedArray, YTNode } from '../helpers.ts'; import type { RawNode } from '../index.ts'; -import Parser from '../index.ts'; +import { Parser } from '../index.ts'; import Text from './misc/Text.ts'; import SearchFilterGroup from './SearchFilterGroup.ts'; import ToggleButton from './ToggleButton.ts'; diff --git a/deno/src/parser/classes/SearchSuggestionsSection.ts b/deno/src/parser/classes/SearchSuggestionsSection.ts index 1529c24c..1504e77b 100644 --- a/deno/src/parser/classes/SearchSuggestionsSection.ts +++ b/deno/src/parser/classes/SearchSuggestionsSection.ts @@ -1,4 +1,4 @@ -import Parser, { type RawNode } from '../index.ts'; +import { Parser, type RawNode } from '../index.ts'; import { type ObservedArray, YTNode } from '../helpers.ts'; export default class SearchSuggestionsSection extends YTNode { diff --git a/deno/src/parser/classes/SecondarySearchContainer.ts b/deno/src/parser/classes/SecondarySearchContainer.ts index 4beff652..926f7d31 100644 --- a/deno/src/parser/classes/SecondarySearchContainer.ts +++ b/deno/src/parser/classes/SecondarySearchContainer.ts @@ -1,4 +1,4 @@ -import Parser, { type RawNode } from '../index.ts'; +import { Parser, type RawNode } from '../index.ts'; import { type ObservedArray, YTNode } from '../helpers.ts'; export default class SecondarySearchContainer extends YTNode { diff --git a/deno/src/parser/classes/SectionList.ts b/deno/src/parser/classes/SectionList.ts index 900b2210..36547daa 100644 --- a/deno/src/parser/classes/SectionList.ts +++ b/deno/src/parser/classes/SectionList.ts @@ -1,5 +1,5 @@ import { type ObservedArray, YTNode } from '../helpers.ts'; -import Parser, { type RawNode } from '../index.ts'; +import { Parser, type RawNode } from '../index.ts'; export default class SectionList extends YTNode { static type = 'SectionList'; diff --git a/deno/src/parser/classes/SegmentedLikeDislikeButton.ts b/deno/src/parser/classes/SegmentedLikeDislikeButton.ts index 7e81a4ce..15b4a0e3 100644 --- a/deno/src/parser/classes/SegmentedLikeDislikeButton.ts +++ b/deno/src/parser/classes/SegmentedLikeDislikeButton.ts @@ -1,6 +1,6 @@ import { YTNode } from '../helpers.ts'; import type { RawNode } from '../index.ts'; -import Parser from '../index.ts'; +import { Parser } from '../index.ts'; import Button from './Button.ts'; import ToggleButton from './ToggleButton.ts'; diff --git a/deno/src/parser/classes/SettingsOptions.ts b/deno/src/parser/classes/SettingsOptions.ts index 57027414..b77d137a 100644 --- a/deno/src/parser/classes/SettingsOptions.ts +++ b/deno/src/parser/classes/SettingsOptions.ts @@ -1,5 +1,5 @@ import { YTNode, type ObservedArray } from '../helpers.ts'; -import Parser, { type RawNode } from '../index.ts'; +import { Parser, type RawNode } from '../index.ts'; import ChannelOptions from './ChannelOptions.ts'; import CopyLink from './CopyLink.ts'; import Dropdown from './Dropdown.ts'; diff --git a/deno/src/parser/classes/SettingsSidebar.ts b/deno/src/parser/classes/SettingsSidebar.ts index 8a89235c..8061adff 100644 --- a/deno/src/parser/classes/SettingsSidebar.ts +++ b/deno/src/parser/classes/SettingsSidebar.ts @@ -1,5 +1,5 @@ import { YTNode, type ObservedArray } from '../helpers.ts'; -import Parser, { type RawNode } from '../index.ts'; +import { Parser, type RawNode } from '../index.ts'; import CompactLink from './CompactLink.ts'; import Text from './misc/Text.ts'; diff --git a/deno/src/parser/classes/Shelf.ts b/deno/src/parser/classes/Shelf.ts index 694baf70..339522ec 100644 --- a/deno/src/parser/classes/Shelf.ts +++ b/deno/src/parser/classes/Shelf.ts @@ -1,5 +1,5 @@ import Text from './misc/Text.ts'; -import Parser, { type RawNode } from '../index.ts'; +import { Parser, type RawNode } from '../index.ts'; import NavigationEndpoint from './NavigationEndpoint.ts'; import { YTNode } from '../helpers.ts'; import Button from './Button.ts'; diff --git a/deno/src/parser/classes/SingleColumnBrowseResults.ts b/deno/src/parser/classes/SingleColumnBrowseResults.ts index b9a045b6..6c8e80df 100644 --- a/deno/src/parser/classes/SingleColumnBrowseResults.ts +++ b/deno/src/parser/classes/SingleColumnBrowseResults.ts @@ -1,5 +1,5 @@ import { YTNode, type ObservedArray } from '../helpers.ts'; -import Parser, { type RawNode } from '../index.ts'; +import { Parser, type RawNode } from '../index.ts'; import Tab from './Tab.ts'; export default class SingleColumnBrowseResults extends YTNode { diff --git a/deno/src/parser/classes/SingleColumnMusicWatchNextResults.ts b/deno/src/parser/classes/SingleColumnMusicWatchNextResults.ts index c9c86ddd..f2707992 100644 --- a/deno/src/parser/classes/SingleColumnMusicWatchNextResults.ts +++ b/deno/src/parser/classes/SingleColumnMusicWatchNextResults.ts @@ -1,5 +1,5 @@ import { YTNode } from '../helpers.ts'; -import Parser, { type RawNode } from '../index.ts'; +import { Parser, type RawNode } from '../index.ts'; export default class SingleColumnMusicWatchNextResults extends YTNode { static type = 'SingleColumnMusicWatchNextResults'; diff --git a/deno/src/parser/classes/SlimOwner.ts b/deno/src/parser/classes/SlimOwner.ts index 28182930..9c64f11a 100644 --- a/deno/src/parser/classes/SlimOwner.ts +++ b/deno/src/parser/classes/SlimOwner.ts @@ -1,5 +1,5 @@ import { YTNode } from '../helpers.ts'; -import Parser, { type RawNode } from '../index.ts'; +import { Parser, type RawNode } from '../index.ts'; import NavigationEndpoint from './NavigationEndpoint.ts'; import SubscribeButton from './SubscribeButton.ts'; import Text from './misc/Text.ts'; diff --git a/deno/src/parser/classes/SlimVideoMetadata.ts b/deno/src/parser/classes/SlimVideoMetadata.ts index 096e0295..2af85ada 100644 --- a/deno/src/parser/classes/SlimVideoMetadata.ts +++ b/deno/src/parser/classes/SlimVideoMetadata.ts @@ -1,5 +1,5 @@ import { YTNode } from '../helpers.ts'; -import Parser, { type RawNode } from '../index.ts'; +import { Parser, type RawNode } from '../index.ts'; import Text from './misc/Text.ts'; export default class SlimVideoMetadata extends YTNode { diff --git a/deno/src/parser/classes/StructuredDescriptionContent.ts b/deno/src/parser/classes/StructuredDescriptionContent.ts index b03d2da2..43a39f1e 100644 --- a/deno/src/parser/classes/StructuredDescriptionContent.ts +++ b/deno/src/parser/classes/StructuredDescriptionContent.ts @@ -1,5 +1,5 @@ import { YTNode, type ObservedArray } from '../helpers.ts'; -import Parser, { type RawNode } from '../index.ts'; +import { Parser, type RawNode } from '../index.ts'; import ExpandableVideoDescriptionBody from './ExpandableVideoDescriptionBody.ts'; import HorizontalCardList from './HorizontalCardList.ts'; import VideoDescriptionHeader from './VideoDescriptionHeader.ts'; @@ -7,6 +7,7 @@ import VideoDescriptionInfocardsSection from './VideoDescriptionInfocardsSection import VideoDescriptionMusicSection from './VideoDescriptionMusicSection.ts'; import VideoDescriptionTranscriptSection from './VideoDescriptionTranscriptSection.ts'; import VideoDescriptionCourseSection from './VideoDescriptionCourseSection.ts'; +import ReelShelf from './ReelShelf.ts'; export default class StructuredDescriptionContent extends YTNode { static type = 'StructuredDescriptionContent'; @@ -14,7 +15,7 @@ export default class StructuredDescriptionContent extends YTNode { items: ObservedArray< VideoDescriptionHeader | ExpandableVideoDescriptionBody | VideoDescriptionMusicSection | VideoDescriptionInfocardsSection | VideoDescriptionTranscriptSection | VideoDescriptionTranscriptSection | - VideoDescriptionCourseSection | HorizontalCardList + VideoDescriptionCourseSection | HorizontalCardList | ReelShelf >; constructor(data: RawNode) { @@ -22,7 +23,7 @@ export default class StructuredDescriptionContent extends YTNode { this.items = Parser.parseArray(data.items, [ VideoDescriptionHeader, ExpandableVideoDescriptionBody, VideoDescriptionMusicSection, VideoDescriptionInfocardsSection, VideoDescriptionCourseSection, VideoDescriptionTranscriptSection, - VideoDescriptionTranscriptSection, HorizontalCardList + VideoDescriptionTranscriptSection, HorizontalCardList, ReelShelf ]); } } \ No newline at end of file diff --git a/deno/src/parser/classes/SubFeedSelector.ts b/deno/src/parser/classes/SubFeedSelector.ts index 665b80b9..a3f8a273 100644 --- a/deno/src/parser/classes/SubFeedSelector.ts +++ b/deno/src/parser/classes/SubFeedSelector.ts @@ -1,4 +1,4 @@ -import Parser, { type RawNode } from '../index.ts'; +import { Parser, type RawNode } from '../index.ts'; import Text from './misc/Text.ts'; import { type ObservedArray, YTNode } from '../helpers.ts'; import SubFeedOption from './SubFeedOption.ts'; diff --git a/deno/src/parser/classes/SubscribeButton.ts b/deno/src/parser/classes/SubscribeButton.ts index 9faac8e6..ae1fcb07 100644 --- a/deno/src/parser/classes/SubscribeButton.ts +++ b/deno/src/parser/classes/SubscribeButton.ts @@ -1,5 +1,5 @@ import { YTNode } from '../helpers.ts'; -import Parser, { type RawNode } from '../index.ts'; +import { Parser, type RawNode } from '../index.ts'; import NavigationEndpoint from './NavigationEndpoint.ts'; import SubscriptionNotificationToggleButton from './SubscriptionNotificationToggleButton.ts'; import Text from './misc/Text.ts'; diff --git a/deno/src/parser/classes/SubscriptionNotificationToggleButton.ts b/deno/src/parser/classes/SubscriptionNotificationToggleButton.ts index 76c6d053..f1fbe230 100644 --- a/deno/src/parser/classes/SubscriptionNotificationToggleButton.ts +++ b/deno/src/parser/classes/SubscriptionNotificationToggleButton.ts @@ -1,4 +1,4 @@ -import Parser, { type RawNode } from '../index.ts'; +import { Parser, type RawNode } from '../index.ts'; import { type SuperParsedResult, YTNode } from '../helpers.ts'; export default class SubscriptionNotificationToggleButton extends YTNode { diff --git a/deno/src/parser/classes/Tab.ts b/deno/src/parser/classes/Tab.ts index 444e3929..a7b72457 100644 --- a/deno/src/parser/classes/Tab.ts +++ b/deno/src/parser/classes/Tab.ts @@ -1,4 +1,4 @@ -import Parser, { type RawNode } from '../index.ts'; +import { Parser, type RawNode } from '../index.ts'; import NavigationEndpoint from './NavigationEndpoint.ts'; import SectionList from './SectionList.ts'; import MusicQueue from './MusicQueue.ts'; diff --git a/deno/src/parser/classes/Tabbed.ts b/deno/src/parser/classes/Tabbed.ts index 799eb1d9..854676ef 100644 --- a/deno/src/parser/classes/Tabbed.ts +++ b/deno/src/parser/classes/Tabbed.ts @@ -1,5 +1,5 @@ import { YTNode, type SuperParsedResult } from '../helpers.ts'; -import Parser, { type RawNode } from '../index.ts'; +import { Parser, type RawNode } from '../index.ts'; export default class Tabbed extends YTNode { static type = 'Tabbed'; diff --git a/deno/src/parser/classes/TabbedSearchResults.ts b/deno/src/parser/classes/TabbedSearchResults.ts index 91a98d37..13026bdb 100644 --- a/deno/src/parser/classes/TabbedSearchResults.ts +++ b/deno/src/parser/classes/TabbedSearchResults.ts @@ -1,4 +1,4 @@ -import Parser, { type RawNode } from '../index.ts'; +import { Parser, type RawNode } from '../index.ts'; import { type ObservedArray, YTNode } from '../helpers.ts'; import Tab from './Tab.ts'; diff --git a/deno/src/parser/classes/TopicChannelDetails.ts b/deno/src/parser/classes/TopicChannelDetails.ts index 59aac556..12caa2d4 100644 --- a/deno/src/parser/classes/TopicChannelDetails.ts +++ b/deno/src/parser/classes/TopicChannelDetails.ts @@ -1,5 +1,5 @@ import { YTNode } from '../helpers.ts'; -import Parser, { type RawNode } from '../index.ts'; +import { Parser, type RawNode } from '../index.ts'; import NavigationEndpoint from './NavigationEndpoint.ts'; import SubscribeButton from './SubscribeButton.ts'; import Text from './misc/Text.ts'; diff --git a/deno/src/parser/classes/Transcript.ts b/deno/src/parser/classes/Transcript.ts index 85ed5361..e74136f0 100644 --- a/deno/src/parser/classes/Transcript.ts +++ b/deno/src/parser/classes/Transcript.ts @@ -1,6 +1,6 @@ import { YTNode } from '../helpers.ts'; import type { RawNode } from '../index.ts'; -import Parser from '../index.ts'; +import { Parser } from '../index.ts'; import TranscriptSearchPanel from './TranscriptSearchPanel.ts'; export default class Transcript extends YTNode { diff --git a/deno/src/parser/classes/TranscriptFooter.ts b/deno/src/parser/classes/TranscriptFooter.ts index 3dec3f91..66705703 100644 --- a/deno/src/parser/classes/TranscriptFooter.ts +++ b/deno/src/parser/classes/TranscriptFooter.ts @@ -1,6 +1,6 @@ import { YTNode } from '../helpers.ts'; import type { RawNode } from '../index.ts'; -import Parser from '../index.ts'; +import { Parser } from '../index.ts'; import SortFilterSubMenu from './SortFilterSubMenu.ts'; export default class TranscriptFooter extends YTNode { diff --git a/deno/src/parser/classes/TranscriptSearchBox.ts b/deno/src/parser/classes/TranscriptSearchBox.ts index 3d892091..641d2dc9 100644 --- a/deno/src/parser/classes/TranscriptSearchBox.ts +++ b/deno/src/parser/classes/TranscriptSearchBox.ts @@ -1,6 +1,6 @@ import { YTNode } from '../helpers.ts'; import type { RawNode } from '../index.ts'; -import Parser from '../index.ts'; +import { Parser } from '../index.ts'; import Button from './Button.ts'; import NavigationEndpoint from './NavigationEndpoint.ts'; import { Text } from '../misc.ts'; diff --git a/deno/src/parser/classes/TranscriptSearchPanel.ts b/deno/src/parser/classes/TranscriptSearchPanel.ts index dd636613..3df77725 100644 --- a/deno/src/parser/classes/TranscriptSearchPanel.ts +++ b/deno/src/parser/classes/TranscriptSearchPanel.ts @@ -1,6 +1,6 @@ import { YTNode } from '../helpers.ts'; import type { RawNode } from '../index.ts'; -import Parser from '../index.ts'; +import { Parser } from '../index.ts'; import TranscriptFooter from './TranscriptFooter.ts'; import TranscriptSearchBox from './TranscriptSearchBox.ts'; import TranscriptSegmentList from './TranscriptSegmentList.ts'; diff --git a/deno/src/parser/classes/TranscriptSegmentList.ts b/deno/src/parser/classes/TranscriptSegmentList.ts index 050f98ba..09382b34 100644 --- a/deno/src/parser/classes/TranscriptSegmentList.ts +++ b/deno/src/parser/classes/TranscriptSegmentList.ts @@ -1,7 +1,7 @@ import type { ObservedArray } from '../helpers.ts'; import { YTNode } from '../helpers.ts'; import type { RawNode } from '../index.ts'; -import Parser from '../index.ts'; +import { Parser } from '../index.ts'; import { Text } from '../misc.ts'; import TranscriptSectionHeader from './TranscriptSectionHeader.ts'; import TranscriptSegment from './TranscriptSegment.ts'; diff --git a/deno/src/parser/classes/TwoColumnBrowseResults.ts b/deno/src/parser/classes/TwoColumnBrowseResults.ts index cc074657..886fd58a 100644 --- a/deno/src/parser/classes/TwoColumnBrowseResults.ts +++ b/deno/src/parser/classes/TwoColumnBrowseResults.ts @@ -1,5 +1,5 @@ import { YTNode, type SuperParsedResult } from '../helpers.ts'; -import Parser, { type RawNode } from '../index.ts'; +import { Parser, type RawNode } from '../index.ts'; export default class TwoColumnBrowseResults extends YTNode { static type = 'TwoColumnBrowseResults'; diff --git a/deno/src/parser/classes/TwoColumnSearchResults.ts b/deno/src/parser/classes/TwoColumnSearchResults.ts index f4060d62..58bdad97 100644 --- a/deno/src/parser/classes/TwoColumnSearchResults.ts +++ b/deno/src/parser/classes/TwoColumnSearchResults.ts @@ -1,5 +1,5 @@ import { YTNode, type SuperParsedResult } from '../helpers.ts'; -import Parser, { type RawNode } from '../index.ts'; +import { Parser, type RawNode } from '../index.ts'; export default class TwoColumnSearchResults extends YTNode { static type = 'TwoColumnSearchResults'; diff --git a/deno/src/parser/classes/TwoColumnWatchNextResults.ts b/deno/src/parser/classes/TwoColumnWatchNextResults.ts index 73de19d4..86b81d44 100644 --- a/deno/src/parser/classes/TwoColumnWatchNextResults.ts +++ b/deno/src/parser/classes/TwoColumnWatchNextResults.ts @@ -1,5 +1,5 @@ import { YTNode, type ObservedArray } from '../helpers.ts'; -import Parser, { type RawNode } from '../index.ts'; +import { Parser, type RawNode } from '../index.ts'; import NavigationEndpoint from './NavigationEndpoint.ts'; import Menu from './menus/Menu.ts'; import Author from './misc/Author.ts'; diff --git a/deno/src/parser/classes/UniversalWatchCard.ts b/deno/src/parser/classes/UniversalWatchCard.ts index 48027e1e..f92f89bd 100644 --- a/deno/src/parser/classes/UniversalWatchCard.ts +++ b/deno/src/parser/classes/UniversalWatchCard.ts @@ -1,5 +1,5 @@ import { YTNode, type ObservedArray } from '../helpers.ts'; -import Parser, { type RawNode } from '../index.ts'; +import { Parser, type RawNode } from '../index.ts'; import Text from './misc/Text.ts'; export default class UniversalWatchCard extends YTNode { diff --git a/deno/src/parser/classes/UploadTimeFactoid.ts b/deno/src/parser/classes/UploadTimeFactoid.ts index 93369916..7877e933 100644 --- a/deno/src/parser/classes/UploadTimeFactoid.ts +++ b/deno/src/parser/classes/UploadTimeFactoid.ts @@ -1,6 +1,6 @@ import { YTNode } from '../helpers.ts'; import type { RawNode } from '../index.ts'; -import Parser from '../index.ts'; +import { Parser } from '../index.ts'; import Factoid from './Factoid.ts'; export default class UploadTimeFactoid extends YTNode { diff --git a/deno/src/parser/classes/UpsellDialog.ts b/deno/src/parser/classes/UpsellDialog.ts index d7c112cb..d6fba1fa 100644 --- a/deno/src/parser/classes/UpsellDialog.ts +++ b/deno/src/parser/classes/UpsellDialog.ts @@ -1,5 +1,5 @@ import { YTNode } from '../helpers.ts'; -import Parser, { type RawNode } from '../index.ts'; +import { Parser, type RawNode } from '../index.ts'; import Button from './Button.ts'; import Text from './misc/Text.ts'; diff --git a/deno/src/parser/classes/VerticalList.ts b/deno/src/parser/classes/VerticalList.ts index 20ffff60..edd94334 100644 --- a/deno/src/parser/classes/VerticalList.ts +++ b/deno/src/parser/classes/VerticalList.ts @@ -1,5 +1,5 @@ import { YTNode, type ObservedArray } from '../helpers.ts'; -import Parser, { type RawNode } from '../index.ts'; +import { Parser, type RawNode } from '../index.ts'; import Text from './misc/Text.ts'; export default class VerticalList extends YTNode { diff --git a/deno/src/parser/classes/VerticalWatchCardList.ts b/deno/src/parser/classes/VerticalWatchCardList.ts index db54ec39..b96be466 100644 --- a/deno/src/parser/classes/VerticalWatchCardList.ts +++ b/deno/src/parser/classes/VerticalWatchCardList.ts @@ -1,5 +1,5 @@ import { YTNode, type ObservedArray } from '../helpers.ts'; -import Parser, { type RawNode } from '../index.ts'; +import { Parser, type RawNode } from '../index.ts'; import NavigationEndpoint from './NavigationEndpoint.ts'; import Text from './misc/Text.ts'; diff --git a/deno/src/parser/classes/Video.ts b/deno/src/parser/classes/Video.ts index 369c8ac1..0f0e823c 100644 --- a/deno/src/parser/classes/Video.ts +++ b/deno/src/parser/classes/Video.ts @@ -1,6 +1,6 @@ import { timeToSeconds } from '../../utils/Utils.ts'; import { YTNode, type ObservedArray } from '../helpers.ts'; -import Parser, { type RawNode } from '../index.ts'; +import { Parser, type RawNode } from '../index.ts'; import ExpandableMetadata from './ExpandableMetadata.ts'; import MetadataBadge from './MetadataBadge.ts'; import NavigationEndpoint from './NavigationEndpoint.ts'; diff --git a/deno/src/parser/classes/VideoAttributeView.ts b/deno/src/parser/classes/VideoAttributeView.ts new file mode 100644 index 00000000..b588cb8b --- /dev/null +++ b/deno/src/parser/classes/VideoAttributeView.ts @@ -0,0 +1,49 @@ +import { YTNode } from '../helpers.ts'; +import NavigationEndpoint from './NavigationEndpoint.ts'; + +import ContentPreviewImageView from './ContentPreviewImageView.ts'; +import { Parser } from '../index.ts'; + +import type { RawNode } from '../types/index.ts'; +import Thumbnail from './misc/Thumbnail.ts'; + +export default class VideoAttributeView extends YTNode { + static type = 'VideoAttributeView'; + + image: ContentPreviewImageView | { + sources: Thumbnail[]; + } | null; + image_style: string; + title: string; + subtitle: string; + secondary_subtitle: { + content: string + }; + orientation: string; + sizing_rule: string; + overflow_menu_on_tap: NavigationEndpoint; + overflow_menu_a11y_label: string; + + constructor(data: RawNode) { + super(); + // @NOTE: "image" is not a renderer so not sure why we're parsing it as one. Leaving this hack here for now to avoid breaking things. + if (data.image?.sources) { + this.image = { + sources: data.image.sources.map((x: any) => new Thumbnail(x)).sort((a: Thumbnail, b: Thumbnail) => b.width - a.width) + }; + } else { + this.image = Parser.parseItem(data.image, ContentPreviewImageView); + } + + this.image_style = data.imageStyle; + this.title = data.title; + this.subtitle = data.subtitle; + this.secondary_subtitle = { + content: data.secondarySubtitle.content + }; + this.orientation = data.orientation; + this.sizing_rule = data.sizingRule; + this.overflow_menu_on_tap = new NavigationEndpoint(data.overflowMenuOnTap); + this.overflow_menu_a11y_label = data.overflowMenuA11yLabel; + } +} \ No newline at end of file diff --git a/deno/src/parser/classes/VideoDescriptionCourseSection.ts b/deno/src/parser/classes/VideoDescriptionCourseSection.ts index afb67aa1..26794fed 100644 --- a/deno/src/parser/classes/VideoDescriptionCourseSection.ts +++ b/deno/src/parser/classes/VideoDescriptionCourseSection.ts @@ -1,7 +1,7 @@ import type { ObservedArray} from '../helpers.ts'; import { YTNode } from '../helpers.ts'; import type { RawNode } from '../index.ts'; -import Parser from '../index.ts'; +import { Parser } from '../index.ts'; import StructuredDescriptionPlaylistLockup from './StructuredDescriptionPlaylistLockup.ts'; import Text from './misc/Text.ts'; diff --git a/deno/src/parser/classes/VideoDescriptionHeader.ts b/deno/src/parser/classes/VideoDescriptionHeader.ts index 1ac2d41b..93ebba94 100644 --- a/deno/src/parser/classes/VideoDescriptionHeader.ts +++ b/deno/src/parser/classes/VideoDescriptionHeader.ts @@ -1,5 +1,5 @@ import { YTNode, type ObservedArray } from '../helpers.ts'; -import Parser, { type RawNode } from '../index.ts'; +import { Parser, type RawNode } from '../index.ts'; import { Text, Thumbnail } from '../misc.ts'; import Factoid from './Factoid.ts'; import NavigationEndpoint from './NavigationEndpoint.ts'; diff --git a/deno/src/parser/classes/VideoDescriptionInfocardsSection.ts b/deno/src/parser/classes/VideoDescriptionInfocardsSection.ts index 2d21fe28..29181f52 100644 --- a/deno/src/parser/classes/VideoDescriptionInfocardsSection.ts +++ b/deno/src/parser/classes/VideoDescriptionInfocardsSection.ts @@ -1,4 +1,4 @@ -import Parser, { type RawNode } from '../index.ts'; +import { Parser, type RawNode } from '../index.ts'; import { YTNode } from '../helpers.ts'; import Text from './misc/Text.ts'; diff --git a/deno/src/parser/classes/VideoDescriptionMusicSection.ts b/deno/src/parser/classes/VideoDescriptionMusicSection.ts index 75d28299..1ce283fe 100644 --- a/deno/src/parser/classes/VideoDescriptionMusicSection.ts +++ b/deno/src/parser/classes/VideoDescriptionMusicSection.ts @@ -1,5 +1,5 @@ import { YTNode, type ObservedArray } from '../helpers.ts'; -import Parser, { type RawNode } from '../index.ts'; +import { Parser, type RawNode } from '../index.ts'; import { Text } from '../misc.ts'; import CarouselLockup from './CarouselLockup.ts'; diff --git a/deno/src/parser/classes/VideoDescriptionTranscriptSection.ts b/deno/src/parser/classes/VideoDescriptionTranscriptSection.ts index 34254e7d..227d788f 100644 --- a/deno/src/parser/classes/VideoDescriptionTranscriptSection.ts +++ b/deno/src/parser/classes/VideoDescriptionTranscriptSection.ts @@ -1,6 +1,6 @@ import { YTNode } from '../helpers.ts'; import type { RawNode } from '../index.ts'; -import Parser from '../index.ts'; +import { Parser } from '../index.ts'; import { Text } from '../misc.ts'; import Button from './Button.ts'; diff --git a/deno/src/parser/classes/VideoPrimaryInfo.ts b/deno/src/parser/classes/VideoPrimaryInfo.ts index 67e73e3a..0dfe6ef5 100644 --- a/deno/src/parser/classes/VideoPrimaryInfo.ts +++ b/deno/src/parser/classes/VideoPrimaryInfo.ts @@ -1,7 +1,7 @@ import type { ObservedArray } from '../helpers.ts'; import { YTNode } from '../helpers.ts'; import type { RawNode } from '../index.ts'; -import Parser from '../index.ts'; +import { Parser } from '../index.ts'; import MetadataBadge from './MetadataBadge.ts'; import Menu from './menus/Menu.ts'; import Text from './misc/Text.ts'; diff --git a/deno/src/parser/classes/VideoSecondaryInfo.ts b/deno/src/parser/classes/VideoSecondaryInfo.ts index a39e5143..894c4303 100644 --- a/deno/src/parser/classes/VideoSecondaryInfo.ts +++ b/deno/src/parser/classes/VideoSecondaryInfo.ts @@ -1,4 +1,4 @@ -import Parser, { type RawNode } from '../index.ts'; +import { Parser, type RawNode } from '../index.ts'; import Text from './misc/Text.ts'; import Button from './Button.ts'; import VideoOwner from './VideoOwner.ts'; diff --git a/deno/src/parser/classes/ViewCountFactoid.ts b/deno/src/parser/classes/ViewCountFactoid.ts index 8440a64f..2dde7886 100644 --- a/deno/src/parser/classes/ViewCountFactoid.ts +++ b/deno/src/parser/classes/ViewCountFactoid.ts @@ -1,6 +1,6 @@ import { YTNode } from '../helpers.ts'; import type { RawNode } from '../index.ts'; -import Parser from '../index.ts'; +import { Parser } from '../index.ts'; import Factoid from './Factoid.ts'; export default class ViewCountFactoid extends YTNode { diff --git a/deno/src/parser/classes/WatchCardHeroVideo.ts b/deno/src/parser/classes/WatchCardHeroVideo.ts index 4b897351..73b5531b 100644 --- a/deno/src/parser/classes/WatchCardHeroVideo.ts +++ b/deno/src/parser/classes/WatchCardHeroVideo.ts @@ -1,5 +1,5 @@ import { YTNode } from '../helpers.ts'; -import Parser, { type RawNode } from '../index.ts'; +import { Parser, type RawNode } from '../index.ts'; import NavigationEndpoint from './NavigationEndpoint.ts'; export default class WatchCardHeroVideo extends YTNode { diff --git a/deno/src/parser/classes/WatchCardSectionSequence.ts b/deno/src/parser/classes/WatchCardSectionSequence.ts index 7ea807c0..fb13721c 100644 --- a/deno/src/parser/classes/WatchCardSectionSequence.ts +++ b/deno/src/parser/classes/WatchCardSectionSequence.ts @@ -1,6 +1,6 @@ import type { ObservedArray} from '../helpers.ts'; import { YTNode } from '../helpers.ts'; -import Parser, { type RawNode } from '../index.ts'; +import { Parser, type RawNode } from '../index.ts'; export default class WatchCardSectionSequence extends YTNode { static type = 'WatchCardSectionSequence'; diff --git a/deno/src/parser/classes/WatchNextEndScreen.ts b/deno/src/parser/classes/WatchNextEndScreen.ts index bee4bd4a..5b23d72d 100644 --- a/deno/src/parser/classes/WatchNextEndScreen.ts +++ b/deno/src/parser/classes/WatchNextEndScreen.ts @@ -1,5 +1,5 @@ import { YTNode, type ObservedArray } from '../helpers.ts'; -import Parser, { type RawNode } from '../index.ts'; +import { Parser, type RawNode } from '../index.ts'; import EndScreenPlaylist from './EndScreenPlaylist.ts'; import EndScreenVideo from './EndScreenVideo.ts'; import Text from './misc/Text.ts'; diff --git a/deno/src/parser/classes/actions/AppendContinuationItemsAction.ts b/deno/src/parser/classes/actions/AppendContinuationItemsAction.ts index 3b4eb119..98e13a5b 100644 --- a/deno/src/parser/classes/actions/AppendContinuationItemsAction.ts +++ b/deno/src/parser/classes/actions/AppendContinuationItemsAction.ts @@ -1,4 +1,4 @@ -import Parser from '../../index.ts'; +import { Parser } from '../../index.ts'; import type { RawNode } from '../../index.ts'; import type { ObservedArray } from '../../helpers.ts'; import { YTNode } from '../../helpers.ts'; diff --git a/deno/src/parser/classes/actions/OpenPopupAction.ts b/deno/src/parser/classes/actions/OpenPopupAction.ts index 23929cb2..dd5c6ba7 100644 --- a/deno/src/parser/classes/actions/OpenPopupAction.ts +++ b/deno/src/parser/classes/actions/OpenPopupAction.ts @@ -1,4 +1,4 @@ -import Parser from '../../index.ts'; +import { Parser } from '../../index.ts'; import { YTNode } from '../../helpers.ts'; import type { RawNode } from '../../index.ts'; diff --git a/deno/src/parser/classes/actions/UpdateEngagementPanelAction.ts b/deno/src/parser/classes/actions/UpdateEngagementPanelAction.ts index 44848394..ccc21974 100644 --- a/deno/src/parser/classes/actions/UpdateEngagementPanelAction.ts +++ b/deno/src/parser/classes/actions/UpdateEngagementPanelAction.ts @@ -1,6 +1,6 @@ import { YTNode } from '../../helpers.ts'; import type { RawNode } from '../../index.ts'; -import Parser from '../../index.ts'; +import { Parser } from '../../index.ts'; import Transcript from '../Transcript.ts'; export default class UpdateEngagementPanelAction extends YTNode { diff --git a/deno/src/parser/classes/comments/Comment.ts b/deno/src/parser/classes/comments/Comment.ts index 779a9a65..c7ad07ee 100644 --- a/deno/src/parser/classes/comments/Comment.ts +++ b/deno/src/parser/classes/comments/Comment.ts @@ -1,4 +1,4 @@ -import Parser from '../../index.ts'; +import { Parser } from '../../index.ts'; import Author from '../misc/Author.ts'; import Text from '../misc/Text.ts'; diff --git a/deno/src/parser/classes/comments/CommentActionButtons.ts b/deno/src/parser/classes/comments/CommentActionButtons.ts index 7dd83fbf..ba7eb553 100644 --- a/deno/src/parser/classes/comments/CommentActionButtons.ts +++ b/deno/src/parser/classes/comments/CommentActionButtons.ts @@ -1,4 +1,4 @@ -import Parser from '../../index.ts'; +import { Parser } from '../../index.ts'; import Button from '../Button.ts'; import ToggleButton from '../ToggleButton.ts'; import CreatorHeart from './CreatorHeart.ts'; diff --git a/deno/src/parser/classes/comments/CommentDialog.ts b/deno/src/parser/classes/comments/CommentDialog.ts index 8aa07827..4af62300 100644 --- a/deno/src/parser/classes/comments/CommentDialog.ts +++ b/deno/src/parser/classes/comments/CommentDialog.ts @@ -1,4 +1,4 @@ -import Parser from '../../index.ts'; +import { Parser } from '../../index.ts'; import Button from '../Button.ts'; import Text from '../misc/Text.ts'; import Thumbnail from '../misc/Thumbnail.ts'; diff --git a/deno/src/parser/classes/comments/CommentReplies.ts b/deno/src/parser/classes/comments/CommentReplies.ts index f465e803..8fab7b65 100644 --- a/deno/src/parser/classes/comments/CommentReplies.ts +++ b/deno/src/parser/classes/comments/CommentReplies.ts @@ -1,4 +1,4 @@ -import Parser from '../../index.ts'; +import { Parser } from '../../index.ts'; import Button from '../Button.ts'; import Thumbnail from '../misc/Thumbnail.ts'; diff --git a/deno/src/parser/classes/comments/CommentReplyDialog.ts b/deno/src/parser/classes/comments/CommentReplyDialog.ts index 05958bb7..1ea5ec85 100644 --- a/deno/src/parser/classes/comments/CommentReplyDialog.ts +++ b/deno/src/parser/classes/comments/CommentReplyDialog.ts @@ -1,4 +1,4 @@ -import Parser from '../../index.ts'; +import { Parser } from '../../index.ts'; import Button from '../Button.ts'; import Text from '../misc/Text.ts'; import Thumbnail from '../misc/Thumbnail.ts'; diff --git a/deno/src/parser/classes/comments/CommentSimplebox.ts b/deno/src/parser/classes/comments/CommentSimplebox.ts index a4b2da9b..680c4ac1 100644 --- a/deno/src/parser/classes/comments/CommentSimplebox.ts +++ b/deno/src/parser/classes/comments/CommentSimplebox.ts @@ -1,4 +1,4 @@ -import Parser from '../../index.ts'; +import { Parser } from '../../index.ts'; import Button from '../Button.ts'; import Text from '../misc/Text.ts'; import Thumbnail from '../misc/Thumbnail.ts'; diff --git a/deno/src/parser/classes/comments/CommentThread.ts b/deno/src/parser/classes/comments/CommentThread.ts index f0c5f98f..5b932761 100644 --- a/deno/src/parser/classes/comments/CommentThread.ts +++ b/deno/src/parser/classes/comments/CommentThread.ts @@ -1,4 +1,4 @@ -import Parser from '../../index.ts'; +import { Parser } from '../../index.ts'; import Button from '../Button.ts'; import ContinuationItem from '../ContinuationItem.ts'; import Comment from './Comment.ts'; diff --git a/deno/src/parser/classes/comments/CommentsHeader.ts b/deno/src/parser/classes/comments/CommentsHeader.ts index 576890ca..580ab3b0 100644 --- a/deno/src/parser/classes/comments/CommentsHeader.ts +++ b/deno/src/parser/classes/comments/CommentsHeader.ts @@ -1,4 +1,4 @@ -import Parser from '../../index.ts'; +import { Parser } from '../../index.ts'; import SortFilterSubMenu from '../SortFilterSubMenu.ts'; import Text from '../misc/Text.ts'; import Thumbnail from '../misc/Thumbnail.ts'; diff --git a/deno/src/parser/classes/comments/EmojiPicker.ts b/deno/src/parser/classes/comments/EmojiPicker.ts index 153a8498..680332be 100644 --- a/deno/src/parser/classes/comments/EmojiPicker.ts +++ b/deno/src/parser/classes/comments/EmojiPicker.ts @@ -1,6 +1,6 @@ import { type ObservedArray, YTNode } from '../../helpers.ts'; import type { RawNode } from '../../index.ts'; -import Parser from '../../index.ts'; +import { Parser } from '../../index.ts'; import Text from '../misc/Text.ts'; export default class EmojiPicker extends YTNode { diff --git a/deno/src/parser/classes/livechat/AddBannerToLiveChatCommand.ts b/deno/src/parser/classes/livechat/AddBannerToLiveChatCommand.ts index 201e6a4b..a8e261ae 100644 --- a/deno/src/parser/classes/livechat/AddBannerToLiveChatCommand.ts +++ b/deno/src/parser/classes/livechat/AddBannerToLiveChatCommand.ts @@ -1,6 +1,6 @@ import { YTNode } from '../../helpers.ts'; import type { RawNode } from '../../index.ts'; -import Parser from '../../index.ts'; +import { Parser } from '../../index.ts'; import LiveChatBanner from './items/LiveChatBanner.ts'; export default class AddBannerToLiveChatCommand extends YTNode { diff --git a/deno/src/parser/classes/livechat/AddChatItemAction.ts b/deno/src/parser/classes/livechat/AddChatItemAction.ts index d00b91a4..77984338 100644 --- a/deno/src/parser/classes/livechat/AddChatItemAction.ts +++ b/deno/src/parser/classes/livechat/AddChatItemAction.ts @@ -1,4 +1,4 @@ -import Parser from '../../index.ts'; +import { Parser } from '../../index.ts'; import { YTNode } from '../../helpers.ts'; import type { RawNode } from '../../index.ts'; diff --git a/deno/src/parser/classes/livechat/AddLiveChatTickerItemAction.ts b/deno/src/parser/classes/livechat/AddLiveChatTickerItemAction.ts index c1123ae9..ed13a566 100644 --- a/deno/src/parser/classes/livechat/AddLiveChatTickerItemAction.ts +++ b/deno/src/parser/classes/livechat/AddLiveChatTickerItemAction.ts @@ -1,4 +1,4 @@ -import Parser from '../../index.ts'; +import { Parser } from '../../index.ts'; import { YTNode } from '../../helpers.ts'; import type { RawNode } from '../../index.ts'; diff --git a/deno/src/parser/classes/livechat/LiveChatActionPanel.ts b/deno/src/parser/classes/livechat/LiveChatActionPanel.ts index e79e976a..56a9c59a 100644 --- a/deno/src/parser/classes/livechat/LiveChatActionPanel.ts +++ b/deno/src/parser/classes/livechat/LiveChatActionPanel.ts @@ -1,4 +1,4 @@ -import Parser from '../../index.ts'; +import { Parser } from '../../index.ts'; import { type SuperParsedResult, YTNode } from '../../helpers.ts'; import type { RawNode } from '../../index.ts'; diff --git a/deno/src/parser/classes/livechat/ReplaceChatItemAction.ts b/deno/src/parser/classes/livechat/ReplaceChatItemAction.ts index 6831be63..104155e8 100644 --- a/deno/src/parser/classes/livechat/ReplaceChatItemAction.ts +++ b/deno/src/parser/classes/livechat/ReplaceChatItemAction.ts @@ -1,4 +1,4 @@ -import Parser from '../../index.ts'; +import { Parser } from '../../index.ts'; import { YTNode } from '../../helpers.ts'; import type { RawNode } from '../../index.ts'; diff --git a/deno/src/parser/classes/livechat/ReplayChatItemAction.ts b/deno/src/parser/classes/livechat/ReplayChatItemAction.ts index 61389b0c..000a4609 100644 --- a/deno/src/parser/classes/livechat/ReplayChatItemAction.ts +++ b/deno/src/parser/classes/livechat/ReplayChatItemAction.ts @@ -1,4 +1,4 @@ -import Parser from '../../index.ts'; +import { Parser } from '../../index.ts'; import { type ObservedArray, YTNode } from '../../helpers.ts'; import type { RawNode } from '../../index.ts'; diff --git a/deno/src/parser/classes/livechat/ShowLiveChatActionPanelAction.ts b/deno/src/parser/classes/livechat/ShowLiveChatActionPanelAction.ts index 1053b129..2d12965b 100644 --- a/deno/src/parser/classes/livechat/ShowLiveChatActionPanelAction.ts +++ b/deno/src/parser/classes/livechat/ShowLiveChatActionPanelAction.ts @@ -1,4 +1,4 @@ -import Parser from '../../index.ts'; +import { Parser } from '../../index.ts'; import LiveChatActionPanel from './LiveChatActionPanel.ts'; import { YTNode } from '../../helpers.ts'; import type { RawNode } from '../../index.ts'; diff --git a/deno/src/parser/classes/livechat/ShowLiveChatDialogAction.ts b/deno/src/parser/classes/livechat/ShowLiveChatDialogAction.ts index b1a5e83c..1a918f36 100644 --- a/deno/src/parser/classes/livechat/ShowLiveChatDialogAction.ts +++ b/deno/src/parser/classes/livechat/ShowLiveChatDialogAction.ts @@ -1,4 +1,4 @@ -import Parser from '../../index.ts'; +import { Parser } from '../../index.ts'; import { YTNode } from '../../helpers.ts'; import type { RawNode } from '../../index.ts'; diff --git a/deno/src/parser/classes/livechat/ShowLiveChatTooltipCommand.ts b/deno/src/parser/classes/livechat/ShowLiveChatTooltipCommand.ts index 509d8975..298b5ef5 100644 --- a/deno/src/parser/classes/livechat/ShowLiveChatTooltipCommand.ts +++ b/deno/src/parser/classes/livechat/ShowLiveChatTooltipCommand.ts @@ -1,4 +1,4 @@ -import Parser from '../../index.ts'; +import { Parser } from '../../index.ts'; import { YTNode } from '../../helpers.ts'; import type { RawNode } from '../../index.ts'; diff --git a/deno/src/parser/classes/livechat/UpdateLiveChatPollAction.ts b/deno/src/parser/classes/livechat/UpdateLiveChatPollAction.ts index 6279be4b..28814d1d 100644 --- a/deno/src/parser/classes/livechat/UpdateLiveChatPollAction.ts +++ b/deno/src/parser/classes/livechat/UpdateLiveChatPollAction.ts @@ -1,4 +1,4 @@ -import Parser from '../../index.ts'; +import { Parser } from '../../index.ts'; import { YTNode } from '../../helpers.ts'; import type { RawNode } from '../../index.ts'; diff --git a/deno/src/parser/classes/livechat/items/LiveChatAutoModMessage.ts b/deno/src/parser/classes/livechat/items/LiveChatAutoModMessage.ts index 96274df3..b4f63c9c 100644 --- a/deno/src/parser/classes/livechat/items/LiveChatAutoModMessage.ts +++ b/deno/src/parser/classes/livechat/items/LiveChatAutoModMessage.ts @@ -1,4 +1,4 @@ -import Parser from '../../../index.ts'; +import { Parser } from '../../../index.ts'; import Button from '../../Button.ts'; import NavigationEndpoint from '../../NavigationEndpoint.ts'; import Text from '../../misc/Text.ts'; diff --git a/deno/src/parser/classes/livechat/items/LiveChatBanner.ts b/deno/src/parser/classes/livechat/items/LiveChatBanner.ts index 7fbb899e..f5e26bcb 100644 --- a/deno/src/parser/classes/livechat/items/LiveChatBanner.ts +++ b/deno/src/parser/classes/livechat/items/LiveChatBanner.ts @@ -1,6 +1,6 @@ import { YTNode } from '../../../helpers.ts'; import type { RawNode } from '../../../index.ts'; -import Parser from '../../../index.ts'; +import { Parser } from '../../../index.ts'; import LiveChatBannerHeader from './LiveChatBannerHeader.ts'; export default class LiveChatBanner extends YTNode { diff --git a/deno/src/parser/classes/livechat/items/LiveChatBannerHeader.ts b/deno/src/parser/classes/livechat/items/LiveChatBannerHeader.ts index 65740cc7..7be370a5 100644 --- a/deno/src/parser/classes/livechat/items/LiveChatBannerHeader.ts +++ b/deno/src/parser/classes/livechat/items/LiveChatBannerHeader.ts @@ -1,6 +1,6 @@ import { YTNode } from '../../../helpers.ts'; import type { RawNode } from '../../../index.ts'; -import Parser from '../../../index.ts'; +import { Parser } from '../../../index.ts'; import Button from '../../Button.ts'; import Text from '../../misc/Text.ts'; diff --git a/deno/src/parser/classes/livechat/items/LiveChatBannerPoll.ts b/deno/src/parser/classes/livechat/items/LiveChatBannerPoll.ts index 9d5ffdf1..d6db3237 100644 --- a/deno/src/parser/classes/livechat/items/LiveChatBannerPoll.ts +++ b/deno/src/parser/classes/livechat/items/LiveChatBannerPoll.ts @@ -1,6 +1,6 @@ import { YTNode } from '../../../helpers.ts'; import type { RawNode } from '../../../index.ts'; -import Parser from '../../../index.ts'; +import { Parser } from '../../../index.ts'; import Button from '../../Button.ts'; import Text from '../../misc/Text.ts'; import Thumbnail from '../../misc/Thumbnail.ts'; diff --git a/deno/src/parser/classes/livechat/items/LiveChatProductItem.ts b/deno/src/parser/classes/livechat/items/LiveChatProductItem.ts index 0eaab0a8..89c9ca0a 100644 --- a/deno/src/parser/classes/livechat/items/LiveChatProductItem.ts +++ b/deno/src/parser/classes/livechat/items/LiveChatProductItem.ts @@ -1,4 +1,4 @@ -import Parser from '../../../index.ts'; +import { Parser } from '../../../index.ts'; import { YTNode } from '../../../helpers.ts'; import type { RawNode } from '../../../index.ts'; diff --git a/deno/src/parser/classes/livechat/items/LiveChatTextMessage.ts b/deno/src/parser/classes/livechat/items/LiveChatTextMessage.ts index b2643998..68209155 100644 --- a/deno/src/parser/classes/livechat/items/LiveChatTextMessage.ts +++ b/deno/src/parser/classes/livechat/items/LiveChatTextMessage.ts @@ -1,6 +1,6 @@ import { type ObservedArray, YTNode } from '../../../helpers.ts'; import type { RawNode } from '../../../index.ts'; -import Parser from '../../../index.ts'; +import { Parser } from '../../../index.ts'; import Button from '../../Button.ts'; import NavigationEndpoint from '../../NavigationEndpoint.ts'; import Author from '../../misc/Author.ts'; diff --git a/deno/src/parser/classes/livechat/items/LiveChatTickerPaidMessageItem.ts b/deno/src/parser/classes/livechat/items/LiveChatTickerPaidMessageItem.ts index b002933b..54f9765c 100644 --- a/deno/src/parser/classes/livechat/items/LiveChatTickerPaidMessageItem.ts +++ b/deno/src/parser/classes/livechat/items/LiveChatTickerPaidMessageItem.ts @@ -1,5 +1,5 @@ import Author from '../../misc/Author.ts'; -import Parser from '../../../index.ts'; +import { Parser } from '../../../index.ts'; import NavigationEndpoint from '../../NavigationEndpoint.ts'; import Text from '../../misc/Text.ts'; diff --git a/deno/src/parser/classes/livechat/items/LiveChatViewerEngagementMessage.ts b/deno/src/parser/classes/livechat/items/LiveChatViewerEngagementMessage.ts index db8fd805..eff63d92 100644 --- a/deno/src/parser/classes/livechat/items/LiveChatViewerEngagementMessage.ts +++ b/deno/src/parser/classes/livechat/items/LiveChatViewerEngagementMessage.ts @@ -1,4 +1,4 @@ -import Parser from '../../../index.ts'; +import { Parser } from '../../../index.ts'; import { LiveChatMessageBase } from './LiveChatTextMessage.ts'; import type { RawNode } from '../../../index.ts'; import type { YTNode } from '../../../helpers.ts'; diff --git a/deno/src/parser/classes/livechat/items/PollHeader.ts b/deno/src/parser/classes/livechat/items/PollHeader.ts index ea116a8c..f527de6f 100644 --- a/deno/src/parser/classes/livechat/items/PollHeader.ts +++ b/deno/src/parser/classes/livechat/items/PollHeader.ts @@ -1,6 +1,6 @@ import { YTNode } from '../../../helpers.ts'; import type { RawNode } from '../../../index.ts'; -import Parser from '../../../index.ts'; +import { Parser } from '../../../index.ts'; import Button from '../../Button.ts'; import Text from '../../misc/Text.ts'; import Thumbnail from '../../misc/Thumbnail.ts'; diff --git a/deno/src/parser/classes/menus/Menu.ts b/deno/src/parser/classes/menus/Menu.ts index 5cb41a51..31ccf1c9 100644 --- a/deno/src/parser/classes/menus/Menu.ts +++ b/deno/src/parser/classes/menus/Menu.ts @@ -1,4 +1,4 @@ -import Parser from '../../index.ts'; +import { Parser } from '../../index.ts'; import type { ObservedArray} from '../../helpers.ts'; import { YTNode } from '../../helpers.ts'; import type { RawNode } from '../../index.ts'; diff --git a/deno/src/parser/classes/menus/MenuPopup.ts b/deno/src/parser/classes/menus/MenuPopup.ts index dceb8145..b301d145 100644 --- a/deno/src/parser/classes/menus/MenuPopup.ts +++ b/deno/src/parser/classes/menus/MenuPopup.ts @@ -1,7 +1,7 @@ import type { ObservedArray} from '../../helpers.ts'; import { YTNode } from '../../helpers.ts'; import type { RawNode } from '../../index.ts'; -import Parser from '../../index.ts'; +import { Parser } from '../../index.ts'; import MenuNavigationItem from './MenuNavigationItem.ts'; import MenuServiceItem from './MenuServiceItem.ts'; diff --git a/deno/src/parser/classes/menus/MultiPageMenu.ts b/deno/src/parser/classes/menus/MultiPageMenu.ts index 457495ee..6b8997b9 100644 --- a/deno/src/parser/classes/menus/MultiPageMenu.ts +++ b/deno/src/parser/classes/menus/MultiPageMenu.ts @@ -1,6 +1,6 @@ import { YTNode, type SuperParsedResult } from '../../helpers.ts'; import type { RawNode } from '../../index.ts'; -import Parser from '../../index.ts'; +import { Parser } from '../../index.ts'; export default class MultiPageMenu extends YTNode { static type = 'MultiPageMenu'; diff --git a/deno/src/parser/classes/menus/MultiPageMenuNotificationSection.ts b/deno/src/parser/classes/menus/MultiPageMenuNotificationSection.ts index 3b748f05..571da5ca 100644 --- a/deno/src/parser/classes/menus/MultiPageMenuNotificationSection.ts +++ b/deno/src/parser/classes/menus/MultiPageMenuNotificationSection.ts @@ -1,4 +1,4 @@ -import Parser from '../../index.ts'; +import { Parser } from '../../index.ts'; import { type SuperParsedResult, YTNode } from '../../helpers.ts'; import type { RawNode } from '../../index.ts'; diff --git a/deno/src/parser/classes/menus/MusicMultiSelectMenu.ts b/deno/src/parser/classes/menus/MusicMultiSelectMenu.ts index 71d8f2ac..2592d6c1 100644 --- a/deno/src/parser/classes/menus/MusicMultiSelectMenu.ts +++ b/deno/src/parser/classes/menus/MusicMultiSelectMenu.ts @@ -1,7 +1,7 @@ import type { ObservedArray} from '../../helpers.ts'; import { YTNode } from '../../helpers.ts'; import type { RawNode } from '../../index.ts'; -import Parser from '../../index.ts'; +import { Parser } from '../../index.ts'; import Text from '../misc/Text.ts'; import MusicMenuItemDivider from './MusicMenuItemDivider.ts'; import MusicMultiSelectMenuItem from './MusicMultiSelectMenuItem.ts'; diff --git a/deno/src/parser/classes/menus/SimpleMenuHeader.ts b/deno/src/parser/classes/menus/SimpleMenuHeader.ts index 39accbce..a4bbff06 100644 --- a/deno/src/parser/classes/menus/SimpleMenuHeader.ts +++ b/deno/src/parser/classes/menus/SimpleMenuHeader.ts @@ -1,7 +1,7 @@ import type { SuperParsedResult} from '../../helpers.ts'; import { YTNode } from '../../helpers.ts'; import type { RawNode } from '../../index.ts'; -import Parser from '../../index.ts'; +import { Parser } from '../../index.ts'; import Text from '../misc/Text.ts'; export default class SimpleMenuHeader extends YTNode { diff --git a/deno/src/parser/classes/misc/Author.ts b/deno/src/parser/classes/misc/Author.ts index f134d0d7..572ebb1f 100644 --- a/deno/src/parser/classes/misc/Author.ts +++ b/deno/src/parser/classes/misc/Author.ts @@ -1,15 +1,13 @@ import * as Constants from '../../../utils/Constants.ts'; -import type { YTNode} from '../../helpers.ts'; +import type { YTNode } from '../../helpers.ts'; import { observe, type ObservedArray } from '../../helpers.ts'; -import Parser, { type RawNode } from '../../index.ts'; +import { Parser, type RawNode } from '../../index.ts'; import type NavigationEndpoint from '../NavigationEndpoint.ts'; import Text from './Text.ts'; import type TextRun from './TextRun.ts'; import Thumbnail from './Thumbnail.ts'; export default class Author { - #nav_text; - id: string; name: string; thumbnails: Thumbnail[]; @@ -21,12 +19,12 @@ export default class Author { url: string; constructor(item: RawNode, badges?: any, thumbs?: any, id?: string) { - this.#nav_text = new Text(item); + const nav_text = new Text(item); - this.id = id || (this.#nav_text?.runs?.[0] as TextRun)?.endpoint?.payload?.browseId || this.#nav_text?.endpoint?.payload?.browseId || 'N/A'; - this.name = this.#nav_text?.text || 'N/A'; + this.id = id || (nav_text?.runs?.[0] as TextRun)?.endpoint?.payload?.browseId || nav_text?.endpoint?.payload?.browseId || 'N/A'; + this.name = nav_text?.text || 'N/A'; this.thumbnails = thumbs ? Thumbnail.fromResponse(thumbs) : []; - this.endpoint = ((this.#nav_text?.runs?.[0] as TextRun) as TextRun)?.endpoint || this.#nav_text?.endpoint; + this.endpoint = ((nav_text?.runs?.[0] as TextRun) as TextRun)?.endpoint || nav_text?.endpoint; this.badges = Array.isArray(badges) ? Parser.parseArray(badges) : observe([] as YTNode[]); this.is_moderator = this.badges?.some((badge: any) => badge.icon_type == 'MODERATOR'); this.is_verified = this.badges?.some((badge: any) => badge.style == 'BADGE_STYLE_TYPE_VERIFIED'); @@ -34,9 +32,9 @@ export default class Author { // @TODO: Refactor this mess. this.url = - (this.#nav_text?.runs?.[0] as TextRun)?.endpoint?.metadata?.api_url === '/browse' && - `${Constants.URLS.YT_BASE}${(this.#nav_text?.runs?.[0] as TextRun)?.endpoint?.payload?.canonicalBaseUrl || `/u/${(this.#nav_text?.runs?.[0] as TextRun)?.endpoint?.payload?.browseId}`}` || - `${Constants.URLS.YT_BASE}${this.#nav_text?.endpoint?.payload?.canonicalBaseUrl || `/u/${this.#nav_text?.endpoint?.payload?.browseId}`}`; + (nav_text?.runs?.[0] as TextRun)?.endpoint?.metadata?.api_url === '/browse' && + `${Constants.URLS.YT_BASE}${(nav_text?.runs?.[0] as TextRun)?.endpoint?.payload?.canonicalBaseUrl || `/u/${(nav_text?.runs?.[0] as TextRun)?.endpoint?.payload?.browseId}`}` || + `${Constants.URLS.YT_BASE}${nav_text?.endpoint?.payload?.canonicalBaseUrl || `/u/${nav_text?.endpoint?.payload?.browseId}`}`; } get best_thumbnail(): Thumbnail | undefined { diff --git a/deno/src/parser/classes/misc/Text.ts b/deno/src/parser/classes/misc/Text.ts index 142a8407..ea0074f2 100644 --- a/deno/src/parser/classes/misc/Text.ts +++ b/deno/src/parser/classes/misc/Text.ts @@ -56,6 +56,10 @@ export default class Text { const content = data.content; const command_runs = data.commandRuns; + // Haven't found an actually useful one yet, but they look like this: + // [ { startIndex: 0, length: 19 } ] (for a string that is 19 characters long) + // Const style_runs = data.styleRuns; + let last_end_index = 0; if (command_runs) { diff --git a/deno/src/parser/classes/ytkids/AnchoredSection.ts b/deno/src/parser/classes/ytkids/AnchoredSection.ts index 2eb9b34e..83fb3496 100644 --- a/deno/src/parser/classes/ytkids/AnchoredSection.ts +++ b/deno/src/parser/classes/ytkids/AnchoredSection.ts @@ -1,6 +1,6 @@ import { YTNode } from '../../helpers.ts'; import type { RawNode } from '../../index.ts'; -import Parser from '../../index.ts'; +import { Parser } from '../../index.ts'; import NavigationEndpoint from '../NavigationEndpoint.ts'; import SectionList from '../SectionList.ts'; diff --git a/deno/src/parser/classes/ytkids/KidsBlocklistPicker.ts b/deno/src/parser/classes/ytkids/KidsBlocklistPicker.ts index 0a00f95d..b10e4a8e 100644 --- a/deno/src/parser/classes/ytkids/KidsBlocklistPicker.ts +++ b/deno/src/parser/classes/ytkids/KidsBlocklistPicker.ts @@ -1,7 +1,7 @@ import Text from '../misc/Text.ts'; import { YTNode } from '../../helpers.ts'; import Button from '../Button.ts'; -import Parser, { type RawNode } from '../../index.ts'; +import { Parser, type RawNode } from '../../index.ts'; import KidsBlocklistPickerItem from './KidsBlocklistPickerItem.ts'; export default class KidsBlocklistPicker extends YTNode { diff --git a/deno/src/parser/classes/ytkids/KidsBlocklistPickerItem.ts b/deno/src/parser/classes/ytkids/KidsBlocklistPickerItem.ts index 99379b5a..c31bd158 100644 --- a/deno/src/parser/classes/ytkids/KidsBlocklistPickerItem.ts +++ b/deno/src/parser/classes/ytkids/KidsBlocklistPickerItem.ts @@ -1,6 +1,6 @@ import Text from '../misc/Text.ts'; import { YTNode } from '../../helpers.ts'; -import Parser, { type RawNode } from '../../index.ts'; +import { Parser, type RawNode } from '../../index.ts'; import ToggleButton from '../ToggleButton.ts'; import Thumbnail from '../misc/Thumbnail.ts'; import type Actions from '../../../core/Actions.ts'; diff --git a/deno/src/parser/classes/ytkids/KidsCategoriesHeader.ts b/deno/src/parser/classes/ytkids/KidsCategoriesHeader.ts index afb03865..24f4a4b7 100644 --- a/deno/src/parser/classes/ytkids/KidsCategoriesHeader.ts +++ b/deno/src/parser/classes/ytkids/KidsCategoriesHeader.ts @@ -1,4 +1,4 @@ -import Parser from '../../index.ts'; +import { Parser } from '../../index.ts'; import Button from '../Button.ts'; import KidsCategoryTab from './KidsCategoryTab.ts'; import { type ObservedArray, YTNode } from '../../helpers.ts'; diff --git a/deno/src/parser/classes/ytkids/KidsHomeScreen.ts b/deno/src/parser/classes/ytkids/KidsHomeScreen.ts index a9ba4f3b..8e9b1fed 100644 --- a/deno/src/parser/classes/ytkids/KidsHomeScreen.ts +++ b/deno/src/parser/classes/ytkids/KidsHomeScreen.ts @@ -1,4 +1,4 @@ -import Parser from '../../index.ts'; +import { Parser } from '../../index.ts'; import AnchoredSection from './AnchoredSection.ts'; import { type ObservedArray, YTNode } from '../../helpers.ts'; import type { RawNode } from '../../index.ts'; diff --git a/deno/src/parser/continuations.ts b/deno/src/parser/continuations.ts index fbdabbf8..2d04d1b8 100644 --- a/deno/src/parser/continuations.ts +++ b/deno/src/parser/continuations.ts @@ -1,4 +1,4 @@ -import type { ObservedArray} from './helpers.ts'; +import type { ObservedArray } from './helpers.ts'; import { YTNode, observe } from './helpers.ts'; import type { RawNode } from './index.ts'; import { Thumbnail } from './misc.ts'; @@ -209,3 +209,16 @@ export class LiveChatContinuation extends YTNode { this.viewer_name = data.viewerName; } } + +export class ContinuationCommand extends YTNode { + static readonly type = 'ContinuationCommand'; + + request: string; + token: string; + + constructor(data: RawNode) { + super(); + this.request = data.request; + this.token = data.token; + } +} \ No newline at end of file diff --git a/deno/src/parser/index.ts b/deno/src/parser/index.ts index 0fcb2cb6..894e40ad 100644 --- a/deno/src/parser/index.ts +++ b/deno/src/parser/index.ts @@ -6,7 +6,6 @@ export * as YTNodes from './nodes.ts'; export * as YT from './youtube/index.ts'; export * as YTMusic from './ytmusic/index.ts'; export * as YTKids from './ytkids/index.ts'; +export * as YTShorts from './ytshorts/index.ts'; export * as Helpers from './helpers.ts'; -export * as Generator from './generator.ts'; -import * as Parser from './parser.ts'; -export default Parser; \ No newline at end of file +export * as Generator from './generator.ts'; \ No newline at end of file diff --git a/deno/src/parser/nodes.ts b/deno/src/parser/nodes.ts index 1081ec70..d665c488 100644 --- a/deno/src/parser/nodes.ts +++ b/deno/src/parser/nodes.ts @@ -1,6 +1,8 @@ // This file was auto generated, do not edit. // See ./scripts/build-parser-map.js +export { default as AboutChannel } from './classes/AboutChannel.ts'; +export { default as AboutChannelView } from './classes/AboutChannelView.ts'; export { default as AccountChannel } from './classes/AccountChannel.ts'; export { default as AccountItemSection } from './classes/AccountItemSection.ts'; export { default as AccountItemSectionHeader } from './classes/AccountItemSectionHeader.ts'; @@ -26,6 +28,7 @@ export { default as BackstagePostThread } from './classes/BackstagePostThread.ts export { default as BrowseFeedActions } from './classes/BrowseFeedActions.ts'; export { default as BrowserMediaSession } from './classes/BrowserMediaSession.ts'; export { default as Button } from './classes/Button.ts'; +export { default as ButtonView } from './classes/ButtonView.ts'; export { default as C4TabbedHeader } from './classes/C4TabbedHeader.ts'; export { default as CallToActionButton } from './classes/CallToActionButton.ts'; export { default as Card } from './classes/Card.ts'; @@ -36,21 +39,30 @@ export { default as CarouselLockup } from './classes/CarouselLockup.ts'; export { default as Channel } from './classes/Channel.ts'; export { default as ChannelAboutFullMetadata } from './classes/ChannelAboutFullMetadata.ts'; export { default as ChannelAgeGate } from './classes/ChannelAgeGate.ts'; +export { default as ChannelExternalLinkView } from './classes/ChannelExternalLinkView.ts'; export { default as ChannelFeaturedContent } from './classes/ChannelFeaturedContent.ts'; export { default as ChannelHeaderLinks } from './classes/ChannelHeaderLinks.ts'; export { default as ChannelHeaderLinksView } from './classes/ChannelHeaderLinksView.ts'; export { default as ChannelMetadata } from './classes/ChannelMetadata.ts'; export { default as ChannelMobileHeader } from './classes/ChannelMobileHeader.ts'; export { default as ChannelOptions } from './classes/ChannelOptions.ts'; +export { default as ChannelOwnerEmptyState } from './classes/ChannelOwnerEmptyState.ts'; export { default as ChannelSubMenu } from './classes/ChannelSubMenu.ts'; +export { default as ChannelTagline } from './classes/ChannelTagline.ts'; export { default as ChannelThumbnailWithLink } from './classes/ChannelThumbnailWithLink.ts'; export { default as ChannelVideoPlayer } from './classes/ChannelVideoPlayer.ts'; export { default as Chapter } from './classes/Chapter.ts'; export { default as ChildVideo } from './classes/ChildVideo.ts'; export { default as ChipCloud } from './classes/ChipCloud.ts'; export { default as ChipCloudChip } from './classes/ChipCloudChip.ts'; +export { default as ClipAdState } from './classes/ClipAdState.ts'; +export { default as ClipCreation } from './classes/ClipCreation.ts'; +export { default as ClipCreationScrubber } from './classes/ClipCreationScrubber.ts'; +export { default as ClipCreationTextInput } from './classes/ClipCreationTextInput.ts'; +export { default as ClipSection } from './classes/ClipSection.ts'; export { default as CollaboratorInfoCardContent } from './classes/CollaboratorInfoCardContent.ts'; export { default as CollageHeroImage } from './classes/CollageHeroImage.ts'; +export { default as Command } from './classes/Command.ts'; export { default as AuthorCommentBadge } from './classes/comments/AuthorCommentBadge.ts'; export { default as Comment } from './classes/comments/Comment.ts'; export { default as CommentActionButtons } from './classes/comments/CommentActionButtons.ts'; @@ -75,6 +87,7 @@ export { default as CompactPlaylist } from './classes/CompactPlaylist.ts'; export { default as CompactStation } from './classes/CompactStation.ts'; export { default as CompactVideo } from './classes/CompactVideo.ts'; export { default as ConfirmDialog } from './classes/ConfirmDialog.ts'; +export { default as ContentMetadataView } from './classes/ContentMetadataView.ts'; export { default as ContentPreviewImageView } from './classes/ContentPreviewImageView.ts'; export { default as ContinuationItem } from './classes/ContinuationItem.ts'; export { default as ConversationBar } from './classes/ConversationBar.ts'; @@ -105,7 +118,9 @@ export { default as ExpandedShelfContents } from './classes/ExpandedShelfContent export { default as Factoid } from './classes/Factoid.ts'; export { default as FancyDismissibleDialog } from './classes/FancyDismissibleDialog.ts'; export { default as FeedFilterChipBar } from './classes/FeedFilterChipBar.ts'; +export { default as FeedNudge } from './classes/FeedNudge.ts'; export { default as FeedTabbedHeader } from './classes/FeedTabbedHeader.ts'; +export { default as FlexibleActionsView } from './classes/FlexibleActionsView.ts'; export { default as GameCard } from './classes/GameCard.ts'; export { default as GameDetails } from './classes/GameDetails.ts'; export { default as Grid } from './classes/Grid.ts'; @@ -250,6 +265,7 @@ export { default as Notification } from './classes/Notification.ts'; export { default as PageHeader } from './classes/PageHeader.ts'; export { default as PageHeaderView } from './classes/PageHeaderView.ts'; export { default as PageIntroduction } from './classes/PageIntroduction.ts'; +export { default as PivotButton } from './classes/PivotButton.ts'; export { default as PlayerAnnotationsExpanded } from './classes/PlayerAnnotationsExpanded.ts'; export { default as PlayerCaptionsTracklist } from './classes/PlayerCaptionsTracklist.ts'; export { default as PlayerControlsOverlay } from './classes/PlayerControlsOverlay.ts'; @@ -289,6 +305,8 @@ export { default as ProfileColumnUserInfo } from './classes/ProfileColumnUserInf export { default as Quiz } from './classes/Quiz.ts'; export { default as RecognitionShelf } from './classes/RecognitionShelf.ts'; export { default as ReelItem } from './classes/ReelItem.ts'; +export { default as ReelPlayerHeader } from './classes/ReelPlayerHeader.ts'; +export { default as ReelPlayerOverlay } from './classes/ReelPlayerOverlay.ts'; export { default as ReelShelf } from './classes/ReelShelf.ts'; export { default as RelatedChipCloud } from './classes/RelatedChipCloud.ts'; export { default as RichGrid } from './classes/RichGrid.ts'; @@ -374,6 +392,7 @@ export { default as UpsellDialog } from './classes/UpsellDialog.ts'; export { default as VerticalList } from './classes/VerticalList.ts'; export { default as VerticalWatchCardList } from './classes/VerticalWatchCardList.ts'; export { default as Video } from './classes/Video.ts'; +export { default as VideoAttributeView } from './classes/VideoAttributeView.ts'; export { default as VideoCard } from './classes/VideoCard.ts'; export { default as VideoDescriptionCourseSection } from './classes/VideoDescriptionCourseSection.ts'; export { default as VideoDescriptionHeader } from './classes/VideoDescriptionHeader.ts'; diff --git a/deno/src/parser/parser.ts b/deno/src/parser/parser.ts index 572383cc..3d55bebd 100644 --- a/deno/src/parser/parser.ts +++ b/deno/src/parser/parser.ts @@ -27,7 +27,7 @@ import { Continuation, ItemSectionContinuation, SectionListContinuation, LiveChatContinuation, MusicPlaylistShelfContinuation, MusicShelfContinuation, GridContinuation, PlaylistPanelContinuation, NavigateAction, ShowMiniplayerCommand, - ReloadContinuationItemsCommand + ReloadContinuationItemsCommand, ContinuationCommand } from './continuations.ts'; export type ParserError = { @@ -304,6 +304,14 @@ export function parseResponse(data: } _clearMemo(); + _createMemo(); + const entries = parse(data.entries); + if (entries) { + parsed_data.entries = entries; + parsed_data.entries_memo = _getMemo(); + } + _clearMemo(); + applyMutations(contents_memo, data.frameworkUpdates?.entityBatchUpdate?.mutations); const continuation = data.continuation ? parseC(data.continuation) : null; @@ -311,6 +319,11 @@ export function parseResponse(data: parsed_data.continuation = continuation; } + const continuationEndpoint = data.continuationEndpoint ? parseLC(data.continuationEndpoint) : null; + if (continuationEndpoint) { + parsed_data.continuationEndpoint = continuationEndpoint; + } + const metadata = parse(data.metadata); if (metadata) { parsed_data.metadata = metadata; @@ -577,6 +590,8 @@ export function parseLC(data: RawNode) { return new GridContinuation(data.gridContinuation); if (data.playlistPanelContinuation) return new PlaylistPanelContinuation(data.playlistPanelContinuation); + if (data.continuationCommand) + return new ContinuationCommand(data.continuationCommand); return null; } diff --git a/deno/src/parser/types/ParsedResponse.ts b/deno/src/parser/types/ParsedResponse.ts index e12429fb..675b13af 100644 --- a/deno/src/parser/types/ParsedResponse.ts +++ b/deno/src/parser/types/ParsedResponse.ts @@ -3,7 +3,7 @@ import type { Memo, ObservedArray, SuperParsedResult, YTNode } from '../helpers. import type { ReloadContinuationItemsCommand, Continuation, GridContinuation, ItemSectionContinuation, LiveChatContinuation, MusicPlaylistShelfContinuation, MusicShelfContinuation, - PlaylistPanelContinuation, SectionListContinuation + PlaylistPanelContinuation, SectionListContinuation, ContinuationCommand } from '../index.ts'; import type PlayerCaptionsTracklist from '../classes/PlayerCaptionsTracklist.ts'; @@ -41,7 +41,7 @@ export interface IParsedResponse { on_response_received_commands_memo?: Memo; continuation?: Continuation; continuation_contents?: ItemSectionContinuation | SectionListContinuation | LiveChatContinuation | MusicPlaylistShelfContinuation | - MusicShelfContinuation | GridContinuation | PlaylistPanelContinuation; + MusicShelfContinuation | GridContinuation | PlaylistPanelContinuation | ContinuationCommand; continuation_contents_memo?: Memo; metadata?: SuperParsedResult; microformat?: YTNode; @@ -66,6 +66,9 @@ export interface IParsedResponse { cards?: CardCollection; engagement_panels?: ObservedArray; items?: SuperParsedResult; + entries?: SuperParsedResult; + entries_memo?: Memo; + continuationEndpoint?: YTNode; } export interface IStreamingData { diff --git a/deno/src/parser/youtube/AccountInfo.ts b/deno/src/parser/youtube/AccountInfo.ts index 3623aad2..833fcfd3 100644 --- a/deno/src/parser/youtube/AccountInfo.ts +++ b/deno/src/parser/youtube/AccountInfo.ts @@ -1,4 +1,4 @@ -import Parser from '../index.ts'; +import { Parser } from '../index.ts'; import type { ApiResponse } from '../../core/Actions.ts'; import type { IParsedResponse } from '../types/ParsedResponse.ts'; diff --git a/deno/src/parser/youtube/Analytics.ts b/deno/src/parser/youtube/Analytics.ts index 99cca15c..2b13f1e1 100644 --- a/deno/src/parser/youtube/Analytics.ts +++ b/deno/src/parser/youtube/Analytics.ts @@ -1,4 +1,4 @@ -import Parser from '../index.ts'; +import { Parser } from '../index.ts'; import Element from '../classes/Element.ts'; import type { ApiResponse } from '../../core/Actions.ts'; import type { IBrowseResponse } from '../types/ParsedResponse.ts'; diff --git a/deno/src/parser/youtube/Channel.ts b/deno/src/parser/youtube/Channel.ts index f0ab8c05..a903016d 100644 --- a/deno/src/parser/youtube/Channel.ts +++ b/deno/src/parser/youtube/Channel.ts @@ -2,6 +2,7 @@ import TabbedFeed from '../../core/mixins/TabbedFeed.ts'; import C4TabbedHeader from '../classes/C4TabbedHeader.ts'; import CarouselHeader from '../classes/CarouselHeader.ts'; import ChannelAboutFullMetadata from '../classes/ChannelAboutFullMetadata.ts'; +import AboutChannel from '../classes/AboutChannel.ts'; import ChannelMetadata from '../classes/ChannelMetadata.ts'; import InteractiveTabbedHeader from '../classes/InteractiveTabbedHeader.ts'; import MicroformatData from '../classes/MicroformatData.ts'; @@ -18,6 +19,8 @@ import ChipCloudChip from '../classes/ChipCloudChip.ts'; import FeedFilterChipBar from '../classes/FeedFilterChipBar.ts'; import ChannelSubMenu from '../classes/ChannelSubMenu.ts'; import SortFilterSubMenu from '../classes/SortFilterSubMenu.ts'; +import ContinuationItem from '../classes/ContinuationItem.ts'; +import NavigationEndpoint from '../classes/NavigationEndpoint.ts'; import { ChannelError, InnertubeError } from '../../utils/Utils.ts'; @@ -185,18 +188,39 @@ export default class Channel extends TabbedFeed { return new Channel(this.actions, tab.page, true); } - async getChannels(): Promise { - const tab = await this.getTabByURL('channels'); - return new Channel(this.actions, tab.page, true); - } - /** * Retrieves the about page. * Note that this does not return a new {@link Channel} object. */ - async getAbout(): Promise { - const tab = await this.getTabByURL('about'); - return tab.memo.getType(ChannelAboutFullMetadata)?.[0]; + async getAbout(): Promise { + if (this.hasTabWithURL('about')) { + const tab = await this.getTabByURL('about'); + return tab.memo.getType(ChannelAboutFullMetadata)[0]; + } else if (this.header?.is(C4TabbedHeader) && this.header.tagline) { + + if (this.header.tagline.more_endpoint instanceof NavigationEndpoint) { + const response = await this.header.tagline.more_endpoint.call(this.actions); + + const tab = new TabbedFeed(this.actions, response, false); + return tab.memo.getType(ChannelAboutFullMetadata)[0]; + } + + const endpoint = this.page.header_memo?.getType(ContinuationItem)[0]?.endpoint; + + if (!endpoint) { + throw new InnertubeError('Failed to extract continuation to get channel about'); + } + + const response = await endpoint.call(this.actions, { parse: true }); + + if (!response.on_response_received_endpoints_memo) { + throw new InnertubeError('Unexpected response while fetching channel about', { response }); + } + + return response.on_response_received_endpoints_memo.getType(AboutChannel)[0]; + } + + throw new InnertubeError('About not found'); } /** @@ -245,12 +269,9 @@ export default class Channel extends TabbedFeed { return this.hasTabWithURL('community'); } - get has_channels(): boolean { - return this.hasTabWithURL('channels'); - } - get has_about(): boolean { - return this.hasTabWithURL('about'); + // Game topic channels still have an about tab, user channels have switched to the popup + return this.hasTabWithURL('about') || !!(this.header?.is(C4TabbedHeader) && this.header.tagline?.more_endpoint); } get has_search(): boolean { diff --git a/deno/src/parser/youtube/Comments.ts b/deno/src/parser/youtube/Comments.ts index f06205fd..ecaae8a9 100644 --- a/deno/src/parser/youtube/Comments.ts +++ b/deno/src/parser/youtube/Comments.ts @@ -1,4 +1,4 @@ -import Parser from '../index.ts'; +import { Parser } from '../index.ts'; import type Actions from '../../core/Actions.ts'; import type { ApiResponse } from '../../core/Actions.ts'; import { InnertubeError } from '../../utils/Utils.ts'; diff --git a/deno/src/parser/youtube/Library.ts b/deno/src/parser/youtube/Library.ts index 54a99cf8..5e5ed3bc 100644 --- a/deno/src/parser/youtube/Library.ts +++ b/deno/src/parser/youtube/Library.ts @@ -7,19 +7,13 @@ import Playlist from './Playlist.ts'; import Menu from '../classes/menus/Menu.ts'; import Shelf from '../classes/Shelf.ts'; import Button from '../classes/Button.ts'; - -import ProfileColumnStats from '../classes/ProfileColumnStats.ts'; -import ProfileColumnUserInfo from '../classes/ProfileColumnUserInfo.ts'; +import PageHeader from '../classes/PageHeader.ts'; import type { IBrowseResponse } from '../types/ParsedResponse.ts'; import type { ApiResponse } from '../../core/Actions.ts'; class Library extends Feed { - profile: { - stats?: ProfileColumnStats; - user_info?: ProfileColumnUserInfo; - }; - + header: PageHeader | null; sections; constructor(actions: Actions, data: ApiResponse | IBrowseResponse) { @@ -28,10 +22,7 @@ class Library extends Feed { if (!this.page.contents_memo) throw new InnertubeError('Page contents not found'); - const stats = this.page.contents_memo.getType(ProfileColumnStats).first(); - const user_info = this.page.contents_memo.getType(ProfileColumnUserInfo).first(); - - this.profile = { stats, user_info }; + this.header = this.memo.getType(PageHeader).first(); const shelves = this.page.contents_memo.getType(Shelf); diff --git a/deno/src/parser/youtube/LiveChat.ts b/deno/src/parser/youtube/LiveChat.ts index 5c4a9366..84a035c6 100644 --- a/deno/src/parser/youtube/LiveChat.ts +++ b/deno/src/parser/youtube/LiveChat.ts @@ -1,5 +1,5 @@ import EventEmitter from '../../utils/EventEmitterLike.ts'; -import Parser, { LiveChatContinuation } from '../index.ts'; +import { Parser, LiveChatContinuation } from '../index.ts'; import type VideoInfo from './VideoInfo.ts'; import SmoothedQueue from './SmoothedQueue.ts'; diff --git a/deno/src/parser/youtube/NotificationsMenu.ts b/deno/src/parser/youtube/NotificationsMenu.ts index 9518b026..5095e688 100644 --- a/deno/src/parser/youtube/NotificationsMenu.ts +++ b/deno/src/parser/youtube/NotificationsMenu.ts @@ -1,4 +1,4 @@ -import Parser from '../index.ts'; +import { Parser } from '../index.ts'; import ContinuationItem from '../classes/ContinuationItem.ts'; import SimpleMenuHeader from '../classes/menus/SimpleMenuHeader.ts'; diff --git a/deno/src/parser/youtube/Settings.ts b/deno/src/parser/youtube/Settings.ts index a027d9f4..8d6bb953 100644 --- a/deno/src/parser/youtube/Settings.ts +++ b/deno/src/parser/youtube/Settings.ts @@ -1,4 +1,4 @@ -import Parser from '../index.ts'; +import { Parser } from '../index.ts'; import { InnertubeError } from '../../utils/Utils.ts'; import CompactLink from '../classes/CompactLink.ts'; diff --git a/deno/src/parser/youtube/TimeWatched.ts b/deno/src/parser/youtube/TimeWatched.ts index 0411754b..cf38cf57 100644 --- a/deno/src/parser/youtube/TimeWatched.ts +++ b/deno/src/parser/youtube/TimeWatched.ts @@ -1,4 +1,4 @@ -import Parser from '../index.ts'; +import { Parser } from '../index.ts'; import ItemSection from '../classes/ItemSection.ts'; import SectionList from '../classes/SectionList.ts'; import SingleColumnBrowseResults from '../classes/SingleColumnBrowseResults.ts'; diff --git a/deno/src/parser/youtube/TranscriptInfo.ts b/deno/src/parser/youtube/TranscriptInfo.ts index a9054e6a..574586e3 100644 --- a/deno/src/parser/youtube/TranscriptInfo.ts +++ b/deno/src/parser/youtube/TranscriptInfo.ts @@ -1,7 +1,7 @@ import type Actions from '../../core/Actions.ts'; import { type ApiResponse } from '../../core/Actions.ts'; import type { IGetTranscriptResponse } from '../index.ts'; -import Parser from '../index.ts'; +import { Parser } from '../index.ts'; import Transcript from '../classes/Transcript.ts'; export default class TranscriptInfo { diff --git a/deno/src/parser/ytmusic/Album.ts b/deno/src/parser/ytmusic/Album.ts index 474ea41c..4d8dfa67 100644 --- a/deno/src/parser/ytmusic/Album.ts +++ b/deno/src/parser/ytmusic/Album.ts @@ -1,6 +1,6 @@ import type { ApiResponse } from '../../core/Actions.ts'; import type { ObservedArray } from '../helpers.ts'; -import Parser from '../index.ts'; +import { Parser } from '../index.ts'; import MicroformatData from '../classes/MicroformatData.ts'; import MusicCarouselShelf from '../classes/MusicCarouselShelf.ts'; diff --git a/deno/src/parser/ytmusic/Artist.ts b/deno/src/parser/ytmusic/Artist.ts index 3a0ef8d0..fed9da71 100644 --- a/deno/src/parser/ytmusic/Artist.ts +++ b/deno/src/parser/ytmusic/Artist.ts @@ -1,4 +1,4 @@ -import Parser from '../index.ts'; +import { Parser } from '../index.ts'; import type Actions from '../../core/Actions.ts'; import type { ApiResponse } from '../../core/Actions.ts'; import { InnertubeError } from '../../utils/Utils.ts'; diff --git a/deno/src/parser/ytmusic/Explore.ts b/deno/src/parser/ytmusic/Explore.ts index cf468a42..df4d5c02 100644 --- a/deno/src/parser/ytmusic/Explore.ts +++ b/deno/src/parser/ytmusic/Explore.ts @@ -1,4 +1,4 @@ -import Parser from '../index.ts'; +import { Parser } from '../index.ts'; import Grid from '../classes/Grid.ts'; import MusicCarouselShelf from '../classes/MusicCarouselShelf.ts'; diff --git a/deno/src/parser/ytmusic/HomeFeed.ts b/deno/src/parser/ytmusic/HomeFeed.ts index 817802d2..45dc0dad 100644 --- a/deno/src/parser/ytmusic/HomeFeed.ts +++ b/deno/src/parser/ytmusic/HomeFeed.ts @@ -1,4 +1,4 @@ -import Parser, { SectionListContinuation } from '../index.ts'; +import { Parser, SectionListContinuation } from '../index.ts'; import MusicCarouselShelf from '../classes/MusicCarouselShelf.ts'; import SectionList from '../classes/SectionList.ts'; import SingleColumnBrowseResults from '../classes/SingleColumnBrowseResults.ts'; diff --git a/deno/src/parser/ytmusic/Library.ts b/deno/src/parser/ytmusic/Library.ts index 5fd2c1d3..88d4cc70 100644 --- a/deno/src/parser/ytmusic/Library.ts +++ b/deno/src/parser/ytmusic/Library.ts @@ -1,4 +1,4 @@ -import Parser, { GridContinuation, MusicShelfContinuation, SectionListContinuation } from '../index.ts'; +import { Parser, GridContinuation, MusicShelfContinuation, SectionListContinuation } from '../index.ts'; import type Actions from '../../core/Actions.ts'; import type { ApiResponse } from '../../core/Actions.ts'; diff --git a/deno/src/parser/ytmusic/Playlist.ts b/deno/src/parser/ytmusic/Playlist.ts index 410e384b..c4d4918d 100644 --- a/deno/src/parser/ytmusic/Playlist.ts +++ b/deno/src/parser/ytmusic/Playlist.ts @@ -1,4 +1,4 @@ -import Parser, { MusicPlaylistShelfContinuation, SectionListContinuation } from '../index.ts'; +import { Parser, MusicPlaylistShelfContinuation, SectionListContinuation } from '../index.ts'; import MusicCarouselShelf from '../classes/MusicCarouselShelf.ts'; import MusicDetailHeader from '../classes/MusicDetailHeader.ts'; diff --git a/deno/src/parser/ytmusic/Recap.ts b/deno/src/parser/ytmusic/Recap.ts index d12769ce..a509feb7 100644 --- a/deno/src/parser/ytmusic/Recap.ts +++ b/deno/src/parser/ytmusic/Recap.ts @@ -1,4 +1,4 @@ -import Parser from '../index.ts'; +import { Parser } from '../index.ts'; import type Actions from '../../core/Actions.ts'; import type { ApiResponse } from '../../core/Actions.ts'; diff --git a/deno/src/parser/ytmusic/Search.ts b/deno/src/parser/ytmusic/Search.ts index 7e902970..ab729c77 100644 --- a/deno/src/parser/ytmusic/Search.ts +++ b/deno/src/parser/ytmusic/Search.ts @@ -1,6 +1,6 @@ import type Actions from '../../core/Actions.ts'; import { InnertubeError } from '../../utils/Utils.ts'; -import Parser, { MusicShelfContinuation } from '../index.ts'; +import { Parser, MusicShelfContinuation } from '../index.ts'; import ChipCloud from '../classes/ChipCloud.ts'; import ChipCloudChip from '../classes/ChipCloudChip.ts'; diff --git a/deno/src/parser/ytshorts/VideoInfo.ts b/deno/src/parser/ytshorts/VideoInfo.ts new file mode 100644 index 00000000..e64ae118 --- /dev/null +++ b/deno/src/parser/ytshorts/VideoInfo.ts @@ -0,0 +1,58 @@ +import type NavigationEndpoint from '../classes/NavigationEndpoint.ts'; +import type PlayerOverlay from '../classes/PlayerOverlay.ts'; +import type Actions from '../../core/Actions.ts'; +import type { ApiResponse } from '../../core/Actions.ts'; +import type { ObservedArray, YTNode } from '../helpers.ts'; +import { Parser, ContinuationCommand } from '../index.ts'; +import { InnertubeError } from '../../utils/Utils.ts'; +import { + Reel +} from '../../core/endpoints/index.ts'; + +class VideoInfo { + #watch_next_continuation?: ContinuationCommand; + #actions: Actions; + + basic_info; + watch_next_feed?: ObservedArray; + current_video_endpoint?: NavigationEndpoint; + player_overlays?: PlayerOverlay; + + constructor(data: [ApiResponse, ApiResponse], actions: Actions) { + this.#actions = actions; + + const info = Parser.parseResponse(data[0].data); + + const watchNext = Parser.parseResponse(data[1].data); + + this.basic_info = info.video_details; + + this.watch_next_feed = watchNext.entries?.array(); + this.#watch_next_continuation = watchNext.continuationEndpoint?.as(ContinuationCommand); + } + + /** + * Retrieves watch next feed continuation. + */ + async getWatchNextContinuation(): Promise { + if (!this.#watch_next_continuation) + throw new InnertubeError('Watch next feed continuation not found'); + + const response = await this.#actions.execute(Reel.WatchSequenceEndpoint.PATH, Reel.WatchSequenceEndpoint.build({ + sequenceParams: this.#watch_next_continuation.token + })); + + if (!response.success) { + throw new InnertubeError('Continue failed ', response.status_code); + } + + const parsed = Parser.parseResponse(response.data); + + this.watch_next_feed = parsed.entries?.array(); + this.#watch_next_continuation = parsed.continuationEndpoint?.as(ContinuationCommand); + + return this; + } +} + +export default VideoInfo; \ No newline at end of file diff --git a/deno/src/parser/ytshorts/index.ts b/deno/src/parser/ytshorts/index.ts new file mode 100644 index 00000000..d7be7e23 --- /dev/null +++ b/deno/src/parser/ytshorts/index.ts @@ -0,0 +1 @@ +export { default as VideoInfo } from './VideoInfo.ts'; \ No newline at end of file diff --git a/deno/src/platform/lib.ts b/deno/src/platform/lib.ts index fecbcb45..8a9f47dd 100644 --- a/deno/src/platform/lib.ts +++ b/deno/src/platform/lib.ts @@ -2,7 +2,6 @@ import Innertube from '../Innertube.ts'; export * from '../core/index.ts'; export * from '../parser/index.ts'; -export { default as Parser } from '../parser/index.ts'; export * as Proto from '../proto/index.ts'; export * as Types from '../types/index.ts'; export * from '../utils/index.ts'; diff --git a/deno/src/proto/generated/messages/youtube/(ReelSequence)/Params.ts b/deno/src/proto/generated/messages/youtube/(ReelSequence)/Params.ts new file mode 100644 index 00000000..a4b72989 --- /dev/null +++ b/deno/src/proto/generated/messages/youtube/(ReelSequence)/Params.ts @@ -0,0 +1,75 @@ +import { + tsValueToJsonValueFns, + jsonValueToTsValueFns, +} from "../../../runtime/json/scalar.ts"; +import { + WireMessage, +} from "../../../runtime/wire/index.ts"; +import { + default as serialize, +} from "../../../runtime/wire/serialize.ts"; +import { + tsValueToWireValueFns, + wireValueToTsValueFns, +} from "../../../runtime/wire/scalar.ts"; +import { + default as deserialize, +} from "../../../runtime/wire/deserialize.ts"; + +export declare namespace $.youtube.ReelSequence { + export type Params = { + number: number; + } +} + +export type Type = $.youtube.ReelSequence.Params; + +export function getDefaultValue(): $.youtube.ReelSequence.Params { + return { + number: 0, + }; +} + +export function createValue(partialValue: Partial<$.youtube.ReelSequence.Params>): $.youtube.ReelSequence.Params { + return { + ...getDefaultValue(), + ...partialValue, + }; +} + +export function encodeJson(value: $.youtube.ReelSequence.Params): unknown { + const result: any = {}; + if (value.number !== undefined) result.number = tsValueToJsonValueFns.int32(value.number); + return result; +} + +export function decodeJson(value: any): $.youtube.ReelSequence.Params { + const result = getDefaultValue(); + if (value.number !== undefined) result.number = jsonValueToTsValueFns.int32(value.number); + return result; +} + +export function encodeBinary(value: $.youtube.ReelSequence.Params): Uint8Array { + const result: WireMessage = []; + if (value.number !== undefined) { + const tsValue = value.number; + result.push( + [3, tsValueToWireValueFns.int32(tsValue)], + ); + } + return serialize(result); +} + +export function decodeBinary(binary: Uint8Array): $.youtube.ReelSequence.Params { + const result = getDefaultValue(); + const wireMessage = deserialize(binary); + const wireFields = new Map(wireMessage); + field: { + const wireValue = wireFields.get(3); + if (wireValue === undefined) break field; + const value = wireValueToTsValueFns.int32(wireValue); + if (value === undefined) break field; + result.number = value; + } + return result; +} diff --git a/deno/src/proto/generated/messages/youtube/(ReelSequence)/index.ts b/deno/src/proto/generated/messages/youtube/(ReelSequence)/index.ts new file mode 100644 index 00000000..83be6fbd --- /dev/null +++ b/deno/src/proto/generated/messages/youtube/(ReelSequence)/index.ts @@ -0,0 +1 @@ +export type { Type as Params } from "./Params.ts"; diff --git a/deno/src/proto/generated/messages/youtube/ReelSequence.ts b/deno/src/proto/generated/messages/youtube/ReelSequence.ts new file mode 100644 index 00000000..ebf1ad8f --- /dev/null +++ b/deno/src/proto/generated/messages/youtube/ReelSequence.ts @@ -0,0 +1,134 @@ +import { + Type as Params, + encodeJson as encodeJson_1, + decodeJson as decodeJson_1, + encodeBinary as encodeBinary_1, + decodeBinary as decodeBinary_1, +} from "./(ReelSequence)/Params.ts"; +import { + tsValueToJsonValueFns, + jsonValueToTsValueFns, +} from "../../runtime/json/scalar.ts"; +import { + WireMessage, + WireType, +} from "../../runtime/wire/index.ts"; +import { + default as serialize, +} from "../../runtime/wire/serialize.ts"; +import { + tsValueToWireValueFns, + wireValueToTsValueFns, +} from "../../runtime/wire/scalar.ts"; +import { + default as deserialize, +} from "../../runtime/wire/deserialize.ts"; + +export declare namespace $.youtube { + export type ReelSequence = { + shortId: string; + params?: Params; + feature2: number; + feature3: number; + } +} + +export type Type = $.youtube.ReelSequence; + +export function getDefaultValue(): $.youtube.ReelSequence { + return { + shortId: "", + params: undefined, + feature2: 0, + feature3: 0, + }; +} + +export function createValue(partialValue: Partial<$.youtube.ReelSequence>): $.youtube.ReelSequence { + return { + ...getDefaultValue(), + ...partialValue, + }; +} + +export function encodeJson(value: $.youtube.ReelSequence): unknown { + const result: any = {}; + if (value.shortId !== undefined) result.shortId = tsValueToJsonValueFns.string(value.shortId); + if (value.params !== undefined) result.params = encodeJson_1(value.params); + if (value.feature2 !== undefined) result.feature2 = tsValueToJsonValueFns.int32(value.feature2); + if (value.feature3 !== undefined) result.feature3 = tsValueToJsonValueFns.int32(value.feature3); + return result; +} + +export function decodeJson(value: any): $.youtube.ReelSequence { + const result = getDefaultValue(); + if (value.shortId !== undefined) result.shortId = jsonValueToTsValueFns.string(value.shortId); + if (value.params !== undefined) result.params = decodeJson_1(value.params); + if (value.feature2 !== undefined) result.feature2 = jsonValueToTsValueFns.int32(value.feature2); + if (value.feature3 !== undefined) result.feature3 = jsonValueToTsValueFns.int32(value.feature3); + return result; +} + +export function encodeBinary(value: $.youtube.ReelSequence): Uint8Array { + const result: WireMessage = []; + if (value.shortId !== undefined) { + const tsValue = value.shortId; + result.push( + [1, tsValueToWireValueFns.string(tsValue)], + ); + } + if (value.params !== undefined) { + const tsValue = value.params; + result.push( + [5, { type: WireType.LengthDelimited as const, value: encodeBinary_1(tsValue) }], + ); + } + if (value.feature2 !== undefined) { + const tsValue = value.feature2; + result.push( + [10, tsValueToWireValueFns.int32(tsValue)], + ); + } + if (value.feature3 !== undefined) { + const tsValue = value.feature3; + result.push( + [13, tsValueToWireValueFns.int32(tsValue)], + ); + } + return serialize(result); +} + +export function decodeBinary(binary: Uint8Array): $.youtube.ReelSequence { + const result = getDefaultValue(); + const wireMessage = deserialize(binary); + const wireFields = new Map(wireMessage); + field: { + const wireValue = wireFields.get(1); + if (wireValue === undefined) break field; + const value = wireValueToTsValueFns.string(wireValue); + if (value === undefined) break field; + result.shortId = value; + } + field: { + const wireValue = wireFields.get(5); + if (wireValue === undefined) break field; + const value = wireValue.type === WireType.LengthDelimited ? decodeBinary_1(wireValue.value) : undefined; + if (value === undefined) break field; + result.params = value; + } + field: { + const wireValue = wireFields.get(10); + if (wireValue === undefined) break field; + const value = wireValueToTsValueFns.int32(wireValue); + if (value === undefined) break field; + result.feature2 = value; + } + field: { + const wireValue = wireFields.get(13); + if (wireValue === undefined) break field; + const value = wireValueToTsValueFns.int32(wireValue); + if (value === undefined) break field; + result.feature3 = value; + } + return result; +} diff --git a/deno/src/proto/generated/messages/youtube/index.ts b/deno/src/proto/generated/messages/youtube/index.ts index 3d65d0b4..7d911ed6 100644 --- a/deno/src/proto/generated/messages/youtube/index.ts +++ b/deno/src/proto/generated/messages/youtube/index.ts @@ -10,3 +10,4 @@ export type { Type as PeformCommentActionParams } from "./PeformCommentActionPar export type { Type as MusicSearchFilter } from "./MusicSearchFilter.ts"; export type { Type as SearchFilter } from "./SearchFilter.ts"; export type { Type as Hashtag } from "./Hashtag.ts"; +export type { Type as ReelSequence } from "./ReelSequence.ts"; diff --git a/deno/src/proto/index.ts b/deno/src/proto/index.ts index 8c984463..e59235c0 100644 --- a/deno/src/proto/index.ts +++ b/deno/src/proto/index.ts @@ -14,6 +14,7 @@ import * as PeformCommentActionParams from './generated/messages/youtube/PeformC import * as NotificationPreferences from './generated/messages/youtube/NotificationPreferences.ts'; import * as InnertubePayload from './generated/messages/youtube/InnertubePayload.ts'; import * as Hashtag from './generated/messages/youtube/Hashtag.ts'; +import * as ReelSequence from './generated/messages/youtube/ReelSequence.ts'; export function encodeVisitorData(id: string, timestamp: number): string { const buf = VisitorData.encodeBinary({ id, timestamp }); @@ -327,5 +328,17 @@ export function encodeHashtag(hashtag: string): string { } }); + return encodeURIComponent(u8ToBase64(buf)); +} + +export function encodeReelSequence(short_id: string): string { + const buf = ReelSequence.encodeBinary({ + shortId: short_id, + params: { + number: 5 + }, + feature2: 25, + feature3: 0 + }); return encodeURIComponent(u8ToBase64(buf)); } \ No newline at end of file diff --git a/deno/src/proto/youtube.proto b/deno/src/proto/youtube.proto index 9b97ed3b..9b2f79ca 100644 --- a/deno/src/proto/youtube.proto +++ b/deno/src/proto/youtube.proto @@ -264,4 +264,15 @@ message Hashtag { } required Params params = 93; +} + +message ReelSequence { + required string short_id = 1; + message Params { + required int32 number = 3; + } + + required Params params = 5; + required int32 feature_2 = 10; + required int32 feature_3 = 13; } \ No newline at end of file diff --git a/deno/src/types/Endpoints.ts b/deno/src/types/Endpoints.ts index 7b14eeb0..71764147 100644 --- a/deno/src/types/Endpoints.ts +++ b/deno/src/types/Endpoints.ts @@ -362,4 +362,42 @@ export type IBlocklistPickerRequest = { blockedForKidsContent: { external_channel_id: string; } +} + +export interface IReelWatchRequest { + playerRequest: { + videoId: string, + params: string, + }, + params?: string; +} + +export type ReelWatchEndpointOptions = { + /** + * The shorts ID. + */ + short_id: string; + /** + * The client to use. + */ + client?: InnerTubeClient; + /** + * Additional protobuf parameters. + */ + params?: string; +} + +export interface IReelSequenceRequest { + sequenceParams: string; +} + +export type ReelWatchSequenceEndpointOptions = { + /** + * The protobuf parameters. + */ + sequenceParams: string; + /** + * The client to use. + */ + client?: InnerTubeClient; } \ No newline at end of file diff --git a/deno/src/utils/DashManifest.js b/deno/src/utils/DashManifest.js index 520fbc3a..47377bb1 100644 --- a/deno/src/utils/DashManifest.js +++ b/deno/src/utils/DashManifest.js @@ -61,7 +61,8 @@ function DashManifest({ subsegmentAlignment: "true", lang: set.language, codecs: set.codecs, - audioSamplingRate: set.audio_sample_rate + audioSamplingRate: set.audio_sample_rate, + contentType: "audio" }, set.track_role && /* @__PURE__ */ DashUtils.createElement("role", { schemeIdUri: "urn:mpeg:dash:role:2011", value: set.track_role @@ -87,7 +88,8 @@ function DashManifest({ subsegmentAlignment: "true", codecs: set.codecs, maxPlayoutRate: "1", - frameRate: set.fps + frameRate: set.fps, + contentType: "video" }, set.color_info.primaries && /* @__PURE__ */ DashUtils.createElement("essential-property", { schemeIdUri: "urn:mpeg:mpegB:cicp:ColourPrimaries", value: set.color_info.primaries diff --git a/deno/src/utils/DashManifest.tsx b/deno/src/utils/DashManifest.tsx index 76a74c1f..32183b63 100644 --- a/deno/src/utils/DashManifest.tsx +++ b/deno/src/utils/DashManifest.tsx @@ -97,6 +97,7 @@ function DashManifest({ lang={set.language} codecs={set.codecs} audioSamplingRate={set.audio_sample_rate} + contentType="audio" > { set.track_role && @@ -150,6 +151,7 @@ function DashManifest({ codecs={set.codecs} maxPlayoutRate="1" frameRate={set.fps} + contentType="video" > { set.color_info.primaries && diff --git a/deno/src/utils/Utils.ts b/deno/src/utils/Utils.ts index a14a543e..890bfe60 100644 --- a/deno/src/utils/Utils.ts +++ b/deno/src/utils/Utils.ts @@ -138,6 +138,13 @@ export function concatMemos(...iterables: Array): Memo { for (const iterable of iterables) { if (!iterable) continue; for (const item of iterable) { + // Update existing items. + const memo_item = memo.get(item[0]); + if (memo_item) { + memo.set(item[0], [ ...memo_item, ...item[1] ]); + continue; + } + memo.set(...item); } }