YouTube.js
Guide
Discord
GitHub
Guide
Discord
GitHub

youtubei.js / YT / VideoInfo

Class: VideoInfo

Extends

  • MediaInfo

Constructors

new VideoInfo()

new VideoInfo(data, actions, cpn): VideoInfo

Parameters

• data: [ApiResponse, ApiResponse?]

• actions: Actions

• cpn: string

Returns

VideoInfo

Overrides

MediaInfo.constructor

Defined in

src/parser/youtube/VideoInfo.ts:47

Properties

annotations?

optional annotations: ObservedArray<PlayerAnnotationsExpanded>

Inherited from

MediaInfo.annotations

Defined in

src/core/mixins/MediaInfo.ts:40


autoplay?

optional autoplay: object

count_down_secs?

optional count_down_secs: number

modified_sets?

optional modified_sets: AutoplaySet[]

sets

sets: AutoplaySet[]

Defined in

src/parser/youtube/VideoInfo.ts:43


basic_info

basic_info: object

allow_ratings?

optional allow_ratings: boolean

author?

optional author: string

category

category: null | string

channel

channel: null | object

channel_id?

optional channel_id: string

duration?

optional duration: number

embed

embed: undefined | null | object

end_timestamp

end_timestamp: null | Date

has_ypc_metadata

has_ypc_metadata: null | boolean

id?

optional id: string

is_crawlable?

optional is_crawlable: boolean

is_disliked

is_disliked: undefined | boolean

is_family_safe

is_family_safe: undefined | boolean = info.microformat.is_family_safe

is_liked

is_liked: undefined | boolean

is_live?

optional is_live: boolean

is_live_content?

optional is_live_content: boolean

is_live_dvr_enabled?

optional is_live_dvr_enabled: boolean

is_low_latency_live_stream?

optional is_low_latency_live_stream: boolean

is_owner_viewing?

optional is_owner_viewing: boolean

is_post_live_dvr?

optional is_post_live_dvr: boolean

is_private?

optional is_private: boolean

is_unlisted

is_unlisted: undefined | boolean = info.microformat.is_unlisted

is_upcoming?

optional is_upcoming: boolean

keywords?

optional keywords: string[]

like_count

like_count: undefined | number

live_chunk_readahead?

optional live_chunk_readahead: number

short_description?

optional short_description: string

start_timestamp

start_timestamp: null | Date

tags

tags: null | string[]

thumbnail?

optional thumbnail: Thumbnail[]

title?

optional title: string

url_canonical

url_canonical: null | string

view_count

view_count: undefined | number

Inherited from

MediaInfo.basic_info

Defined in

src/core/mixins/MediaInfo.ts:39


captions?

optional captions: PlayerCaptionsTracklist

Inherited from

MediaInfo.captions

Defined in

src/core/mixins/MediaInfo.ts:43


cards?

optional cards: CardCollection

Inherited from

MediaInfo.cards

Defined in

src/core/mixins/MediaInfo.ts:44


comments_entry_point_header?

optional comments_entry_point_header: null | CommentsEntryPointHeader

Defined in

src/parser/youtube/VideoInfo.ts:41


endscreen?

optional endscreen: Endscreen

Inherited from

MediaInfo.endscreen

Defined in

src/core/mixins/MediaInfo.ts:42


game_info?

optional game_info: object

release_year

release_year: undefined | Text

title

title: undefined | Text

Defined in

src/parser/youtube/VideoInfo.ts:36


livechat?

optional livechat: null | LiveChat

Defined in

src/parser/youtube/VideoInfo.ts:42


merchandise?

optional merchandise: null | MerchandiseShelf

Defined in

src/parser/youtube/VideoInfo.ts:37


playability_status?

optional playability_status: IPlayabilityStatus

Inherited from

MediaInfo.playability_status

Defined in

src/core/mixins/MediaInfo.ts:46


player_config?

optional player_config: IPlayerConfig

Inherited from

MediaInfo.player_config

Defined in

src/core/mixins/MediaInfo.ts:47


player_overlays?

optional player_overlays: null | PlayerOverlay

Defined in

src/parser/youtube/VideoInfo.ts:40


playlist?

optional playlist: object

author

author: Text | Author

contents

contents: YTNode[]

current_index

current_index: number

id

id: string

is_infinite

is_infinite: boolean

menu

menu: null | Menu

title

title: string

Defined in

src/parser/youtube/VideoInfo.ts:35


primary_info?

optional primary_info: null | VideoPrimaryInfo

Defined in

src/parser/youtube/VideoInfo.ts:33


related_chip_cloud?

optional related_chip_cloud: null | ChipCloud

Defined in

src/parser/youtube/VideoInfo.ts:38


secondary_info?

optional secondary_info: null | VideoSecondaryInfo

Defined in

src/parser/youtube/VideoInfo.ts:34


storyboards?

optional storyboards: PlayerStoryboardSpec | PlayerLiveStoryboardSpec

Inherited from

MediaInfo.storyboards

Defined in

src/core/mixins/MediaInfo.ts:41


streaming_data?

optional streaming_data: IStreamingData

Inherited from

MediaInfo.streaming_data

Defined in

src/core/mixins/MediaInfo.ts:45


watch_next_feed?

