Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@np-dev/youtubei-js

LuanRT46MIT8.0.0TypeScript support: included

A wrapper around YouTube's private API. Supports YouTube, YouTube Music, YouTube Kids and YouTube Studio (WIP).

yt, dl, ytdl, youtube, youtubedl, youtube-dl, youtube-downloader, youtube-music, youtube-studio, innertube, unofficial, downloader, livechat, studio, upload, ytmusic, search, music, api

readme

YouTube.js

A full-featured wrapper around the InnerTube API

CI NPM Version Codefactor Downloads Discord
Donate




Table of Contents

  1. Description
  2. Getting Started
  3. Usage
  4. Extending the library
  5. Contributing
  6. Contact
  7. Disclaimer
  8. License

Description

InnerTube is an API used by all YouTube clients. It was created to simplify the deployment of new features and experiments across the platform ^1. This library manages all low-level communication with InnerTube, providing a simple and efficient way to interact with YouTube programmatically. Its design aims to closely emulate an actual client, including the parsing of API responses.

If you have any questions or need help, feel free to reach out to us on our Discord server or open an issue here.

Getting Started

Prerequisites

YouTube.js runs on Node.js, Deno, and modern browsers.

It requires a runtime with the following features:

  • fetch
    • On Node, we use undici's fetch implementation, which requires Node.js 16.8+. If you need to use an older version, you may provide your own fetch implementation. See providing your own fetch implementation for more information.
    • The Response object returned by fetch must thus be spec compliant and return a ReadableStream object if you want to use the VideoInfo#download method. (Implementations like node-fetch returns a non-standard Readable object.)
  • EventTarget and CustomEvent are required.

Installation

# NPM
npm install youtubei.js@latest

# Yarn
yarn add youtubei.js@latest

# Git (edge version)
npm install github:LuanRT/YouTube.js

When using Deno, you can import YouTube.js directly from deno.land:

import { Innertube } from 'https://deno.land/x/youtubei/deno.ts';

Usage

Create an InnerTube instance:

// const { Innertube } = require('youtubei.js');
import { Innertube } from 'youtubei.js';
const youtube = await Innertube.create(/* options */);

Initialization Options

<summary>Click to expand</summary>
Option Type Description Default
lang string Language. en
location string Geolocation. US
account_index number The account index to use. This is useful if you have multiple accounts logged in. NOTE: Only works if you are signed in with cookies. 0
visitor_data string Setting this to a valid and persistent visitor data string will allow YouTube to give this session tailored content even when not logged in. A good way to get a valid one is by either grabbing it from a browser or calling InnerTube's /visitor_id endpoint. undefined
retrieve_player boolean Specifies whether to retrieve the JS player. Disabling this will make session creation faster. NOTE: Deciphering formats is not possible without the JS player. true
enable_safety_mode boolean Specifies whether to enable safety mode. This will prevent the session from loading any potentially unsafe content. false
generate_session_locally boolean Specifies whether to generate the session data locally or retrieve it from YouTube. This can be useful if you need more performance. false
device_category DeviceCategory Platform to use for the session. DESKTOP
client_type ClientType InnerTube client type. WEB
timezone string The time zone. *
cache ICache Used to cache the deciphering functions from the JS player. undefined
cookie string YouTube cookies. undefined
fetch FetchFunction Fetch function to use. fetch

Browser Usage

To use YouTube.js in the browser, you must proxy requests through your own server. You can see our simple reference implementation in Deno at examples/browser/proxy/deno.ts.

You may provide your own fetch implementation to be used by YouTube.js, which we will use to modify and send the requests through a proxy. See examples/browser/web for a simple example using Vite.

// Multiple exports are available for the web.
// Unbundled ESM version
import { Innertube } from 'youtubei.js/web';
// Bundled ESM version
// import { Innertube } from 'youtubei.js/web.bundle';
// Production Bundled ESM version
// import { Innertube } from 'youtubei.js/web.bundle.min';
await Innertube.create({
  fetch: async (input: RequestInfo | URL, init?: RequestInit) => {
    // Modify the request
    // and send it to the proxy

    // fetch the URL
    return fetch(request, init);
  }
});

Streaming

YouTube.js supports streaming of videos in the browser by converting YouTube's streaming data into an MPEG-DASH manifest.

The example below uses dash.js to play the video.

import { Innertube } from 'youtubei.js/web';
import dashjs from 'dashjs';

const youtube = await Innertube.create({ /* setup - see above */ });

// Get the video info
const videoInfo = await youtube.getInfo('videoId');

// now convert to a dash manifest
// again - to be able to stream the video in the browser - we must proxy the requests through our own server
// to do this, we provide a method to transform the URLs before writing them to the manifest
const manifest = await videoInfo.toDash(url => {
  // modify the url
  // and return it
  return url;
});

const uri = "data:application/dash+xml;charset=utf-8;base64," + btoa(manifest);

const videoElement = document.getElementById('video_player');

const player = dashjs.MediaPlayer().create();
player.initialize(videoElement, uri, true);

A fully working example can be found in examples/browser/web.

Providing your own fetch implementation

You may provide your own fetch implementation to be used by YouTube.js. This can be useful in some cases to modify the requests before they are sent and transform the responses before they are returned (eg. for proxies).

// provide a fetch implementation
const yt = await Innertube.create({
  fetch: async (input: RequestInfo | URL, init?: RequestInit) => {
    // make the request with your own fetch implementation
    // and return the response
    return new Response(
      /* ... */
    );
  }
});

Caching

Caching the transformed player instance can greatly improve the performance. Our UniversalCache implementation uses different caching methods depending on the environment.

In Node.js, we use the node:fs module, Deno.writeFile() in Deno, and indexedDB in browsers.

By default, the cache stores data in the operating system's temporary directory (or indexedDB in browsers). You can make this cache persistent by specifying the path to the cache directory, which will be created if it doesn't exist.

import { Innertube, UniversalCache } from 'youtubei.js';
// Create a cache that stores files in the OS temp directory (or indexedDB in browsers) by default.
const yt = await Innertube.create({
  cache: new UniversalCache(false)
});

// You may want to create a persistent cache instead (on Node and Deno).
const yt = await Innertube.create({
  cache: new UniversalCache(
    // Enables persistent caching
    true, 
    // Path to the cache directory. The directory will be created if it doesn't exist
    './.cache' 
  )
});

