youtubei.js / Clients / Music
Class: Music
Constructors
new Music()
new Music(
session
):Music
Parameters
• session: Session
Returns
Defined in
Methods
getAlbum()
getAlbum(
album_id
):Promise
<Album
>
Retrieves album.
Parameters
• album_id: string
The album id.
Returns
Promise
<Album
>
Defined in
getArtist()
getArtist(
artist_id
):Promise
<Artist
>
Retrieves artist's info & content.
Parameters
• artist_id: string
The artist id.
Returns
Promise
<Artist
>
Defined in
getExplore()
getExplore():
Promise
<Explore
>
Retrieves the Explore feed.
Returns
Promise
<Explore
>
Defined in
getHomeFeed()
getHomeFeed():
Promise
<HomeFeed
>
Retrieves the home feed.
Returns
Promise
<HomeFeed
>
Defined in
getInfo()
getInfo(
target
):Promise
<TrackInfo
>
Retrieves track info. Passing a list item of type MusicTwoRowItem automatically starts a radio.
Parameters
• target: string
| NavigationEndpoint
| MusicResponsiveListItem
| MusicTwoRowItem
Video id or a list item.
Returns
Promise
<TrackInfo
>
Defined in
getLibrary()
getLibrary():
Promise
<Library
>
Retrieves the library.
Returns
Promise
<Library
>
Defined in
getLyrics()
getLyrics(
video_id
):Promise
<undefined
|MusicDescriptionShelf
>
Retrieves song lyrics.
Parameters
• video_id: string
The video id.
Returns
Promise
<undefined
| MusicDescriptionShelf
>
Defined in
getPlaylist()
getPlaylist(
playlist_id
):Promise
<Playlist
>
Retrieves playlist.
Parameters
• playlist_id: string
The playlist id.
Returns
Promise
<Playlist
>
Defined in
getRecap()
getRecap():
Promise
<Recap
>
Retrieves recap.
Returns
Promise
<Recap
>
Defined in
getRelated()
getRelated(
video_id
):Promise
<SectionList
|Message
>
Retrieves related content.
Parameters
• video_id: string
The video id.
Returns
Promise
<SectionList
| Message
>
Defined in
getSearchSuggestions()
getSearchSuggestions(
query
):Promise
<ObservedArray
<SearchSuggestionsSection
>>
Retrieves search suggestions for the given query.
Parameters
• query: string
The query.
Returns
Promise
<ObservedArray
<SearchSuggestionsSection
>>
Defined in
getUpNext()
getUpNext(
video_id
,automix
):Promise
<PlaylistPanel
>
Retrieves up next.
Parameters
• video_id: string
The video id.
• automix: boolean
= true
Whether to enable automix.
Returns
Promise
<PlaylistPanel
>
Defined in
search()
search(
query
,filters
):Promise
<Search
>
Searches on YouTube Music.
Parameters
• query: string
Search query.
• filters: MusicSearchFilters
= {}
Search filters.
Returns
Promise
<Search
>