diff --git a/lib/core/Music.js b/lib/core/Music.js index 6c561d94..e2cb14a8 100644 --- a/lib/core/Music.js +++ b/lib/core/Music.js @@ -73,6 +73,7 @@ class Music { * @returns {Promise.} */ async getArtist(artist_id) { + if (!artist_id.startsWith('UC')) throw new InnertubeError('Invalid artist id', artist_id); const response = await this.#actions.browse(artist_id, { client: 'YTMUSIC' }); return new Artist(response, this.#actions); } @@ -84,6 +85,7 @@ class Music { * @returns {Promise.} */ async getAlbum(album_id) { + if (!album_id.startsWith('MPR')) throw new InnertubeError('Invalid album id', album_id); const response = await this.#actions.browse(album_id, { client: 'YTMUSIC' }); return new Album(response, this.#actions); }