youtubei.js / YTMusic / TrackInfo
Class: TrackInfo
Extends
Constructors
new TrackInfo()
new TrackInfo(
data
,actions
,cpn
):TrackInfo
Parameters
• data: [ApiResponse
, ApiResponse?
]
• actions: Actions
• cpn: string
Returns
Overrides
Defined in
src/parser/ytmusic/TrackInfo.ts:26
Properties
annotations?
optional
annotations:ObservedArray
<PlayerAnnotationsExpanded
>
Inherited from
Defined in
src/core/mixins/MediaInfo.ts:31
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
Defined in
src/core/mixins/MediaInfo.ts:30
captions?
optional
captions:PlayerCaptionsTracklist
Inherited from
Defined in
src/core/mixins/MediaInfo.ts:34
cards?
optional
cards:CardCollection
Inherited from
Defined in
src/core/mixins/MediaInfo.ts:35
current_video_endpoint?
optional
current_video_endpoint:NavigationEndpoint
Defined in
src/parser/ytmusic/TrackInfo.ts:23
endscreen?
optional
endscreen:Endscreen
Inherited from
Defined in
src/core/mixins/MediaInfo.ts:33
playability_status?
optional
playability_status:IPlayabilityStatus
Inherited from
Defined in
src/core/mixins/MediaInfo.ts:37
player_config?
optional
player_config:IPlayerConfig
Inherited from
Defined in
src/core/mixins/MediaInfo.ts:38
player_overlays?
optional
player_overlays:PlayerOverlay
Defined in
src/parser/ytmusic/TrackInfo.ts:24
storyboards?
optional
storyboards:PlayerLiveStoryboardSpec
|PlayerStoryboardSpec
Inherited from
Defined in
src/core/mixins/MediaInfo.ts:32
streaming_data?
optional
streaming_data:IStreamingData
Inherited from
Defined in
src/core/mixins/MediaInfo.ts:36
tabs?
optional
tabs:ObservedArray
<Tab
>
Defined in
src/parser/ytmusic/TrackInfo.ts:22
Accessors
actions
get
actions():Actions
Actions instance.
Returns
Inherited from
Defined in
src/core/mixins/MediaInfo.ts:223
available_tabs
get
available_tabs():string
[]
Returns
string
[]
Defined in
src/parser/ytmusic/TrackInfo.ts:126
cpn
get
cpn():string
Content Playback Nonce.
Returns
string
Inherited from
Defined in
src/core/mixins/MediaInfo.ts:230
page
get
page(): [IPlayerResponse
,INextResponse?
]
Original parsed InnerTube response.
Returns
[IPlayerResponse
, INextResponse?
]
Inherited from
Defined in
src/core/mixins/MediaInfo.ts:237
Methods
addToWatchHistory()
addToWatchHistory():
Promise
<Response
>
Adds the song to the watch history.
Returns
Promise
<Response
>
Overrides
Defined in
src/parser/ytmusic/TrackInfo.ts:122
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
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
getLyrics()
getLyrics():
Promise
<undefined
|MusicDescriptionShelf
>
Retrieves lyrics.
Returns
Promise
<undefined
| MusicDescriptionShelf
>
Defined in
src/parser/ytmusic/TrackInfo.ts:114
getRelated()
getRelated():
Promise
<ObservedArray
<MusicCarouselShelf
|MusicDescriptionShelf
>>
Retrieves related content.
Returns
Promise
<ObservedArray
<MusicCarouselShelf
| MusicDescriptionShelf
>>
Defined in
src/parser/ytmusic/TrackInfo.ts:106
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
getTab()
getTab(
title_or_page_type
):Promise
<ObservedArray
<YTNode
> |SectionList
|MusicQueue
|RichGrid
|Message
>
Retrieves contents of the given tab.
Parameters
• title_or_page_type: string
Returns
Promise
<ObservedArray
<YTNode
> | SectionList
| MusicQueue
| RichGrid
| Message
>
Defined in
src/parser/ytmusic/TrackInfo.ts:45
getTranscript()
getTranscript():
Promise
<TranscriptInfo
>
Retrieves the video's transcript.
Returns
Promise
<TranscriptInfo
>
Inherited from
Defined in
src/core/mixins/MediaInfo.ts:170
getUpNext()
getUpNext(
automix
):Promise
<PlaylistPanel
>
Retrieves up next.
Parameters
• automix: boolean
= true
Returns
Promise
<PlaylistPanel
>
Defined in
src/parser/ytmusic/TrackInfo.ts:74
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