youtubei.js / YT / VideoInfo
Class: VideoInfo
Extends
Constructors
new VideoInfo()
new VideoInfo(
data,actions,cpn):VideoInfo
Parameters
• data: [ApiResponse, ApiResponse?]
API response.
• actions: Actions
Actions instance.
• cpn: string
Client Playback Nonce.
Returns
Overrides
Defined in
src/parser/youtube/VideoInfo.ts:51
Properties
annotations?
optionalannotations:ObservedArray<PlayerAnnotationsExpanded>
Inherited from
Defined in
src/core/mixins/MediaInfo.ts:31
autoplay?
optionalautoplay:object
count_down_secs?
optionalcount_down_secs:number
modified_sets?
optionalmodified_sets:AutoplaySet[]
sets
sets:
AutoplaySet[]
Defined in
src/parser/youtube/VideoInfo.ts:44
basic_info
basic_info:
object
allow_ratings?
optionalallow_ratings:boolean
author?
optionalauthor:string
category
category:
null|string
channel
channel:
null|object
channel_id?
optionalchannel_id:string
duration?
optionalduration:number
embed
embed:
undefined|null|object
end_timestamp
end_timestamp:
null|Date
has_ypc_metadata
has_ypc_metadata:
null|boolean
id?
optionalid:string
is_crawlable?
optionalis_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?
optionalis_live:boolean
is_live_content?
optionalis_live_content:boolean
is_live_dvr_enabled?
optionalis_live_dvr_enabled:boolean
is_low_latency_live_stream?
optionalis_low_latency_live_stream:boolean
is_owner_viewing?
optionalis_owner_viewing:boolean
is_post_live_dvr?
optionalis_post_live_dvr:boolean
is_private?
optionalis_private:boolean
is_unlisted
is_unlisted:
undefined|boolean=info.microformat.is_unlisted
is_upcoming?
optionalis_upcoming:boolean
keywords?
optionalkeywords:string[]
like_count
like_count:
undefined|number
live_chunk_readahead?
optionallive_chunk_readahead:number
short_description?
optionalshort_description:string
start_timestamp
start_timestamp:
null|Date
tags
tags:
null|string[]
thumbnail?
optionalthumbnail:Thumbnail[]
title?
optionaltitle:string
url_canonical
url_canonical:
null|string
view_count
view_count:
undefined|number
Inherited from
Defined in
src/core/mixins/MediaInfo.ts:30
captions?
optionalcaptions:PlayerCaptionsTracklist
Inherited from
Defined in
src/core/mixins/MediaInfo.ts:34
cards?
optionalcards:CardCollection
Inherited from
Defined in
src/core/mixins/MediaInfo.ts:35
comments_entry_point_header?
optionalcomments_entry_point_header:null|CommentsEntryPointHeader
Defined in
src/parser/youtube/VideoInfo.ts:42
endscreen?
optionalendscreen:Endscreen
Inherited from
Defined in
src/core/mixins/MediaInfo.ts:33
game_info?
optionalgame_info:object
release_year
release_year:
undefined|Text
title
title:
undefined|Text
Defined in
src/parser/youtube/VideoInfo.ts:37
livechat?
optionallivechat:null|LiveChat
Defined in
src/parser/youtube/VideoInfo.ts:43
merchandise?
optionalmerchandise:null|MerchandiseShelf
Defined in
src/parser/youtube/VideoInfo.ts:38
playability_status?
optionalplayability_status:IPlayabilityStatus
Inherited from
Defined in
src/core/mixins/MediaInfo.ts:37
player_config?
optionalplayer_config:IPlayerConfig
Inherited from
Defined in
src/core/mixins/MediaInfo.ts:38
player_overlays?
optionalplayer_overlays:null|PlayerOverlay
Defined in
src/parser/youtube/VideoInfo.ts:41
playlist?
optionalplaylist:object
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:36
primary_info?
optionalprimary_info:null|VideoPrimaryInfo
Defined in
src/parser/youtube/VideoInfo.ts:34
related_chip_cloud?
optionalrelated_chip_cloud:null|ChipCloud
Defined in
src/parser/youtube/VideoInfo.ts:39
secondary_info?
optionalsecondary_info:null|VideoSecondaryInfo
Defined in
src/parser/youtube/VideoInfo.ts:35
storyboards?
optionalstoryboards:PlayerLiveStoryboardSpec|PlayerStoryboardSpec
Inherited from
Defined in
src/core/mixins/MediaInfo.ts:32
streaming_data?
optionalstreaming_data:IStreamingData
Inherited from
Defined in
src/core/mixins/MediaInfo.ts:36
watch_next_feed?
optionalwatch_next_feed:null|ObservedArray<YTNode>
Defined in
src/parser/youtube/VideoInfo.ts:40
Accessors
actions
getactions():Actions
Actions instance.
Returns
Inherited from
Defined in
src/core/mixins/MediaInfo.ts:223
autoplay_video_endpoint
getautoplay_video_endpoint():null|NavigationEndpoint
Gets the endpoint of the autoplay video
Returns
null | NavigationEndpoint
Defined in
src/parser/youtube/VideoInfo.ts:379
cpn
getcpn():string
Content Playback Nonce.
Returns
string
Inherited from
Defined in
src/core/mixins/MediaInfo.ts:230
filters
getfilters():string[]
Watch next feed filters.
Returns
string[]
Defined in
src/parser/youtube/VideoInfo.ts:365
has_trailer
gethas_trailer():boolean
Checks if trailer is available.
Returns
boolean
Defined in
src/parser/youtube/VideoInfo.ts:386
music_tracks
getmusic_tracks():object[]
Get songs used in the video.
Returns
object[]
Defined in
src/parser/youtube/VideoInfo.ts:393
page
getpage(): [IPlayerResponse,INextResponse?]
Original parsed InnerTube response.
Returns
[IPlayerResponse, INextResponse?]
Inherited from
Defined in
src/core/mixins/MediaInfo.ts:237
wn_has_continuation
getwn_has_continuation():boolean
Checks if continuation is available for the watch next feed.
Returns
boolean
Defined in
src/parser/youtube/VideoInfo.ts:372
Methods
addToWatchHistory()
addToWatchHistory():
Promise<Response>
Adds video to the watch history.
Returns
Promise<Response>
Overrides
Defined in
src/parser/youtube/VideoInfo.ts:174
chooseFormat()
chooseFormat(
options):Format
Selects the format that best matches the given options.
Parameters
• options: FormatOptions
Options
Returns
Inherited from
Defined in
src/core/mixins/MediaInfo.ts:149
dislike()
dislike():
Promise<ApiResponse>
Dislikes the video.
Returns
Promise<ApiResponse>
Defined in
src/parser/youtube/VideoInfo.ts:245
download()
download(
options):Promise<ReadableStream<Uint8Array>>
Downloads the video.
Parameters
• options: DownloadOptions = {}
Download options.
Returns
Promise<ReadableStream<Uint8Array>>
Inherited from
Defined in
src/core/mixins/MediaInfo.ts:157
getLiveChat()
getLiveChat():
LiveChat
Retrieves Live Chat if available.
Returns
Defined in
src/parser/youtube/VideoInfo.ts:342
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
Defined in
src/core/mixins/MediaInfo.ts:132
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:352
getTranscript()
getTranscript():
Promise<TranscriptInfo>
Retrieves the video's transcript.
Returns
Promise<TranscriptInfo>
Inherited from
Defined in
src/core/mixins/MediaInfo.ts:170
getWatchNextContinuation()
getWatchNextContinuation():
Promise<VideoInfo>
Retrieves watch next feed continuation.
Returns
Promise<VideoInfo>
Defined in
src/parser/youtube/VideoInfo.ts:181
like()
like():
Promise<ApiResponse>
Likes the video.
Returns
Promise<ApiResponse>
Defined in
src/parser/youtube/VideoInfo.ts:204
removeRating()
removeRating():
Promise<ApiResponse>
Removes like/dislike.
Returns
Promise<ApiResponse>
Defined in
src/parser/youtube/VideoInfo.ts:286
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:142
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