mirror of
https://github.com/LuanRT/YouTube.js.git
synced 2026-06-19 04:21:35 +00:00
fix(ytmusic): fix music#getLyrics() & music#getUpNext()
These were broken due to recent changes in the parser — both should be fixed now. Note that `music#getRelated()` is still broken.
This commit is contained in:
@@ -21,8 +21,8 @@ class PlaylistPanelVideo extends YTNode {
|
||||
seconds: timeToSeconds(new Text(data.lengthText).toString())
|
||||
};
|
||||
|
||||
const album = new Text(data.longBylineText).runs.find((run) => run.endpoint?.browse?.id.startsWith('MPR'));
|
||||
const artists = new Text(data.longBylineText).runs.filter((run) => run.endpoint?.browse?.id.startsWith('UC'));
|
||||
const album = new Text(data.longBylineText).runs?.find((run) => run.endpoint?.browse?.id.startsWith('MPR'));
|
||||
const artists = new Text(data.longBylineText).runs?.filter((run) => run.endpoint?.browse?.id.startsWith('UC'));
|
||||
|
||||
this.author = new Text(data.shortBylineText).toString();
|
||||
|
||||
@@ -35,11 +35,13 @@ class PlaylistPanelVideo extends YTNode {
|
||||
};
|
||||
}
|
||||
|
||||
this.artists = artists.map((artist) => ({
|
||||
name: artist.text,
|
||||
channel_id: artist.endpoint?.browse.id,
|
||||
endpoint: artist.endpoint
|
||||
}));
|
||||
if (artists) {
|
||||
this.artists = artists.map((artist) => ({
|
||||
name: artist.text,
|
||||
channel_id: artist.endpoint?.browse.id,
|
||||
endpoint: artist.endpoint
|
||||
}));
|
||||
}
|
||||
|
||||
this.badges = Parser.parse(data.badges);
|
||||
this.menu = Parser.parse(data.menu);
|
||||
|
||||
@@ -6,7 +6,7 @@ class SingleColumnMusicWatchNextResults extends YTNode {
|
||||
|
||||
constructor(data) {
|
||||
super();
|
||||
return Parser.parse(data);
|
||||
this.contents = Parser.parse(data);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ class Tabbed extends YTNode {
|
||||
|
||||
constructor(data) {
|
||||
super();
|
||||
return Parser.parse(data);
|
||||
this.contents = Parser.parse(data);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user