optional watch_next_feed: null | ObservedArray<YTNode>

Defined in

src/parser/youtube/VideoInfo.ts:39

Accessors

actions

get actions(): Actions

Returns

Actions

Inherited from

MediaInfo.actions

Defined in

src/core/mixins/MediaInfo.ts:227


autoplay_video_endpoint

get autoplay_video_endpoint(): null | NavigationEndpoint

Gets the endpoint of the autoplay video

Returns

null | NavigationEndpoint

Defined in

src/parser/youtube/VideoInfo.ts:363


cpn

get cpn(): string

Content Playback Nonce.

Returns

string

Inherited from

MediaInfo.cpn

Defined in

src/core/mixins/MediaInfo.ts:234


filters

get filters(): string[]

Watch next feed filters.

Returns

string[]

Defined in

src/parser/youtube/VideoInfo.ts:349


has_trailer

get has_trailer(): boolean

Checks if trailer is available.

Returns

boolean

Defined in

src/parser/youtube/VideoInfo.ts:370


music_tracks

get music_tracks(): object[]

Get songs used in the video.

Returns

object[]

Defined in

src/parser/youtube/VideoInfo.ts:377


page

get page(): [IPlayerResponse, INextResponse?]

Parsed InnerTube response.

Returns

[IPlayerResponse, INextResponse?]

Inherited from

MediaInfo.page

Defined in

src/core/mixins/MediaInfo.ts:241


wn_has_continuation

get wn_has_continuation(): boolean

Checks if continuation is available for the watch next feed.

Returns

boolean

Defined in

src/parser/youtube/VideoInfo.ts:356

Methods

addToWatchHistory()

addToWatchHistory(): Promise<Response>

Adds video to the watch history.

Returns

Promise<Response>

Overrides

MediaInfo.addToWatchHistory

Defined in

src/parser/youtube/VideoInfo.ts:170


chooseFormat()

chooseFormat(options): Format

Selects the format that best matches the given options.

Parameters

• options: FormatOptions

Options

Returns

Format

Inherited from

MediaInfo.chooseFormat

Defined in

src/core/mixins/MediaInfo.ts:158


dislike()

dislike(): Promise<ApiResponse>

Dislikes the video.

Returns

Promise<ApiResponse>

Defined in

src/parser/youtube/VideoInfo.ts:237


download()

download(options): Promise<ReadableStream<Uint8Array>>

Downloads the video.

Parameters

• options: DownloadOptions = {}

Download options.

Returns

Promise<ReadableStream<Uint8Array>>

Inherited from

MediaInfo.download

Defined in

src/core/mixins/MediaInfo.ts:166


getLiveChat()

getLiveChat(): LiveChat

Retrieves Live Chat if available.

Returns

LiveChat

Defined in

src/parser/youtube/VideoInfo.ts:326


getStreamingInfo()

getStreamingInfo(url_transformer?, format_filter?): StreamingInfo

Get a cleaned up representation of the adaptive_formats

Parameters

• url_transformer?: URLTransformer

• format_filter?: FormatFilter

Returns

StreamingInfo

Inherited from

MediaInfo.getStreamingInfo

Defined in

src/core/mixins/MediaInfo.ts:141


getTrailerInfo()

getTrailerInfo(): null | VideoInfo

Retrieves trailer info if available (typically for non-purchased movies or films).

Returns

null | VideoInfo

VideoInfo for the trailer, or null if none.

Defined in

src/parser/youtube/VideoInfo.ts:336


getTranscript()

getTranscript(): Promise<TranscriptInfo>

Retrieves the video's transcript.

Returns

Promise<TranscriptInfo>

Inherited from

MediaInfo.getTranscript

Defined in

src/core/mixins/MediaInfo.ts:179


getWatchNextContinuation()

getWatchNextContinuation(): Promise<VideoInfo>

Retrieves watch next feed continuation.

Returns

Promise<VideoInfo>

Defined in

src/parser/youtube/VideoInfo.ts:177


like()

like(): Promise<ApiResponse>

Likes the video.

Returns

Promise<ApiResponse>

Defined in

src/parser/youtube/VideoInfo.ts:200


removeRating()

removeRating(): Promise<ApiResponse>

Removes like/dislike.

Returns

Promise<ApiResponse>

Defined in

src/parser/youtube/VideoInfo.ts:274


selectFilter()

selectFilter(target_filter): Promise<VideoInfo>

Applies given filter to the watch next feed. Use filters to get available filters.

Parameters

• target_filter: undefined | string | ChipCloudChip

Filter to apply.

Returns

Promise<VideoInfo>

Defined in

src/parser/youtube/VideoInfo.ts:138


toDash()

toDash(url_transformer?, format_filter?, options?): Promise<string>

Generates a DASH manifest from the streaming data.

Parameters

• url_transformer?: URLTransformer

Function to transform the URLs.

• format_filter?: FormatFilter

Function to filter the formats.

• options?: DashOptions = ...

Additional options to customise the manifest generation

Returns

Promise<string>

DASH manifest

Inherited from

MediaInfo.toDash

Defined in

src/core/mixins/MediaInfo.ts:106

Edit this page
Last Updated:: 3/25/25, 8:08 PM
Contributors: EdamAme-x