This commit is contained in:
LuanRT
2022-08-11 20:37:01 -03:00
6 changed files with 136 additions and 23 deletions

View File

@@ -8,6 +8,7 @@ import Explore from '../parser/ytmusic/Explore';
import Library from '../parser/ytmusic/Library';
import Artist from '../parser/ytmusic/Artist';
import Album from '../parser/ytmusic/Album';
import Playlist from '../parser/ytmusic/Playlist';
import Parser from '../parser/index';
import { observe, YTNode } from '../parser/helpers';
@@ -108,6 +109,16 @@ class Music {
return new Album(response, this.#actions);
}
/**
* Retrieves playlist.
*/
async getPlaylist(playlist_id: string) {
throwIfMissing({ playlist_id });
const response = await this.#actions.browse(`VL${playlist_id.replace(/VL/g, '')}`, { client: 'YTMUSIC' });
return new Playlist(response, this.#actions);
}
/**
* Retrieves song lyrics.
*/