### Install and Run Web App - Shell Source: https://github.com/luanrt/youtube.js/blob/main/examples/browser/README.md Navigate to the web example directory, install dependencies, and start the development server. Ensure the library is built before running. ```shell cd examples/browser/web npm install npm run dev ``` -------------------------------- ### Guide Constructor Source: https://github.com/luanrt/youtube.js/blob/main/docs/api/youtubei.js/namespaces/YT/classes/Guide.md Initializes a new instance of the Guide class. It takes raw response data as input and parses it to create a Guide object. ```APIDOC ## new Guide(data) ### Description Initializes a new instance of the Guide class. ### Parameters #### data - **data** (IRawResponse) - The raw response data from YouTube. ### Returns - **Guide** - An instance of the Guide class. ``` -------------------------------- ### Install YouTube.js from Git Source: https://github.com/luanrt/youtube.js/blob/main/README.md Install the edge version of youtubei.js directly from the GitHub repository using npm. ```bash # Git (edge version) npm install github:LuanRT/YouTube.js ``` -------------------------------- ### Install YouTube.js via NPM or Yarn Source: https://github.com/luanrt/youtube.js/blob/main/README.md Use these commands to install the latest version of the youtubei.js package using npm or yarn. ```bash # NPM npm install youtubei.js@latest ``` ```bash # Yarn yarn add youtubei.js@latest ``` -------------------------------- ### start Source: https://github.com/luanrt/youtube.js/blob/main/docs/api/youtubei.js/namespaces/YT/classes/LiveChat.md Starts the live chat session. This method should be called to begin receiving and processing live chat events. ```APIDOC ## start ### Description Starts the live chat session. ### Method start ### Returns `void` ``` -------------------------------- ### AccountManager.getSettings() Source: https://github.com/luanrt/youtube.js/blob/main/docs/api/youtubei.js/namespaces/Managers/classes/AccountManager.md Gets YouTube settings for the signed-in account. ```APIDOC ## getSettings() ### Description Gets YouTube settings. ### Method `AccountManager.getSettings` ### Returns `Promise` ``` -------------------------------- ### Install YouTube.js for Deno Source: https://github.com/luanrt/youtube.js/blob/main/README.md Add the youtubei.js package to your Deno project using the deno add command. ```bash # Deno denp add npm:youtubei.js@latest ``` -------------------------------- ### getGuide Source: https://github.com/luanrt/youtube.js/blob/main/docs/api/classes/Innertube.md Fetches the YouTube guide, which typically includes navigation items like subscriptions, history, and trending. ```APIDOC ## getGuide ### Description Fetches the YouTube guide, which typically includes navigation items like subscriptions, history, and trending. ### Method POST ### Endpoint /innertube/getGuide ### Response #### Success Response (200) - **guide** (Guide) - The YouTube guide. ``` -------------------------------- ### Guide.contents Source: https://github.com/luanrt/youtube.js/blob/main/docs/api/youtubei.js/namespaces/YT/classes/Guide.md An optional array containing guide sections, which can be either GuideSection or GuideSubscriptionsSection nodes. ```APIDOC ## Guide.contents ### Description Represents the sections within the YouTube guide. ### Type `ObservedArray` (optional) ``` -------------------------------- ### StartAt Class Source: https://github.com/luanrt/youtube.js/blob/main/docs/api/youtubei.js/namespaces/YTNodes/classes/StartAt.md Provides details about the StartAt class, including its constructor, properties like start_at_option_label, and inherited methods such as as(), hasKey(), is(), and key(). ```APIDOC ## Class: StartAt Defined in: [src/parser/classes/StartAt.ts:5](https://github.com/LuanRT/YouTube.js/blob/853a36307b5d644ada14dcb1216c2c22c2ae7b73/src/parser/classes/StartAt.ts#L5) Extends: [`YTNode`](../../Helpers/classes/YTNode.md) ### Constructor > **new StartAt**(`data`): `StartAt` Defined in: [src/parser/classes/StartAt.ts:10](https://github.com/LuanRT/YouTube.js/blob/853a36307b5d644ada14dcb1216c2c22c2ae7b73/src/parser/classes/StartAt.ts#L10) #### Parameters ##### data [`RawNode`](../../../../type-aliases/RawNode.md) #### Returns `StartAt` #### Overrides [`YTNode`](../../Helpers/classes/YTNode.md).[`constructor`](../../Helpers/classes/YTNode.md#constructor) ### Properties #### start_at_option_label > **start_at_option_label**: [`Text`](../../Misc/classes/Text.md) Defined in: [src/parser/classes/StartAt.ts:8](https://github.com/LuanRT/YouTube.js/blob/853a36307b5d644ada14dcb1216c2c22c2ae7b73/src/parser/classes/StartAt.ts#L8) *** #### type > `readonly` **type**: `string` Defined in: [src/parser/helpers.ts:8](https://github.com/LuanRT/YouTube.js/blob/853a36307b5d644ada14dcb1216c2c22c2ae7b73/src/parser/helpers.ts#L8) #### Inherited from [`YTNode`](../../Helpers/classes/YTNode.md).[`type`](../../Helpers/classes/YTNode.md#type) *** #### type > `static` **type**: `string` = `'StartAt'` Defined in: [src/parser/classes/StartAt.ts:6](https://github.com/LuanRT/YouTube.js/blob/853a36307b5d644ada14dcb1216c2c22c2ae7b73/src/parser/classes/StartAt.ts#L6) #### Overrides [`YTNode`](../../Helpers/classes/YTNode.md).[`type`](../../Helpers/classes/YTNode.md#type-1) ### Methods #### as() > **as**<`T`, `K` egation>(...`types`): `InstanceType` <`K`[`number`]> Defined in: [src/parser/helpers.ts:29](https://github.com/LuanRT/YouTube.js/blob/853a36307b5d644ada14dcb1216c2c22c2ae7b73/src/parser/helpers.ts#L29) Cast to one of the given types. #### Type Parameters ##### T `T` *extends* [`YTNode`](../../Helpers/classes/YTNode.md) ##### K `K` *extends* [`YTNodeConstructor`](../../Helpers/interfaces/YTNodeConstructor.md)<`T`>[] #### Parameters ##### types ...`K` The types to cast to #### Returns `InstanceType` <`K`[`number`]> The node cast to one of the given types #### Throws If the node is not of the given type #### Inherited from [`YTNode`](../../Helpers/classes/YTNode.md).[`as`](../../Helpers/classes/YTNode.md#as) *** #### hasKey() > **hasKey**<`T`, `R` egation>(`key`): `this is StartAt & { [k in string]: R }` Defined in: [src/parser/helpers.ts:41](https://github.com/LuanRT/YouTube.js/blob/853a36307b5d644ada14dcb1216c2c22c2ae7b73/src/parser/helpers.ts#L41) Check for a key without asserting the type. #### Type Parameters ##### T `T` *extends* `string` ##### R `R` = `any` #### Parameters ##### key `T` The key to check #### Returns `this is StartAt & { [k in string]: R }` Whether the node has the key #### Inherited from [`YTNode`](../../Helpers/classes/YTNode.md).[`hasKey`](../../Helpers/classes/YTNode.md#haskey) *** #### is() > **is**<`T`, `K` egation>(...`types`): `this is InstanceType` Defined in: [src/parser/helpers.ts:19](https://github.com/LuanRT/YouTube.js/blob/853a36307b5d644ada14dcb1216c2c22c2ae7b73/src/parser/helpers.ts#L19) Check if the node is of the given type. #### Type Parameters ##### T `T` *extends* [`YTNode`](../../Helpers/classes/YTNode.md) ##### K `K` *extends* [`YTNodeConstructor`](../../Helpers/interfaces/YTNodeConstructor.md)<`T`>[] #### Parameters ##### types ...`K` The type to check #### Returns `this is InstanceType` whether the node is of the given type #### Inherited from [`YTNode`](../../Helpers/classes/YTNode.md).[`is`](../../Helpers/classes/YTNode.md#is) *** #### key() > **key**<`T`, `R` egation>(`key`): [`Maybe`](../../Helpers/classes/Maybe.md) Defined in: [src/parser/helpers.ts:51](https://github.com/LuanRT/YouTube.js/blob/853a36307b5d644ada14dcb1216c2c22c2ae7b73/src/parser/helpers.ts#L51) Assert that the node has the given key and return it. #### Type Parameters ##### T `T` *extends* `string` ##### R `R` = `any` #### Parameters ##### key `T` The key to check #### Returns [`Maybe`](../../Helpers/classes/Maybe.md) The value of the key wrapped in a Maybe #### Throws If the node does not have the key #### Inherited from [`YTNode`](../../Helpers/classes/YTNode.md).[`key`](../../Helpers/classes/YTNode.md#key) ``` -------------------------------- ### Raw InnerTube Response Example Source: https://github.com/luanrt/youtube.js/blob/main/src/parser/README.md An example of a raw, unstructured InnerTube API response. ```json { "sidebar": { "playlistSidebarRenderer": { "items": [ { "playlistSidebarPrimaryInfoRenderer": { "title": { "simpleText": '..' }, "description": { "runs": [ { "text": '..' }, //.... ] }, "stats": [ { "simpleText": '..' }, { "runs": [ { "text": '..' } ] } ] } } ] } } } ``` -------------------------------- ### ShowMiniplayerCommand Constructor Source: https://github.com/luanrt/youtube.js/blob/main/docs/api/classes/ShowMiniplayerCommand.md Initializes a new instance of the ShowMiniplayerCommand class. It takes raw node data as input and returns a ShowMiniplayerCommand instance. ```APIDOC ## new ShowMiniplayerCommand(data) ### Description Initializes a new instance of the ShowMiniplayerCommand class. ### Parameters #### data - **data** (RawNode) - The raw node data to initialize the command with. ### Returns - ShowMiniplayerCommand - A new instance of the ShowMiniplayerCommand class. ``` -------------------------------- ### GuideDownloadsEntry Constructor Source: https://github.com/luanrt/youtube.js/blob/main/docs/api/youtubei.js/namespaces/YTNodes/classes/GuideDownloadsEntry.md Initializes a new instance of the GuideDownloadsEntry class. It takes raw node data as input and extends the functionality of the base GuideEntry class. ```APIDOC ## new GuideDownloadsEntry(data: RawNode): GuideDownloadsEntry ### Description Initializes a new instance of the GuideDownloadsEntry class. ### Parameters #### data - **data** (RawNode) - The raw node data to initialize the entry with. ### Returns - GuideDownloadsEntry - A new instance of GuideDownloadsEntry. ### Overrides - [`GuideEntry`](GuideEntry.md).[`constructor`](GuideEntry.md#constructor) ``` -------------------------------- ### get playlists_section() Source: https://github.com/luanrt/youtube.js/blob/main/docs/api/youtubei.js/namespaces/YT/classes/Library.md Retrieves a specific section dedicated to playlists. It returns an object similar to the history and liked_videos methods, containing contents, a function to get all items, title, and type, or undefined. ```APIDOC ## get playlists_section() ### Description Retrieves a specific section dedicated to playlists. It returns an object similar to the history and liked_videos methods, containing contents, a function to get all items, title, and type, or undefined. ### Returns - `{ contents: any[]; getAll: () => Promise | History | Playlist>; title: Text; type: string | undefined; } | undefined` ``` -------------------------------- ### GuideSubscriptionsSection Constructor Source: https://github.com/luanrt/youtube.js/blob/main/docs/api/youtubei.js/namespaces/YTNodes/classes/GuideSubscriptionsSection.md Initializes a new instance of GuideSubscriptionsSection. It takes raw node data as input and inherits its constructor from GuideSection. ```APIDOC ## new GuideSubscriptionsSection(data) ### Description Initializes a new instance of the GuideSubscriptionsSection class. ### Parameters #### data - **data** (RawNode) - The raw node data to initialize the section with. ### Returns - GuideSubscriptionsSection - An instance of GuideSubscriptionsSection. ### Inherited from - GuideSection.constructor ``` -------------------------------- ### ConfirmDialog.cancel_button Source: https://github.com/luanrt/youtube.js/blob/main/docs/api/youtubei.js/namespaces/YTNodes/classes/ConfirmDialog.md Gets the cancel button from the dialog. ```APIDOC ## ConfirmDialog.cancel_button ### Description Gets the cancel button from the dialog. ### Returns - **YTNodes.Button** - The cancel button. ``` -------------------------------- ### init() Source: https://github.com/luanrt/youtube.js/blob/main/docs/api/classes/OAuth2.md Initializes the OAuth2 process, optionally with provided tokens. This asynchronous method sets up the necessary tokens for authentication. ```APIDOC ## init(tokens?) ### Description Initializes the OAuth2 process, optionally with provided tokens. ### Parameters #### Parameters - **tokens?** (`OAuth2Tokens`) - Optional. The OAuth2 tokens to initialize with. ### Returns `Promise` - A promise that resolves when the initialization is complete. ``` -------------------------------- ### ConfirmDialog.confirm_button Source: https://github.com/luanrt/youtube.js/blob/main/docs/api/youtubei.js/namespaces/YTNodes/classes/ConfirmDialog.md Gets the confirmation button from the dialog. ```APIDOC ## ConfirmDialog.confirm_button ### Description Gets the confirmation button from the dialog. ### Returns - **YTNodes.Button** - The confirmation button. ``` -------------------------------- ### Basic Innertube Initialization Source: https://github.com/luanrt/youtube.js/blob/main/README.md This is a basic example of how to import and create an Innertube client instance. Additional options can be passed to the create method. ```typescript import { Innertube } from 'youtubei.js'; const innertube = await Innertube.create(/* options */); ``` -------------------------------- ### get history() Source: https://github.com/luanrt/youtube.js/blob/main/docs/api/youtubei.js/namespaces/YT/classes/Library.md Retrieves the user's watch history. This method returns an object containing the history contents, a function to get all history items, the title of the history section, and its type. It can also return undefined if no history is available. ```APIDOC ## get history() ### Description Retrieves the user's watch history. This method returns an object containing the history contents, a function to get all history items, the title of the history section, and its type. It can also return undefined if no history is available. ### Returns - `{ contents: any[]; getAll: () => Promise | History | Playlist>; title: Text; type: string | undefined; } | undefined` ``` -------------------------------- ### MediaInfo Constructor Source: https://github.com/luanrt/youtube.js/blob/main/docs/api/youtubei.js/namespaces/Mixins/classes/MediaInfo.md Initializes a new instance of the MediaInfo class. It takes raw data, actions, and a cpn (client playback nonce) as arguments. ```APIDOC ## Constructor ### new MediaInfo(data, actions, cpn) Initializes a new instance of the MediaInfo class. #### Parameters - **data** (`ApiResponse` | `ApiResponse`?): The raw API response data. - **actions** (`Actions`): An instance of the Actions class for performing actions. - **cpn** (`string`): The client playback nonce. #### Returns - `MediaInfo`: An instance of the MediaInfo class. ``` -------------------------------- ### NotificationsMenu.page Source: https://github.com/luanrt/youtube.js/blob/main/docs/api/youtubei.js/namespaces/YT/classes/NotificationsMenu.md Accessor to get the page data from the NotificationsMenu. ```APIDOC ## get page() ### Description Retrieves the page data associated with the NotificationsMenu. ### Returns - `IGetNotificationsMenuResponse` - The page data. ``` -------------------------------- ### lang Accessor Source: https://github.com/luanrt/youtube.js/blob/main/docs/api/classes/Session.md Gets the language code for the session. ```APIDOC ## get lang() ### Description Gets the language code for the session. ### Returns - `string` - The language code. ``` -------------------------------- ### Build All Project Components Source: https://github.com/luanrt/youtube.js/blob/main/CONTRIBUTING.md Build all components of the project. This command compiles the entire project for distribution. ```sh npm run build ``` -------------------------------- ### GuideEntry Constructor Source: https://github.com/luanrt/youtube.js/blob/main/docs/api/youtubei.js/namespaces/YTNodes/classes/GuideEntry.md Initializes a new GuideEntry instance with the provided data. This constructor is inherited from the base YTNode class. ```APIDOC ## Constructor > **new GuideEntry**(`data`): `GuideEntry` #### Parameters ##### data - `data` (`RawNode`): The raw node data to initialize the GuideEntry with. #### Returns - `GuideEntry`: An instance of the GuideEntry class. ``` -------------------------------- ### filters accessor Source: https://github.com/luanrt/youtube.js/blob/main/docs/api/youtubei.js/namespaces/YTMusic/classes/HomeFeed.md Gets the available filters for the home feed. ```APIDOC ## filters ### Description Gets the available filters for the home feed. ### Returns - `string[]` - An array of filter strings. ``` -------------------------------- ### Feed.getVideosFromMemo Source: https://github.com/luanrt/youtube.js/blob/main/docs/api/youtubei.js/namespaces/YT/classes/Library.md Gets all videos on a given page via memo. ```APIDOC ## getVideosFromMemo(memo) ### Description Gets all videos on a given page via memo. ### Method `static get` ### Endpoint N/A (SDK Method) ### Parameters #### Path Parameters - **memo** (Memo) - Required - The memo object to retrieve videos from. ### Returns `ObservedArray` - An observed array of videos. ``` -------------------------------- ### Player.create() Source: https://github.com/luanrt/youtube.js/blob/main/docs/api/classes/Player.md Statically creates and initializes a Player instance, potentially using a cache and fetch options. ```APIDOC ## static Player.create(cache, fetch?, po_token?, player_id?) ### Description Statically creates and initializes a Player instance. ### Parameters #### Parameters - **cache** (ICache | undefined) - Required - The cache to use for initialization. - **fetch?** (function) - Optional - A fetch function to use. - **po_token?** (string) - Optional - The PO token. - **player_id?** (string) - Optional - The player ID. ``` -------------------------------- ### Feed.getPlaylistsFromMemo Source: https://github.com/luanrt/youtube.js/blob/main/docs/api/youtubei.js/namespaces/YT/classes/Library.md Gets all playlists on a given page via memo. ```APIDOC ## getPlaylistsFromMemo(memo) ### Description Gets all playlists on a given page via memo. ### Method `static get` ### Endpoint N/A (SDK Method) ### Parameters #### Path Parameters - **memo** (Memo) - Required - The memo object to retrieve playlists from. ### Returns `ObservedArray` - An observed array of playlists. ``` -------------------------------- ### download(options?) Source: https://github.com/luanrt/youtube.js/blob/main/docs/api/youtubei.js/namespaces/YT/classes/VideoInfo.md Initiates the download of the video. This method accepts optional download options and returns a Promise that resolves with a ReadableStream for the video data. ```APIDOC ## download(options?) ### Description Downloads the video. ### Method `download(options?)` ### Parameters #### options? - **options?** (DownloadOptions) - Optional download options. Defaults to `{}`. ### Returns `Promise>>` ``` -------------------------------- ### Search.page Source: https://github.com/luanrt/youtube.js/blob/main/docs/api/youtubei.js/namespaces/YT/classes/Search.md Accessor to get the original, unparsed page data. ```APIDOC ## Search.page ### Description Retrieves the raw, original page data as received from the YouTube API before any parsing. ### Returns - `T` - The original page data. ``` -------------------------------- ### client_version Accessor Source: https://github.com/luanrt/youtube.js/blob/main/docs/api/classes/Session.md Gets the client version associated with the session. ```APIDOC ## get client_version() ### Description Gets the client version associated with the session. ### Returns - `string` - The client version. ``` -------------------------------- ### SearchSubMenu Constructor Source: https://github.com/luanrt/youtube.js/blob/main/docs/api/youtubei.js/namespaces/YTNodes/classes/SearchSubMenu.md Initializes a new instance of the SearchSubMenu class. It takes raw node data as input and extends the base YTNode class. ```APIDOC ## Constructor > **new SearchSubMenu**(`data`): `SearchSubMenu` #### Parameters ##### data - `data` (RawNode) - The raw node data to initialize the SearchSubMenu with. #### Returns - `SearchSubMenu` - A new instance of the SearchSubMenu class. ``` -------------------------------- ### client_name Accessor Source: https://github.com/luanrt/youtube.js/blob/main/docs/api/classes/Session.md Gets the client name associated with the session. ```APIDOC ## get client_name() ### Description Gets the client name associated with the session. ### Returns - `string` - The client name. ``` -------------------------------- ### GuideSection Constructor Source: https://github.com/luanrt/youtube.js/blob/main/docs/api/youtubei.js/namespaces/YTNodes/classes/GuideSection.md Initializes a new instance of the GuideSection class. It takes raw data as input and parses it into a GuideSection object. ```APIDOC ## new GuideSection(data) ### Description Initializes a new instance of the GuideSection class. ### Parameters #### data - **data** (RawNode) - The raw node data to parse. ### Returns - GuideSection - An instance of the GuideSection class. ``` -------------------------------- ### sidebar_items Accessor Source: https://github.com/luanrt/youtube.js/blob/main/docs/api/youtubei.js/namespaces/YT/classes/Settings.md Gets a list of all available sidebar item names. ```APIDOC ## sidebar_items ### Description Returns options available in the sidebar. ### Returns - `string[]` - An array of strings representing the available sidebar item names. ``` -------------------------------- ### MusicCardShelfHeaderBasic Methods Source: https://github.com/luanrt/youtube.js/blob/main/docs/api/youtubei.js/namespaces/YTNodes/classes/MusicCardShelfHeaderBasic.md Documentation for the available methods on the MusicCardShelfHeaderBasic class, including as, hasKey, is, and key. ```APIDOC ## Methods ### as(...types): InstanceType #### Description Casts the node to one of the given types. #### Type Parameters - **T**: `T` extends `YTNode` - **K**: `K` extends `YTNodeConstructor[]` #### Parameters - **types** (...`K`): The types to cast to. #### Returns - `InstanceType` - The node cast to one of the given types. #### Throws - If the node is not of the given type. #### Inherited from - `YTNode.as` *** ### hasKey(key): this is MusicCardShelfHeaderBasic & { [k in string]: R } #### Description Checks for a key in the node without asserting the type. #### Type Parameters - **T**: `T` extends `string` - **R**: `R` = `any` #### Parameters - **key** (`T`): The key to check. #### Returns - `this is MusicCardShelfHeaderBasic & { [k in string]: R }` - Whether the node has the key. #### Inherited from - `YTNode.hasKey` *** ### is(...types): this is InstanceType #### Description Checks if the node is of the given type. #### Type Parameters - **T**: `T` extends `YTNode` - **K**: `K` extends `YTNodeConstructor[]` #### Parameters - **types** (...`K`): The type to check. #### Returns - `this is InstanceType` - Whether the node is of the given type. #### Inherited from - `YTNode.is` *** ### key(key): Maybe #### Description Asserts that the node has the given key and returns its value wrapped in a `Maybe`. #### Type Parameters - **T**: `T` extends `string` - **R**: `R` = `any` #### Parameters - **key** (`T`): The key to check. #### Returns - `Maybe` - The value of the key wrapped in a `Maybe`. #### Throws - If the node does not have the key. #### Inherited from - `YTNode.key` ``` -------------------------------- ### setting_options Accessor Source: https://github.com/luanrt/youtube.js/blob/main/docs/api/youtubei.js/namespaces/YT/classes/Settings.md Gets a list of all available setting option names. ```APIDOC ## setting_options ### Description Returns settings available in the page. ### Returns - `string[]` - An array of strings representing the available setting option names. ``` -------------------------------- ### Implement Platform Shim Entry Point Source: https://github.com/luanrt/youtube.js/blob/main/src/platform/README.md Template for creating a new platform entry point in the src/platform directory. Requires implementing the ICache interface and providing necessary platform-specific shims. ```ts import { Platform } from '../utils/Utils.js'; import { PlatformShim } from "../types"; import { ICache } from '../types/Cache.js'; class Cache implements ICache { // ... } Platform.load({ // ... shims }); export * from './lib.js'; import Innertube from './lib.js'; export default Innertube; ``` -------------------------------- ### MusicShelf Constructor Source: https://github.com/luanrt/youtube.js/blob/main/docs/api/youtubei.js/namespaces/YTNodes/classes/MusicShelf.md Initializes a new instance of the MusicShelf class. It takes raw data as input and parses it into a MusicShelf object. ```APIDOC ## Constructor > **new MusicShelf**(`data`): `MusicShelf` #### Parameters ##### data - `data` (RawNode) - The raw node data to parse. #### Returns - `MusicShelf` - An instance of the MusicShelf class. ``` -------------------------------- ### channels Source: https://github.com/luanrt/youtube.js/blob/main/docs/api/youtubei.js/namespaces/YT/classes/HashtagFeed.md Gets all the channels present in the feed. This accessor is inherited from FilterableFeed. ```APIDOC ## get channels() ### Description Gets all the channels in the feed. ### Returns - ObservedArray - An array of channels. ### Inherited from - FilterableFeed.channels ``` -------------------------------- ### Platform.shim Source: https://github.com/luanrt/youtube.js/blob/main/docs/api/classes/Platform.md Gets the platform shim, which provides access to platform-specific functionalities. ```APIDOC ## Platform.shim ### Description Gets the platform shim, which provides access to platform-specific functionalities. ### Method GET ### Endpoint /platform/shim ### Returns - **PlatformShim** - The platform shim object. ``` -------------------------------- ### VideoDetails Constructor Source: https://github.com/luanrt/youtube.js/blob/main/docs/api/youtubei.js/namespaces/Misc/classes/VideoDetails.md Initializes a new instance of the VideoDetails class. It takes raw node data as input and parses it into a VideoDetails object. ```APIDOC ## Constructor ### new VideoDetails(data) Initializes a new instance of the VideoDetails class. #### Parameters ##### data - **data** (`RawNode`) - The raw node data to parse. #### Returns - `VideoDetails` - An instance of the VideoDetails class. ``` -------------------------------- ### introspect() Source: https://github.com/luanrt/youtube.js/blob/main/docs/api/youtubei.js/namespaces/Generator/functions/introspect.md Introspect an example of a class in order to determine its key info and dependencies. ```APIDOC ## Function: introspect() > **introspect**(`classdata`): `object` Defined in: [src/parser/generator.ts:376](https://github.com/LuanRT/YouTube.js/blob/853a36307b5d644ada14dcb1216c2c22c2ae7b73/src/parser/generator.ts#L376) Introspect an example of a class in order to determine its key info and dependencies ## Parameters ### classdata `unknown` The example of the class ## Returns `object` The key info and any unimplemented dependencies ### key_info > **key_info**: readonly [`string`, [`InferenceType`](../type-aliases/InferenceType.md)][] ### unimplemented_dependencies > **unimplemented_dependencies**: [`string`, `any`][] ``` -------------------------------- ### Playlist Constructor Source: https://github.com/luanrt/youtube.js/blob/main/docs/api/youtubei.js/namespaces/YTMusic/classes/Playlist.md Initializes a new Playlist instance with the given response and actions. ```APIDOC ## new Playlist(response, actions) ### Description Initializes a new Playlist instance. ### Parameters #### response - **response** (ApiResponse) - The API response object. #### actions - **actions** (Actions) - The Actions instance. ### Returns - Playlist - A new Playlist instance. ``` -------------------------------- ### Comments API - Get Continuation Source: https://github.com/luanrt/youtube.js/blob/main/examples/comments/README.md Retrieves the next batch of comment threads. ```APIDOC ## GET /api/comments/continuation ### Description Retrieves the next batch of comment threads. ### Method GET ### Endpoint /api/comments/continuation ### Response #### Success Response (200) - **Comments** (Comments) - The next batch of comment threads. #### Response Example ```json { "comments": [ { "comment": { "author": "Another User", "content": "Another comment.", "published": "2023-10-27T11:00:00Z" }, "replies": [] } ] } ``` ``` -------------------------------- ### ShortFormVideoInfo Constructor Source: https://github.com/luanrt/youtube.js/blob/main/docs/api/youtubei.js/namespaces/YTShorts/classes/ShortFormVideoInfo.md Initializes a new instance of the ShortFormVideoInfo class. This constructor is inherited from the MediaInfo class and takes data, actions, cpn, and reel_watch_sequence_response as parameters. ```APIDOC ## new ShortFormVideoInfo(data, actions, cpn, reel_watch_sequence_response) ### Description Initializes a new instance of the ShortFormVideoInfo class. This constructor is inherited from the MediaInfo class and takes data, actions, cpn, and reel_watch_sequence_response as parameters. ### Parameters #### data - **data** (ApiResponse | ApiResponse?) - The response data from the API. #### actions - **actions** (Actions) - The Actions object for performing YouTube actions. #### cpn - **cpn** (string) - The cpn identifier. #### reel_watch_sequence_response - **reel_watch_sequence_response** (ApiResponse) - The response for the reel watch sequence. ### Returns - **ShortFormVideoInfo** - An instance of the ShortFormVideoInfo class. ``` -------------------------------- ### getPlaylistsFromMemo() Source: https://github.com/luanrt/youtube.js/blob/main/docs/api/youtubei.js/namespaces/YT/classes/Search.md Static method to get all playlists on a given page via memo. ```APIDOC ## getPlaylistsFromMemo(memo) ### Description Get all playlists on a given page via memo. ### Parameters #### memo - **memo** (Memo) - Required - The memo object containing playlist data. ### Returns - ObservedArray ``` -------------------------------- ### DescriptionPreviewView Constructor Source: https://github.com/luanrt/youtube.js/blob/main/docs/api/youtubei.js/namespaces/YTNodes/classes/DescriptionPreviewView.md Initializes a new instance of the DescriptionPreviewView class. It takes raw node data as input and returns a DescriptionPreviewView instance. ```APIDOC ## new DescriptionPreviewView(data) ### Description Initializes a new instance of the DescriptionPreviewView class. ### Parameters #### data - **data** (`RawNode`) - The raw node data to initialize the view with. ### Returns - `DescriptionPreviewView` - A new instance of DescriptionPreviewView. ### Overrides - `YTNode.constructor` ``` -------------------------------- ### page accessor Source: https://github.com/luanrt/youtube.js/blob/main/docs/api/youtubei.js/namespaces/YTMusic/classes/HomeFeed.md Gets the raw browse response for the home feed page. ```APIDOC ## page ### Description Gets the raw browse response for the home feed page. ### Returns - `IBrowseResponse` - The browse response object. ``` -------------------------------- ### Playlist Constructor Source: https://github.com/luanrt/youtube.js/blob/main/docs/api/youtubei.js/namespaces/YTNodes/classes/Playlist.md Initializes a new Playlist instance. It takes raw data as input and parses it into a Playlist object. ```APIDOC ## new Playlist(data) ### Description Initializes a new Playlist instance. ### Parameters #### data - **data** (RawNode) - The raw data object to parse into a Playlist. ### Returns - Playlist - A new Playlist instance. ``` -------------------------------- ### getStreamingInfo Source: https://github.com/luanrt/youtube.js/blob/main/docs/api/youtubei.js/namespaces/YTKids/classes/VideoInfo.md Get a cleaned up representation of the adaptive_formats. This method is inherited from the MediaInfo class. ```APIDOC ## getStreamingInfo(url_transformer?, format_filter?) ### Description Get a cleaned up representation of the adaptive_formats. ### Method (Inherited from MediaInfo) ### Parameters #### Path Parameters - **url_transformer?** (URLTransformer) - Optional - A transformer for the URL. - **format_filter?** (FormatFilter) - Optional - A filter for the format. ### Returns `Promise` ### Inherited from [`MediaInfo`](../../Mixins/classes/MediaInfo.md).[`getStreamingInfo`](../../Mixins/classes/MediaInfo.md#getstreaminginfo) ``` -------------------------------- ### memo Source: https://github.com/luanrt/youtube.js/blob/main/docs/api/youtubei.js/namespaces/YT/classes/HashtagFeed.md Gets the Memo object associated with this feed. This accessor is inherited from FilterableFeed. ```APIDOC ## get memo() ### Description Gets the Memo object associated with this feed. ### Returns - Memo - The Memo object. ### Inherited from - FilterableFeed.memo ``` -------------------------------- ### Album Constructor Source: https://github.com/luanrt/youtube.js/blob/main/docs/api/youtubei.js/namespaces/YTMusic/classes/Album.md Initializes a new instance of the Album class. It takes an ApiResponse object as input and returns an Album instance. ```APIDOC ## new Album(response) ### Description Initializes a new instance of the Album class. ### Parameters #### response - **response** (ApiResponse) - The API response object. ### Returns - **Album** - An instance of the Album class. ``` -------------------------------- ### filters Source: https://github.com/luanrt/youtube.js/blob/main/docs/api/youtubei.js/namespaces/YT/classes/HashtagFeed.md Gets the available primary filters as strings. This accessor is inherited from FilterableFeed. ```APIDOC ## get filters() ### Description Returns the available primary filters as strings. ### Returns - string[] - An array of filter strings. ### Inherited from - FilterableFeed.filters ``` -------------------------------- ### GuideSubscriptionsSection Methods Source: https://github.com/luanrt/youtube.js/blob/main/docs/api/youtubei.js/namespaces/YTNodes/classes/GuideSubscriptionsSection.md Lists the methods available on GuideSubscriptionsSection instances, including utility methods like 'as', 'hasKey', 'is', and 'key', many of which are inherited from GuideSection. ```APIDOC ## Methods ### as(...types) #### Description Casts the node to one of the provided types. #### Type Parameters - **T**: `T` extends `YTNode` - **K**: `K` extends `YTNodeConstructor[]` #### Parameters - **types**: ...`K` - The types to cast to. #### Returns - `InstanceType` - The node cast to one of the given types. #### Throws - If the node is not of the given type. #### Inherited from - GuideSection.as *** ### hasKey(key) #### Description Checks if the node has a specific key without asserting the type. #### Type Parameters - **T**: `T` extends `string` - **R**: `R` = `any` #### Parameters - **key**: `T` - The key to check. #### Returns - `this is GuideSubscriptionsSection & { [k in string]: R }` - Whether the node has the key. #### Inherited from - GuideSection.hasKey *** ### is(...types) #### Description Checks if the node is of the given type. #### Type Parameters - **T**: `T` extends `YTNode` - **K**: `K` extends `YTNodeConstructor[]` #### Parameters - **types**: ...`K` - The type to check. #### Returns - `this is InstanceType` - Whether the node is of the given type. #### Inherited from - GuideSection.is *** ### key(key) #### Description Asserts that the node has the given key and returns it, wrapped in a Maybe. #### Type Parameters - **T**: `T` extends `string` - **R**: `R` = `any` #### Parameters - **key**: `T` - The key to check. #### Returns - `Maybe` - The value of the key wrapped in a Maybe. #### Throws - If the node does not have the key. #### Inherited from - GuideSection.key ``` -------------------------------- ### get page() Source: https://github.com/luanrt/youtube.js/blob/main/docs/api/youtubei.js/namespaces/YT/classes/HomeFeed.md Retrieves the original page data. This method is inherited from FilterableFeed. ```APIDOC ## get page() ### Description Retrieves the original page data. ### Method GET ### Endpoint Not applicable (Method) ### Returns - T - The original page data. ``` -------------------------------- ### actions Source: https://github.com/luanrt/youtube.js/blob/main/docs/api/youtubei.js/namespaces/YT/classes/HashtagFeed.md Gets the Actions object associated with this feed. This accessor is inherited from FilterableFeed. ```APIDOC ## get actions() ### Description Gets the Actions object associated with this feed. ### Returns - Actions - The Actions object. ### Inherited from - FilterableFeed.actions ``` -------------------------------- ### CompactStation Constructor Source: https://github.com/luanrt/youtube.js/blob/main/docs/api/youtubei.js/namespaces/YTNodes/classes/CompactStation.md Initializes a new instance of the CompactStation class. It takes raw data as input and extends the base YTNode class. ```APIDOC ## new CompactStation(data) ### Description Initializes a new instance of the CompactStation class. ### Parameters #### data - **data** (`RawNode`) - The raw node data to initialize the CompactStation with. ### Returns - `CompactStation` - A new instance of the CompactStation class. ``` -------------------------------- ### Settings Constructor Source: https://github.com/luanrt/youtube.js/blob/main/docs/api/youtubei.js/namespaces/YT/classes/Settings.md Initializes a new instance of the Settings class. It requires an Actions instance and an ApiResponse object. ```APIDOC ## new Settings(actions, response) ### Description Initializes a new instance of the Settings class. ### Parameters #### Parameters - **actions** (`Actions`) - An instance of the Actions class. - **response** (`ApiResponse`) - The API response object. ### Returns - `Settings` - A new instance of the Settings class. ``` -------------------------------- ### getNodeSourceRange() Source: https://github.com/luanrt/youtube.js/blob/main/docs/api/youtubei.js/namespaces/JsHelpers/functions/getNodeSourceRange.md Returns the source range of an ESTree node as a tuple of start and end positions. ```APIDOC ## Function: getNodeSourceRange() > **getNodeSourceRange**(`node`): [`number`, `number`] | `null` Defined in: [src/utils/javascript/helpers.ts:130](https://github.com/LuanRT/YouTube.js/blob/853a36307b5d644ada14dcb1216c2c22c2ae7b73/src/utils/javascript/helpers.ts#L130) Returns the source range of an ESTree node as a tuple of start and end positions. ### Parameters #### node The ESTree node to extract the source range from. `Node` | `null` | `undefined` ### Returns [`number`, `number`] | `null` A tuple `[start, end]` representing the source range, or `null` if unavailable. ``` -------------------------------- ### Run Proxy Server - Deno Source: https://github.com/luanrt/youtube.js/blob/main/examples/browser/README.md Execute the Deno proxy script to handle YouTube.js requests from the browser. This requires network and read permissions. ```shell deno run --allow-net --allow-read examples/browser/proxy/deno.ts ``` -------------------------------- ### Comments API - Get Comments Source: https://github.com/luanrt/youtube.js/blob/main/examples/comments/README.md Retrieves a list of comment threads for a given video. ```APIDOC ## GET /api/comments ### Description Retrieves a list of comment threads for a given video. ### Method GET ### Endpoint /api/comments ### Parameters #### Query Parameters - **videoId** (string) - Required - The ID of the video to fetch comments for. ### Response #### Success Response (200) - **contents** (CommentThread[]) - A list of comment threads. #### Response Example ```json { "contents": [ { "comment": { "author": "User Name", "content": "This is a comment.", "published": "2023-10-27T10:00:00Z" }, "replies": [] } ] } ``` ``` -------------------------------- ### VideoInfo Constructor Source: https://github.com/luanrt/youtube.js/blob/main/docs/api/youtubei.js/namespaces/YTKids/classes/VideoInfo.md Initializes a new instance of the VideoInfo class. It takes video data, actions, and a cpn string as arguments and overrides the constructor from the MediaInfo class. ```APIDOC ## Constructor > **new VideoInfo**(`data`, `actions`, `cpn`): `VideoInfo` #### Parameters - **data** (`ApiResponse` | `ApiResponse`?): The API response data for the video. - **actions** (`Actions`): An Actions object to handle related actions. - **cpn** (`string`): The cpn (client-side tracking) identifier. #### Returns - `VideoInfo`: An instance of the VideoInfo class. ``` -------------------------------- ### Get Playlists from Memo Source: https://github.com/luanrt/youtube.js/blob/main/docs/api/youtubei.js/namespaces/YT/classes/Search.md Retrieves all playlists from a given memo object. This is a static method. ```typescript const playlists = await YT.Search.getPlaylistsFromMemo(memo); ``` -------------------------------- ### Bundle for Browser Source: https://github.com/luanrt/youtube.js/blob/main/CONTRIBUTING.md Create a browser-compatible bundle of the project. This command typically uses a bundler like Webpack or Rollup to package the code for use in web pages. ```sh npm run bundle:browser ``` -------------------------------- ### OpenOnePickAddVideoModalCommand Constructor Source: https://github.com/luanrt/youtube.js/blob/main/docs/api/youtubei.js/namespaces/YTNodes/classes/OpenOnePickAddVideoModalCommand.md Initializes a new instance of the OpenOnePickAddVideoModalCommand class. This command is used to trigger a modal dialog for adding a video, typically with a single selection option. ```APIDOC ## Class: OpenOnePickAddVideoModalCommand ### Constructor > **new OpenOnePickAddVideoModalCommand**(`data`): `OpenOnePickAddVideoModalCommand` #### Parameters ##### data - `data` (`RawNode`) - The raw node data to initialize the command with. #### Returns - `OpenOnePickAddVideoModalCommand` - An instance of the OpenOnePickAddVideoModalCommand. ### Properties #### list_id - **list_id** (`string`) - The ID of the list associated with this command. #### modal_title - **modal_title** (`string`) - The title displayed in the modal dialog. #### select_button_label - **select_button_label** (`string`) - The label for the selection button within the modal. ``` -------------------------------- ### Get Videos Source: https://github.com/luanrt/youtube.js/blob/main/docs/api/youtubei.js/namespaces/YTKids/classes/Search.md Retrieves all videos available in the feed. This method is inherited from the Feed mixin. ```APIDOC ## get videos() ### Description Get all the videos in the feed. ### Method GET ### Endpoint /videos ### Returns [`ObservedArray`](../../Helpers/type-aliases/ObservedArray.md)<[`CompactVideo`](../../YTNodes/classes/CompactVideo.md) | [`GridVideo`](../../YTNodes/classes/GridVideo.md) | [`LockupView`](../../YTNodes/classes/LockupView.md) | [`PlaylistPanelVideo`](../../YTNodes/classes/PlaylistPanelVideo.md) | [`PlaylistVideo`](../../YTNodes/classes/PlaylistVideo.md) | [`ReelItem`](../../YTNodes/classes/ReelItem.md) | [`ShortsLockupView`](../../YTNodes/classes/ShortsLockupView.md) | [`Video`](../../YTNodes/classes/Video.md) | [`WatchCardCompactVideo`](../../YTNodes/classes/WatchCardCompactVideo.md)> ``` -------------------------------- ### Get Posts Source: https://github.com/luanrt/youtube.js/blob/main/docs/api/youtubei.js/namespaces/YTKids/classes/Search.md Retrieves all community posts in the feed. This method is inherited from the Feed mixin. ```APIDOC ## get posts() ### Description Get all the community posts in the feed. ### Method GET ### Endpoint /posts ### Returns [`ObservedArray`](../../Helpers/type-aliases/ObservedArray.md)<[`BackstagePost`](../../YTNodes/classes/BackstagePost.md) | [`Post`](../../YTNodes/classes/Post.md) | [`SharedPost`](../../YTNodes/classes/SharedPost.md)> ``` -------------------------------- ### VideoPrimaryInfo Constructor Source: https://github.com/luanrt/youtube.js/blob/main/docs/api/youtubei.js/namespaces/YTNodes/classes/VideoPrimaryInfo.md Initializes a new instance of the VideoPrimaryInfo class. It takes raw node data as input and extends the base YTNode class. ```APIDOC ## Constructor > **new VideoPrimaryInfo**(`data`): `VideoPrimaryInfo` Initializes a new instance of the VideoPrimaryInfo class. ### Parameters #### data - **data** (`RawNode`) - The raw node data to initialize the class with. ### Returns - `VideoPrimaryInfo` - An instance of the VideoPrimaryInfo class. ```