Skip to content

SongInfo

The raw information of a song.

It is the input of the Song constructor: a plugin builds it from the data of its source.

T = unknown

ageRestricted?: boolean;

Whether the song is age-restricted.


dislikes?: number;

The number of dislikes of the song.


duration?: number;

The duration of the song, in seconds.


id: string;

The identifier of the song in its source.


isLive?: boolean;

Whether the song is a live stream.


likes?: number;

The number of likes of the song.


metadata?: T;

Source specific metadata of the song.

It is used by the plugin that created the song to keep the data it needs to play it (stream url, identifiers, …). It is ignored when the song is created with a metadata option.


name?: string;

The name of the song.


playFromSource: boolean;

Whether the song can be streamed directly from its source.

When it is false, DisTube looks for a playable version of the song with the other plugins.


plugin:
| DisTubePlugin
| null;

The plugin that created this song, or null when it was created manually.


reposts?: number;

The number of reposts (shares) of the song.


source: string;

The identifier of the source of the song, e.g. my-source.


thumbnail?: string;

The URL of the thumbnail of the song.


uploader?: object;

The uploader (the author, the channel, …) of the song.

name?: string;

The name of the uploader.

url?: string;

The URL of the uploader.


url?: string;

The URL of the song.


views?: number;

The number of views of the song.