API

<summary>Methods</summary>

getInfo(target, client?)

Retrieves video info.

Returns: Promise<VideoInfo>

Param Type Description
target string | NavigationEndpoint If string, the id of the video. If NavigationEndpoint, the endpoint of watchable elements such as Video, Mix and Playlist. To clarify, valid endpoints have payloads containing at least videoId and optionally playlistId, params and index.
client? InnerTubeClient WEB, ANDROID, YTMUSIC, YTMUSIC_ANDROID or TV_EMBEDDED
<summary>Methods & Getters</summary>

  • <info>#like()

    • Likes the video.
  • <info>#dislike()

    • Dislikes the video.
  • <info>#removeRating()

    • Removes like/dislike.
  • <info>#getLiveChat()

    • Returns a LiveChat instance.
  • <info>#getTrailerInfo()

    • Returns trailer info in a new VideoInfo instance, or null if none. Typically available for non-purchased movies or films.
  • <info>#chooseFormat(options)

    • Used to choose streaming data formats.
  • <info>#toDash(url_transformer?, format_filter?)

    • Converts streaming data to an MPEG-DASH manifest.
  • <info>#download(options)

  • <info>#getTranscript()

    • Retrieves the video's transcript.
  • <info>#filters

    • Returns filters that can be applied to the watch next feed.
  • <info>#selectFilter(name)

    • Applies the given filter to the watch next feed and returns a new instance of VideoInfo.
  • <info>#getWatchNextContinuation()

    • Retrieves the next batch of items for the watch next feed.
  • <info>#addToWatchHistory()

    • Adds the video to the watch history.
  • <info>#autoplay_video_endpoint

    • Returns the endpoint of the video for Autoplay.
  • <info>#has_trailer

    • Checks if trailer is available.
  • <info>#page

    • Returns original InnerTube response (sanitized).

getBasicInfo(video_id, client?)

Suitable for cases where you only need basic video metadata. Also, it is faster than getInfo().

Returns: Promise<VideoInfo>

Param Type Description
video_id string The id of the video
client? InnerTubeClient WEB, ANDROID, YTMUSIC_ANDROID, YTMUSIC, TV_EMBEDDED

search(query, filters?)

Searches the given query on YouTube.

Returns: Promise<Search>

Note Search extends the Feed class.

Param Type Description
query string The search query
filters? SearchFilters Search filters
<summary>Search Filters</summary>
Filter Type Value Description
upload_date string all | hour | today | week | month | year Filter by upload date
type string all | video | channel | playlist | movie Filter by type
duration string all | short | medium | long Filter by duration
sort_by string relevance | rating | upload_date | view_count Sort by
features string[] hd | subtitles | creative_commons | 3d | live | purchased | 4k | 360 | location | hdr | vr180 Filter by features
<summary>Methods & Getters</summary>

  • <search>#selectRefinementCard(SearchRefinementCard | string)

    • Applies given refinement card and returns a new Search instance.
  • <search>#refinement_card_queries

    • Returns available refinement cards, this is a simplified version of the refinement_cards object.
  • <search>#getContinuation()

    • Retrieves next batch of results.

getSearchSuggestions(query)

Retrieves search suggestions for given query.

Returns: Promise<string[]>

Param Type Description
query string The search query

getComments(video_id, sort_by?)

Retrieves comments for given video.

Returns: Promise<Comments>

Param Type Description
video_id string The video id
sort_by string Can be: TOP_COMMENTS or NEWEST_FIRST

See ./examples/comments for examples.

getHomeFeed()

Retrieves YouTube's home feed.

Returns: Promise<HomeFeed>

Note HomeFeed extends the FilterableFeed class.

<summary>Methods & Getters</summary>

  • <home_feed>#videos

    • Returns all videos in the home feed.
  • <home_feed>#posts

    • Returns all posts in the home feed.
  • <home_feed>#shelves

    • Returns all shelves in the home feed.
  • <home_feed>#filters

    • Returns available filters.
  • <home_feed>#applyFilter(name | ChipCloudChip)

    • Applies given filter and returns a new HomeFeed instance.
  • <home_feed>#getContinuation()

    • Retrieves feed continuation.

getGuide()

Retrieves YouTube's content guide.

Returns: Promise<Guide>

getLibrary()

Retrieves the account's library.

Returns: Promise<Library>

Note Library extends the Feed class.

<summary>Methods & Getters</summary>

  • <library>#history
  • <library>#watch_later
  • <library>#liked_videos
  • <library>#playlists_section
  • <library>#clips

getHistory()

Retrieves watch history.

Returns: Promise<History>

Note History extends the Feed class.

<summary>Methods & Getters</summary>

  • <history>#getContinuation()
    • Retrieves next batch of contents.

getTrending()

Retrieves trending content.

Returns: Promise<TabbedFeed<IBrowseResponse>>

getSubscriptionsFeed()

Retrieves the subscriptions feed.

Returns: Promise<Feed<IBrowseResponse>>

getChannel(id)

Retrieves contents for a given channel.

Returns: Promise<Channel>

Note Channel extends the TabbedFeed class.

Param Type Description
id string Channel id
<summary>Methods & Getters</summary>

  • <channel>#getVideos()
  • <channel>#getShorts()
  • <channel>#getLiveStreams()
  • <channel>#getReleases()
  • <channel>#getPodcasts()
  • <channel>#getPlaylists()
  • <channel>#getHome()
  • <channel>#getCommunity()
  • <channel>#getChannels()
  • <channel>#getAbout()
  • <channel>#search(query)
  • <channel>#applyFilter(filter)
  • <channel>#applyContentTypeFilter(content_type_filter)
  • <channel>#applySort(sort)
  • <channel>#getContinuation()
  • <channel>#filters
  • <channel>#content_type_filters
  • <channel>#sort_filters
  • <channel>#page

See ./examples/channel for examples.

getNotifications()

Retrieves notifications.

Returns: Promise<NotificationsMenu>

<summary>Methods & Getter</summary>

  • <notifications>#getContinuation()
    • Retrieves next batch of notifications.

getUnseenNotificationsCount()

Retrieves unseen notifications count.

Returns: Promise<number>

getPlaylist(id)

Retrieves playlist contents.

