mirror of
https://github.com/LuanRT/YouTube.js.git
synced 2026-07-03 09:35:05 +00:00
feat: fix music#library.getArtists() and add MusicShelf.bottom_button (#152)
* fix: #143 * feat: add `bottom_button` to `MusicShelf`
This commit is contained in:
@@ -86,11 +86,14 @@ class MusicResponsiveListItem extends YTNode {
|
||||
this.#parsePlaylist();
|
||||
break;
|
||||
case 'MUSIC_PAGE_TYPE_ARTIST':
|
||||
case 'MUSIC_PAGE_TYPE_LIBRARY_ARTIST':
|
||||
case 'MUSIC_PAGE_TYPE_USER_CHANNEL':
|
||||
this.item_type = 'artist';
|
||||
this.#parseArtist();
|
||||
break;
|
||||
case 'MUSIC_PAGE_TYPE_LIBRARY_ARTIST':
|
||||
this.item_type = 'library_artist';
|
||||
this.#parseLibraryArtist();
|
||||
break;
|
||||
default:
|
||||
if (this.#flex_columns[1]) {
|
||||
this.#parseVideoOrSong();
|
||||
@@ -191,7 +194,12 @@ class MusicResponsiveListItem extends YTNode {
|
||||
this.name = this.#flex_columns[0].key('title').instanceof(Text).toString();
|
||||
this.subtitle = this.#flex_columns[1].key('title').instanceof(Text);
|
||||
this.subscribers = this.subtitle.runs?.find((run) => (/^(\d*\.)?\d+[M|K]? subscribers?$/i).test(run.text))?.text || '';
|
||||
this.song_count = this.subtitle.runs?.find((run) => (/^\d+(,\d+)? songs?$/i).test(run.text))?.text || '';
|
||||
}
|
||||
|
||||
#parseLibraryArtist() {
|
||||
this.name = this.#flex_columns[0].key('title').instanceof(Text).toString();
|
||||
this.subtitle = this.#flex_columns[1].key('title').instanceof(Text);
|
||||
this.song_count = this.subtitle?.runs?.find((run) => (/^\d+(,\d+)? songs?$/i).test(run.text))?.text || '';
|
||||
}
|
||||
|
||||
#parseAlbum() {
|
||||
|
||||
Reference in New Issue
Block a user