Returns: Promise<Playlist>

Note Playlist extends the Feed class.

Param Type Description
id string Playlist id
<summary>Methods & Getter</summary>

  • <playlist>#items
    • Returns the items of the playlist.

getHashtag(hashtag)

Retrieves a given hashtag's page.

Returns: Promise<HashtagFeed>

Note HashtagFeed extends the FilterableFeed class.

Param Type Description
hashtag string The hashtag
<summary>Methods & Getter</summary>

  • <hashtag>#applyFilter(filter)
    • Applies given filter and returns a new HashtagFeed instance.
  • <hashtag>#getContinuation()
    • Retrieves next batch of contents.

getStreamingData(video_id, options)

Returns deciphered streaming data.

Note This method will be deprecated in the future. We recommend retrieving streaming data from a VideoInfo or TrackInfo object instead if you want to select formats manually. Please refer to the following example:

const info = await yt.getBasicInfo('somevideoid');

const url = info.streaming_data?.formats[0].decipher(yt.session.player);
console.info('Playback url:', url);

// or:
const format = info.chooseFormat({ type: 'audio', quality: 'best' });
const url = format?.decipher(yt.session.player);
console.info('Playback url:', url);

Returns: Promise<object>

Param Type Description
video_id string Video id
options FormatOptions Format options

download(video_id, options?)

Downloads a given video.

Returns: Promise<ReadableStream<Uint8Array>>

Param Type Description
video_id string Video id
options DownloadOptions Download options

See ./examples/download for examples.

resolveURL(url)

Resolves a given url.

Returns: Promise<NavigationEndpoint>

Param Type Description
url string Url to resolve

call(endpoint, args?)

Utility to call navigation endpoints.

Returns: Promise<T extends IParsedResponse | IParsedResponse | ApiResponse>

Param Type Description
endpoint NavigationEndpoint The target endpoint
args? object Additional payload arguments

Extending the library

YouTube.js is modular and easy to extend. Most of the methods, classes, and utilities used internally are exposed and can be used to implement your own extensions without having to modify the library's source code.

For example, let's say we want to implement a method to retrieve video info. We can do that by using an instance of the Actions class:

import { Innertube } from 'youtubei.js';

(async () => {
  const yt = await Innertube.create();

  async function getVideoInfo(videoId: string) {
    const videoInfo = await yt.actions.execute('/player', {
      // You can add any additional payloads here, and they'll merge with the default payload sent to InnerTube.
      videoId,
      client: 'YTMUSIC', // InnerTube client options: ANDROID, YTMUSIC, YTMUSIC_ANDROID, WEB, or TV_EMBEDDED.
      parse: true // tells YouTube.js to parse the response (not sent to InnerTube).
    });

    return videoInfo;
  }

  const videoInfo = await getVideoInfo('jLTOuvBTLxA');
  console.info(videoInfo);
})();

Alternatively, suppose we locate a NavigationEndpoint in a parsed response and want to see what happens when we call it:

import { Innertube, YTNodes } from 'youtubei.js';

(async () => {
  const yt = await Innertube.create();

  const artist = await yt.music.getArtist('UC52ZqHVQz5OoGhvbWiRal6g');
  const albums = artist.sections[1].as(YTNodes.MusicCarouselShelf);

  // Let's imagine that we wish to click on the “More” button:
  const button = albums.as(YTNodes.MusicCarouselShelf).header?.more_content;

  if (button) {
    // Having ensured that it exists, we can then call its navigation endpoint using the following code:
    const page = await button.endpoint.call(yt.actions, { parse: true });
    console.info(page);
  }
})();

Parser

YouTube.js' parser enables you to parse InnerTube responses and convert their nodes into strongly-typed objects that are simple to manipulate. Additionally, it provides numerous utility methods that make working with InnerTube a breeze.

Here's an example of its usage:

// See ./examples/parser

import { Parser, YTNodes } from 'youtubei.js';
import { readFileSync } from 'fs';

// YouTube Music's artist page response
const data = readFileSync('./artist.json').toString();

const page = Parser.parseResponse(JSON.parse(data));

const header = page.header?.item().as(YTNodes.MusicImmersiveHeader, YTNodes.MusicVisualHeader);

console.info('Header:', header);

// The parser uses a proxy object to add type safety and utility methods for working with InnerTube's data arrays:
const tab = page.contents?.item().as(YTNodes.SingleColumnBrowseResults).tabs.firstOfType(YTNodes.Tab);

if (!tab)
  throw new Error('Target tab not found');

if (!tab.content)
  throw new Error('Target tab appears to be empty');

const sections = tab.content?.as(YTNodes.SectionList).contents.as(YTNodes.MusicCarouselShelf, YTNodes.MusicDescriptionShelf, YTNodes.MusicShelf);

console.info('Sections:', sections);

Documentation for the parser can be found here.

Contributing

We welcome all contributions, issues and feature requests, whether small or large. If you want to contribute, feel free to check out our issues page and our guidelines.

We are immensely grateful to all the wonderful people who have contributed to this project. A special shoutout to all our contributors! 🎉

Contact

LuanRT - @thesciencephile - luanrt@thatsciencephile.com

Project Link: https://github.com/LuanRT/YouTube.js

Disclaimer

This project is not affiliated with, endorsed, or sponsored by YouTube or any of its affiliates or subsidiaries. All trademarks, logos, and brand names used in this project are the property of their respective owners and are used solely to describe the services provided.

As such, any usage of trademarks to refer to such services is considered nominative use. If you have any questions or concerns, please contact me directly via email.

License

Distributed under the MIT License.

(back to top)

changelog

Changelog

13.4.0 (2025-04-23)

Features

  • MultiPageMenuNotificationSection: Add notification_section_title (f869011)
  • Parser: Add OpenOnePickAddVideoModalCommand node (#901) (ff1aa67)
  • parser: Parse targetId (458c490)
  • RichRenderers: Parse more UI elements (d8f731b)
  • RichShelf: Add icon_type property (dce51cd)
  • Session: Add deviceExperimentId and rolloutToken to session data (c704836)
  • Session: Add retrieve_innertube_config option (#949) (4808d2e)
  • Session: Add option to override Player ID (#951) (5e665e8)
  • Text: Parse accessibility data (a95f52a)

Bug Fixes

  • HTTPClient: Use the correct constant for the iOS client OS name (#938) (95d9211)
  • Player: Use global var to find signature algorithm (#953) (7f1eeb6)

13.3.0 (2025-03-25)

Features

  • MusicImmersiveHeader: Parse buttons and menu (cbb2535)

Bug Fixes

  • Player: Parse global variable used by nsig/sig (#935) (edfd65f)

13.2.0 (2025-03-20)

Features

  • Add AccessibilityContext and CommandContext classes + improve type definitions and parsing logic across multiple nodes (923e9c2)

Bug Fixes

  • Constants: Update the iOS client version (#924) (219d88b)
  • Format: Parse xtags from protobuf to support SABR-only responses (#909) (00c199a)

13.1.0 (2025-02-21)

Features

  • Channel: Add getCourses method (#883) (b3a4862)
  • CommentView: Parse prepareAccountCommand (d0d48bf)
  • CommentView: Parse some extra tooltips (32125c7)
  • CompactLink: Parse subtitle, iconType, and iconType (6d57353)
  • FormatUtils: choose more specific format by itag or codec (#884) (1c1577e)
  • parser: Add AnimatedThumbnailOverlayView (#903) (0cb92d9)

Bug Fixes

  • dependencies: Update jintr to version 3.2.1 (02dfcae)
  • DialogView: Type mismatch (#897) (b731db8)
  • FormatUtils: itag matching (#886) (774b3a7)
  • innertube: Allowing getStreamingData to use client (#895) (5aecd0a)
  • Innertube: Properly encoded params in getPost() (#882) (7d5c972)
  • LockupMetadataView: Parse menuButton (3ffdee9)
  • LockupView: Add overlay nodes used by VIDEO views (424c653)
  • LockupView: Fix content_image parsing (083aec1)
  • music#getPlaylist: Handle ContinuationItem nodes (a3fafe2), closes #904
  • Parser: Add UpdateEngagementPanelContentCommand (3f960ef)
  • Playlist: is_editable (#894) (2b42199)

Reverts

  • "fix(toDash): Fix default audio stream for dubbed movie trailers (#858)" (#896) (4325717)

13.0.0 (2025-01-20)

⚠ BREAKING CHANGES

  • Remove web.bundle.min

Features

  • ContentMetadataView: Parse enableTruncation (#863) (0a3104b)
  • getSearchSuggestions: Add optional pq param for better suggestions (c61db19)
  • Innertube: Add getAttestationChallenge (#869) (33c27dd)
  • Innertube: Add ability to get individual community posts and community post comments (#861) (360b29e)
  • LiveChatPaidMessage: Parse headerOverlayImage and lowerBumper (#851) (ef37aa0)
  • Music: Add continuation support for "Up next" tab in TrackInfo (#770) (2913d5f)
  • PageHeaderView: Parse heroImage (a602a31)
  • Parser: Add AvatarStackView (c631022)
  • Parser: Add HowThisWasMadeSectionView node (5da8a66)
  • parser: Add ReplaceLiveChatAction (#847) (342fdd1)
  • Parser: Implement utility class to parse rendererContext (3a11b99)
  • parser: Parse OpenPopupAction in onResponseReceivedEndpoints arrays (45b7342)
  • Parser: Parse YpcTrailer in VideoInfo (#842) (c0043d0)
  • parser: Update Button (#857) (5f899fc)
  • parser: Update LiveChatPaidMessage (#846) (73362c6)
  • parser: Update LiveChatPaidSticker (#849) (3c28c0d)
  • parser: Update LiveChatTextMessage (#864) (9025122)
  • parser: Update LiveChatTickerPaidMessageItem (#845) (29e8d30)
  • parser: Update LiveChatTickerPaidStickerItem (#848) (5f83a74)
  • parser: Update LiveChatViewerEngagementMessage (#856) (b4a947a)
  • Playlists: Implement addToLibrary and removeFromLibrary (#844) (48460e4)
  • RichGrid: Parse targetId (e571ee2)
  • Session: Allow using a fixed user agent for InnerTube requests (#876) (4d36655)
  • SubscribeButton: Add unsubscribe_text (75b8964)
  • ToggleButtonView: Add is_toggled (88af6d8)

Bug Fixes

  • ButtonCardView: Correct typo (#855) (6536801)
  • DescriptionPreviewView: Parsing errors when certain fields are missing (c2dd803)
  • getSearchSuggestions: Allow empty queries (523700b)
  • LiveChatTextMessage: Make some fields optional (#877) (a035b71)
  • sendMessage: Handle RunAttestationCommand in response actions (#859) (826a954)
  • Text#fromAttributed: Fix StyleRun assuming that the startIndex and length always exist (#862) (732a30c)
  • Text#toHTML: Return empty string if the text is undefined (f3c777b)
  • TextRun: Add img element only if an URL is available (913dcc7)
  • toDash: Fix default audio stream for dubbed movie trailers (#858) (0054690)

Performance Improvements

  • constants: Move the client name IDs into their own CLIENT_NAME_IDS object (#875) (06887e9)
  • Optimise DASH manifest generation (#870) (1a3d663)

Code Refactoring

12.2.0 (2024-12-12)

Features

  • Actions: Allow auth check to be skipped (67f13ff)
  • add VideoMetadataCarouselView (#839) (9a9bb76)
  • parser: Add ActiveAccountHeader (5f233ae)
  • parser: Add ButtonCardView (#834) (eeaae62)
  • parser: Add ClientSideToggleMenuItem (#835) (0b2b0da)
  • parser: Add PlaylistThumbnailOverlay (c8173c8)
  • parser: Update LiveChatBanner (#840) (69d42b2)
  • parser: Update LiveChatMembershipItem (#836) (0c319aa)

Bug Fixes

  • Player: Fix signature algorithm extraction again (#837) (13e7961)

12.1.0 (2024-12-10)

Features

Bug Fixes

  • Player: Bump cache version (283172f)
  • Player: Fix signature algorithm extraction (#832) (ce4996c)

12.0.0 (2024-12-05)

⚠ BREAKING CHANGES

  • parser: Remove old comment node
  • Log: Convert Log class to module (#814)
  • parser: Remove getters that have been deprecated for a long time (#815)
  • parser: Implement endpoint/command parsers (#812)

Features

  • account: Add missing property channel_handle (#789) (677e1f0)
  • Add getCourses (#798) (cfb48fa)
  • EngagementPanelTitleHeader: Add contextual_info and menu (af3a916)
  • Log: Convert Log class to module (#814) (fc55716)
  • NavigationEndpoint: Add name property (bdebb9f)
  • parser: Add AddToPlaylist node (2940f7b)
  • parser: Add animated_image to PageHeaderView (#819) (8e50ebd)
  • parser: Add ChangeEngagementPanelVisibilityAction (c2b2d7a)
  • parser: Add ChangeEngagementPanelVisibilityEndpoint (2824900)
  • parser: Add LiveChatBannerChatSummary node, update TextRun node (#809) (7fb00fa)
  • parser: Add LiveChatBannerRedirect node (#799) (ad302b8)
  • parser: add LiveChatModeChangeMessage node (#811) (7156a58)
  • parser: Add LiveChatSponsorshipsGiftPurchaseAnnouncement and LiveChatSponsorshipsHeader nodes (#793) (4e9c2a5)
  • parser: Add LiveChatSponsorshipsGiftRedemptionAnnouncement node (#795) (20f7971)
  • parser: Add MenuFlexibleItem (bc9a0ed)
  • parser: Add NotificationAction node (d36ddb8)
  • parser: Add PlayerOverlayVideoDetails node (dc2ed04)
  • parser: Add RunAttestationCommand (4729016)
  • parser: Add ShowEngagementPanelEndpoint (ec85b0f)
  • parser: Add SignalAction node (feeb21b)
  • parser: Add UnifiedSharePanel (4a1397f)
  • parser: Add UpdateSubscribeButtonAction (fdb7540)
  • parser: Add VideoViewCount node (ad448f8)
  • parser: Add optional image property to LockupMetadataView (#806) (0914299)
  • Parser: add support for parsing subtitle for RichShelf (#805) (038efff)
  • Parser: Add support for parsing subtitle for Shelf (#792) (34ae38c)
  • SubscribeButton: Parse more endpoints (8bf9eb7)
  • VideoViewCount: Add extra_short_view_count field (d10fe68)

Bug Fixes

  • ExpandableVideoDescriptionBody: Parse attributed description (360580e)
  • parser: The AvatarView.image_processor property is optional (#807) (4b178e4)
  • parser: Update list of possible content_type in LockupView (#808) (680da9f)
  • Player: Add more ways to find the nsig algo (acfb0c5)
  • PlaylistAddToOption: Use correct type for contains_selected_videos (53d1c75)
  • ReelPlayerOverlay: Update subscribe_button_renderer type to include SubscribeButton (daa5a29)
  • SignalAction: Rename action to signal (8ab760e)
  • SubscribeButton: Parse endpoints using NavigationEndpoint (126a66f)
  • UnifiedSharePanel: Check if thirdPartyNetworkSection exists (d3f6af0)
  • VideoAttributeView: Parse secondarySubtitle only if exists (0a99342)
  • VideoCard: fix parsing author, view count and published date (#791) (a4394db)
  • VideoSecondaryInfo: Parse show_more_text and show_less_text correctly (790f817)

Miscellaneous Chores

  • parser: Remove getters that have been deprecated for a long time (#815) (9cf0d3f)

Code Refactoring

  • parser: Implement endpoint/command parsers (#812) (7397aa3)
  • parser: Remove old comment node (2f087d4)

11.0.1 (2024-10-28)

Bug Fixes

  • VideoInfo: Fix like count being undefined (#787) (182bf42)

11.0.0 (2024-10-28)

⚠ BREAKING CHANGES

  • Deprecate account#getAnalytics, account#getTimeWatched and account#getAnalytics

Features

  • Add TVHTML5 InnerTube client (b45609a)
  • Add WEB_CREATOR client (#757) (dd7f5cf)
  • history: Add ability to remove videos from watch history (#706) (22dd71d)
  • ProtoUtils: Add support for creating NextParams (#762) (910c979)
  • Support auto-dubbed audio tracks (#786) (a4ef224)

Bug Fixes

  • fix deno usage of protobuf and jintr (#776) (02513b7)
  • Include jinter in the cjs build (305a398)
  • InteractionManager: Use WEB for all actions (d9ac99d)
  • LiveChat#sendMessage: Switch to WEB client (bb3f114)
  • package: Use jsr:@luanrt/jintr on Deno (d9ec23c)
  • parser: Fix ShortsLockupView assuming that the primary text always exists (#775) (43cef9e)
  • toDash: Fix dash.js 4.x compatibility (#765) (5ff30e1)

Code Refactoring

  • Deprecate account#getAnalytics, account#getTimeWatched and account#getAnalytics (0081e11)

10.5.0 (2024-09-19)

Features

  • Add WEB_EMBEDDED client (#756) (eaf218f)
  • extend music getInfo to allow MusicResponsiveListItem and Nav Endpoints (#751) (5db449c)
  • parser: Add ShortsLockupView and BadgeView nodes (#746) (e1e76ee)

Bug Fixes

  • ItemSection: FeedFilterChipBar parse error (#741) (bf6cc00)
  • parser: The icon_name property does not always exist in ThumbnailBadgeView (#745) (094a96f)
  • Session: Set default values for hl and gl in context builder (7a39326)

10.4.0 (2024-08-27)

Features

  • parser: Add VideoAttributesSectionView node (#732) (4b60b97)
  • Player: Add support for Proof of Identity tokens (#708) (c9f0ddd)
  • Utils: Add UMP parser (261f2ac)

Bug Fixes

  • examples: Use BgUtils to generate pot [skip ci] (d89909a)
  • FormatOptions: client missing some values (fcd00b0)
  • PlayerEndpoint: Don't set undefined fields (0e91a08)
  • Search: Fix it occasionally returning only a small number of results (#720) (2c0bb23)
  • Session: PoToken not being set correctly (#729) (bb6e647)
  • Session: Fix remote visitor data not gettting used (#731) (7afc3da)
  • Session: Visitor data not being used properly (f1973c1)
  • ThumbnailOverlayResumePlayback: Update percent_duration_watched type (#737) (f9ccba4)

10.3.0 (2024-08-01)

Features

  • parser: Add EomSettingsDisclaimer node (#703) (a9bf225)
  • PlaylistManager: Add ability to remove videos by set ID (#715) (d85fbc5)

Bug Fixes

  • HTTPClient: Adjust more context fields for the iOS client (#705) (3153375)

10.2.0 (2024-07-25)

Features

  • Format: Add is_secondary for detecting secondary audio tracks (#697) (a352dde)
  • parser: add classdata to unhandled parse errors (#691) (090539b)
  • proto: Add comment_id to commentSectionParams (#693) (a5f6209)

Bug Fixes

  • parser: ignore MiniGameCardView node (#692) (6d0bc89)
  • parser: ThumbnailView background color (#686) (0f8f92a)
  • Player: Bump cache version (#702) (6765f4e)
  • Player: Fix extracting the n-token decipher algorithm again (#701) (3048f70)

10.1.0 (2024-07-10)

Features

  • Session: Add configInfo to InnerTube context (5a8fd3a)
  • toDash: Add option to include WebVTT or TTML captions (#673) (bd9f6ac)
  • toDash: Add the "dub" role to translated captions (#677) (858cdd1)

Bug Fixes

  • FormatUtils: Throw an error if download requests fails (a19511d)
  • InfoPanelContent: Update InfoPanelContent node to also support paragraphs (4cbaa79)
  • Player: Fix extracting the n-token decipher algorithm (#682) (142a7d0)
  • proto: Update Context message (62ac2f6), closes #681
  • Session: Round UTC offset minutes (84f90aa)
  • toDash: Fix image representations not being spec compliant (#672) (e5aab9a)
  • YTMusic: Add support for new header layouts (14c3a06)

10.0.0 (2024-06-09)

⚠ BREAKING CHANGES

  • Innertube#getPlaylists: Return a Feed instance instead of items
  • OAuth2: Rewrite auth module (#661)

Features

Bug Fixes

  • ButtonView: Rename type property to button_type (15f3b5f)
  • Cache: Use TextEncoder to encode compressed data (384b80e)
  • FlexibleActionsView: Update actions array type to include ToggleButtonView (040a091)
  • InfoPanelContainer: Use new attributed text prop (5cdb9e1)
  • ItemSection: Fix target_id not being set because of a typo. (#655) (8106654)
  • MusicResponsiveHeader: Add Text import (583fd9f)

Performance Improvements

  • general: Add session cache and LZW compression (#663) (cf29664)

Code Refactoring

  • Innertube#getPlaylists: Return a Feed instance instead of items (7660450)
  • OAuth2: Rewrite auth module (#661) (b6ce5f9)

9.4.0 (2024-04-29)

Features

  • Format: Add projection_type and stereo_layout (#643) (064436c)
  • Format: Add spatial_audio_type (#647) (0ba8c54)
  • Parser: Add MusicResponsiveHeader node (ea82bea)

9.3.0 (2024-04-11)

Features

  • CommentView: Implement comment interaction methods (1c08bfe)

Bug Fixes

  • CommentThread: Replies not being parsed correctly (66e34f9)

9.2.1 (2024-04-09)

Bug Fixes

  • toDash: Add missing transfer characteristics for h264 streams (#631) (0107049)

9.2.0 (2024-03-31)

Features

  • add support of cloudflare workers (#596) (2029aec)
  • parser: Support CommentView nodes (#614) (900f557)
  • parser: Support LockupView and it's child nodes (#609) (7ca2a0c)
  • Text: Support formatting and emojis in fromAttributed (#615) (e6f1f07)

Bug Fixes

  • Cache: handle the value read from the db correctly according to its type (#620) (3170659)
  • PlayerEndpoint: Workaround for "The following content is not available on this app" (Android) (#624) (d589365)

9.1.0 (2024-02-23)

Features

  • Format: Support caption tracks in adaptive formats (#598) (bff65f8)

Bug Fixes

  • Playlist: items getter failing if a playlist contains Shorts (89fa3b2)
  • Session: Don't try to extract api version from service worker (2068dfb)

9.0.2 (2024-01-31)

Bug Fixes

  • VideoInfo: Fix error because of typo in getWatchNextContinuation (#590) (b21eb9f)

9.0.1 (2024-01-26)

Bug Fixes

  • build: Circular imports causing issues with webpack (81dd5d3)

9.0.0 (2024-01-25)

⚠ BREAKING CHANGES

  • toDash: Add support for generating manifests for Post Live DVR videos (#580)

Features

  • Channel: Support getting about with PageHeader (#581) (2e710dc)
  • Channel: Support PageHeader being used on user channels (#577) (6082b4a)
  • Format: Add max_dvr_duration_sec and target_duration_dec (#570) (586bb5f)
  • parser: Add ImageBannerView (#583) (2073aa9)
  • toDash: Add support for generating manifests for Post Live DVR videos (#580) (6dd03e1)
  • VideoDetails: Add is_live_dvr_enabled, is_low_latency_live_stream and live_chunk_readahead (#569) (254f779)
  • VideoInfo: Add live stream end_timestamp (#571) (562e6a2)

Bug Fixes

  • DecoratedAvatarView: Fix parsing and optional properties (#584) (fed3512)
  • PlayerCaptionTracklist: Fix captions_tracks[].kind type (#586) (7fbc37f)
  • proto: Fix visitor data base64url decoding (#576) (3980f97)
  • toDash: Add missing transfer characteristics for h264 streams (#573) (59f4cfb)

8.2.0 (2024-01-08)

Features

  • OAuth: Allow passing custom client identity (#566) (7ffd0fc)

Bug Fixes

8.1.0 (2023-12-27)

Features

  • generator: add support for arrays (#556) (e4f2a00)
  • generator: Add support for generating view models (#550) (f938c34)
  • MediaInfo: Parse player config (5c9c231)
  • parser: Support new like and dislike nodes (#557) (fcd3044)
  • Thumbnail: Support sources in Thumbnail.fromResponse (#552) (48a5d4e)
  • YouTube: Add FEchannels feed (#560) (14578ac)

Bug Fixes

  • Format: Extract correct audio language from captions (#553) (5c83e99)
  • generator: Output Parser.parseItem() calls with one valid type, without the array (#551) (bd487f8)
  • VideoInfo: Restore like, dislike & removeRating methods (9c503f4)

8.0.0 (2023-12-01)

⚠ BREAKING CHANGES

  • Library: Add support for the new layout and remove profile & stats info
  • Channel: YouTube removed the "Channels" tab on channels, so this pull request removes the getChannels() method and has_channels getter from the YT.Channel class, as they are no longer useful. The featured channels are now shown on the channel home tab. To get them you can use the channels getter on the home tab of the channel. Please note that some channel owners might not have added that section to their home page yet, so you won't be able to get the featured channels for those channels. The home tab is the default tab that is returned when you call InnerTube#getChannel(), you can also access that tab by calling getHome() on a YT.Channel object.

Features

Bug Fixes

  • Channel: Remove getChannels() and has_channels, as YouTube removed the tab (#542) (6a5a579)
  • Library: Add support for the new layout and remove profile & stats info (4261915)
  • StructuredDescriptionContent: Add ReelShelf to list of possible nodes (f74ed5a)
  • VideoAttributeView: Fix image and overflow_menu_on_tap props (5ae15be)

Performance Improvements

  • Use named Parser import, to allow bundlers to create direct function references (#535) (95ed602)

7.0.0 (2023-10-28)

⚠ BREAKING CHANGES

  • music#getSearchSuggestions: Return array of SearchSuggestionsSection instead of a single node

Features

  • Kids: Add blockChannel command to easily block channels (#503) (9ab528e)
  • music#getSearchSuggestions: Return array of SearchSuggestionsSection instead of a single node (beaa28f)
  • parser: Add PlayerOverflow and PlayerControlsOverlay (a45273f)
  • UpdateViewerShipAction: Add original_view_count and unlabeled_view_count_value (#527) (bc97e07)

Bug Fixes

  • build: Inline package.json import to avoid runtime erros (#509) (4c0de19)

6.4.1 (2023-10-02)

Bug Fixes

  • Feed: Do not throw when multiple continuations are present (8e372d5)
  • Playlist: Throw a more helpful error when parsing empty responses (987f506)

Performance Improvements

  • Cache deciphered n-params by info response (#505) (d2959b3)
  • generator: Remove duplicate checks in isMiscType (#506) (68df321)

6.4.0 (2023-09-10)

Features

  • Add support for retrieving transcripts (#500) (f94ea6c)
  • PlaylistManager: add .setName() and .setDescription() functions for editing playlists (#498) (86fb33e)

Bug Fixes

  • BackstagePost: vote_button type mismatch (fba3fc9)

6.3.0 (2023-08-31)

Features

  • ChannelMetadata: Add music_artist_name (#497) (91de6e5)
  • Session: Add on_behalf_of_user session option. (#494) (8bc2aaa)

Bug Fixes

  • CompactMovie: Add missing import and remove unnecessary console.log (#496) (c26972c)

6.2.0 (2023-08-29)

Features

  • Session: Add fallback for session data retrieval (#490) (10c15bf)

Bug Fixes

  • Format: Fix is_original always being true (#492) (0412fa0)

6.1.0 (2023-08-27)

Features

6.0.2 (2023-08-24)

Bug Fixes

6.0.1 (2023-08-22)

Bug Fixes

  • SearchSubMenu: Groups not being parsed due to a typo (90be877)

6.0.0 (2023-08-18)

⚠ BREAKING CHANGES

  • replace unnecessary classes with pure functions (#468)

Features

  • MusicResponsiveListItem: Detect non music tracks properly (815e54b)
  • parser: add MusicMultiRowListItem (494ee87)
  • Session: Add IOS to ClientType enum (22a38c0)
  • VideoInfo: support iOS client (#467) (46fe18b)

Bug Fixes

  • Format: Extracting audio language from captions (#470) (31d27b1)
  • parser: Allow any property in the RawResponse interface (3bc53a8)
  • parser: Logger logging classdata as [Object object] (bf1510b)
  • Playlist: Only try extracting the subtitle for the first page (#465) (e370116)
  • toDash: Format grouping into AdaptationSets (#462) (1ff3e1a)

Performance Improvements

  • Cleanup some unnecessary uses of YTNode#key and Maybe (#463) (0dda97e)

Code Refactoring

  • replace unnecessary classes with pure functions (#468) (87ed396)

5.8.0 (2023-07-30)

Features

  • YouTube Playlist: Add subtitle and fix author optionality (#458) (0fa5a85)

5.7.1 (2023-07-25)

Bug Fixes

  • SearchHeader: remove console.log (d91695a)

5.7.0 (2023-07-24)

Features

5.6.0 (2023-07-18)

Features

  • parser: Add IncludingResultsFor (#447) (c477b82)
  • toDash: Add option to include thumbnails in the manifest (#446) (1a03473)

5.5.0 (2023-07-16)

Features

Bug Fixes

  • package: Bump Jinter to fix bad export order (#439) (2aef678)
  • StructuredDescriptionContent: items can also be a HorizontalCardList (b50d1ef)

5.4.0 (2023-07-14)

Features

Bug Fixes

  • Playlist: Parse PlaylistCustomThumbnail for thumbnail_renderer (f267fcd)

5.3.0 (2023-07-11)

Features

Performance Improvements

  • Format: Cleanup the xtags parsing (#434) (1ca2083)
  • toDash: Hoist duplicates from Representation to AdaptationSet (#431) (5f058e6)

5.2.1 (2023-07-04)

Bug Fixes

  • incorrect node parser implementations (#428) (222dfce)

5.2.0 (2023-06-28)

Features

  • VideoDetails: Add is_post_live_dvr property (#411) (a11e596)
  • ytmusic: Add support for YouTube Music mood filters (#404) (77b39c7)

Bug Fixes

  • OAuth: client identity matching (#421) (07c1b3e)
  • PlayerEndpoint: Use different player params (#419) (519be72)
  • Playlist: Add thumbnail_renderer on Playlist when response includes it (#424) (4f9427d)
  • VideoInfo.ts: reimplement get music_tracks (#409) (e434bb2)

Performance Improvements

5.1.0 (2023-05-14)

Features

  • ReelItem: Add accessibility label (#401) (046103a)
  • toDash: Add audio track labels to the manifest when available (#402) (84b4f1e)

5.0.4 (2023-05-10)

Bug Fixes

  • bundles: Use ESM tslib build for the browser bundles (#397) (2673419)
  • Utils: Circular dependency introduced in 38a83c3c2aa814150d1d9b8ed99fca915c1d67fe (#400) (66b026b)
  • Utils: Use instanceof in deepCompare instead of the constructor name (#398) (38a83c3)

5.0.3 (2023-05-03)

Bug Fixes

  • Video: typo causing node parsing to fail (3b0498b)

5.0.2 (2023-04-30)

Bug Fixes

  • VideoInfo: Use microformat view_count when videoDetails view_count is NaN (#393) (7c0abfc)

5.0.1 (2023-04-30)

Bug Fixes

  • web: slow downloads due to visitor data (#391) (4f7ec07)

5.0.0 (2023-04-29)

⚠ BREAKING CHANGES

  • overhaul core classes and remove redundant code (#388)

Features

  • NavigationEndpoint: parse content prop (dd21f8c)

Bug Fixes

  • android: workaround streaming URLs returning 403 (#390) (75ea09d)

Code Refactoring

  • overhaul core classes and remove redundant code (#388) (95e0294)

4.3.0 (2023-04-13)

Features

  • GridVideo: add upcoming, upcoming_text, is_reminder_set and buttons (05de3ec), closes #380
  • MusicResponsiveListItem: make flex/fixed cols public (#382) (096bf36)
  • ToggleMenuServiceItem: parse default nav endpoint (a056696)
  • ytmusic: add taste builder nodes (#383) (a9cad49)

4.2.0 (2023-04-09)

Features

  • Enable importHelpers in tsconfig to reduce output size (#378) (0b301de)
  • parser: ignore PrimetimePromo node (ce9d9c5)
  • PlaylistVideo: Extract video_info and accessibility_label texts (#376) (c9135e6)

4.1.1 (2023-03-29)

Bug Fixes

  • PlayerCaptionsTracklist: parse props only if they exist in the node (470d8d9), closes #372
  • Search: Return search results even if there are ads (#373) (2c5907f)

4.1.0 (2023-03-24)

Features

  • Session: allow setting a custom visitor data token (#371) (13ebf0a)
  • ShowingResultsFor: parse all props (1d9587e)

Bug Fixes

  • http: android tv http client missing clientName (#370) (cb8fafe)
  • node: Electron apps crashing (#367) (e7eacd9)
  • parser: Make Video.is_live work on channel pages (#368) (bd35faa)
  • toDash: Generate unique Representation ids (#366) (a8b507e)
  • Utils: Properly parse timestamps with thousands separators (#363) (1c72a41)

4.0.1 (2023-03-16)

Bug Fixes

  • Channel: type mismatch in subscribe_button prop (573c864)

4.0.0 (2023-03-15)

⚠ BREAKING CHANGES

  • Parser: general refactoring of parsers (#344)
  • The toDash functions are now asynchronous, they now return a Promise<string> instead of a string, as we need to fetch the first sequence of the OTF format streams while building the manifest.

Features

  • Add support for OTF format streams (3e4d41b)
  • parser: add GridMix (#356) (a8e7e64)
  • parser: add GridShow and ShowCustomThumbnail (8ef4b42), closes #459
  • parser: add MusicCardShelf (#358) (9b005d6)
  • parser: Add play_all_button to Shelf (#345) (427db5b)
  • parser: add view_playlist to Playlist (#348) (9cb4530)
  • parser: add InfoPanelContent and InfoPanelContainer nodes (4784dfa), closes #326
  • Parser: just-in-time YTNode generation (#310) (2cee590)
  • yt: add support for movie items and trailers (#349) (9f1c31d)

Code Refactoring

  • Parser: general refactoring of parsers (#344) (b13bf6e)

3.3.0 (2023-03-09)

Features

  • parser: add ConversationBar node (b2253df)
  • VideoInfo: support get by endpoint + more info (#342) (0d35fe0)

Bug Fixes

  • MultiMarkersPlayerBar: avoid observing undefined objects (f351770)
  • SharedPost: import Menu node directly (oops) (3e3dc35)
  • ytmusic: use static visitor id to avoid empty API responses (f9754f5), closes #279

3.2.0 (2023-03-08)

Features

Bug Fixes

  • SegmentedLikeDislikeButton: like/dislike buttons can also be a simple Button (9b2738f)
  • YouTube: fix warnings when retrieving members-only content (#341) (95f1d40)
  • ytmusic: export search filters type (cf8a33c)

3.1.1 (2023-03-01)

Bug Fixes

  • Channel: getting community continuations (#329) (4c7b8a3)

3.1.0 (2023-02-26)

Features

  • Add upcoming and live info to playlist videos (#317) (a0bfe16)
  • VideoSecondaryInfo: add support for attributed descriptions (#325) (f933cb4)

Bug Fixes

  • parser: export YTNodes individually so they can be used as types (200632f), closes #321
  • PlayerMicroformat: Make the embed field optional (#320) (a0e6cef)
  • send correct UA for Android requests (f4e0f30), closes #322

3.0.0 (2023-02-17)

⚠ BREAKING CHANGES

  • cleanup platform support (#306)

Features

  • add parser support for MultiImage community posts (#298) (de61782)
  • add support for hashtag feeds (#312) (bf12740)
  • add support for YouTube Kids (#291) (2bbefef)
  • allow checking whether a channel has optional tabs (#296) (ceefbed)
  • Channel: Add getters for all optional tabs (#303) (b2900f4)
  • Channel: add support for sorting the playlist tab (#295) (50ef712)
  • extract channel error alert (0b99180)
  • FormatUtils: support multiple audio tracks in the DASH manifest (#308) (a69e43b)
  • improve support for dubbed content (#293) (d6c5a9b)
  • parse isLive in CompactVideo (#294) (2acb7da)
  • parser: add ChannelAgeGate node (1cdf701)
  • parser: Text#toHTML (#300) (e82e23d)
  • ytkids: add getChannel() (#292) (0fc29f0)

Bug Fixes

  • assign MetadataBadge's label (#311) (e37cf62)
  • ChannelAboutFullMetadata: fix error when there are no primary links (#299) (f62c66d)
  • TopicChannelDetails: avatar and subtitle parsing (#302) (d612590)
  • VideoInfo: Gracefully handle missing watch next continuation (#288) (13ad377)

Code Refactoring