mirror of
https://github.com/LuanRT/YouTube.js.git
synced 2026-06-28 09:06:51 +00:00
feat(parser): add banner to PlaylistHeader (#337)
This commit is contained in:
19
src/parser/classes/HeroPlaylistThumbnail.ts
Normal file
19
src/parser/classes/HeroPlaylistThumbnail.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
import { YTNode } from '../helpers.js';
|
||||
import NavigationEndpoint from './NavigationEndpoint.js';
|
||||
import Thumbnail from './misc/Thumbnail.js';
|
||||
|
||||
class HeroPlaylistThumbnail extends YTNode {
|
||||
static type = 'HeroPlaylistThumbnail';
|
||||
|
||||
thumbnails: Thumbnail[];
|
||||
on_tap_endpoint: NavigationEndpoint;
|
||||
|
||||
constructor(data: any) {
|
||||
super();
|
||||
|
||||
this.thumbnails = Thumbnail.fromResponse(data.thumbnail);
|
||||
this.on_tap_endpoint = new NavigationEndpoint(data.onTap);
|
||||
}
|
||||
}
|
||||
|
||||
export default HeroPlaylistThumbnail;
|
||||
@@ -21,6 +21,7 @@ class PlaylistHeader extends YTNode {
|
||||
save_button;
|
||||
shuffle_play_button;
|
||||
menu;
|
||||
banner;
|
||||
|
||||
constructor(data: any) {
|
||||
super();
|
||||
@@ -39,6 +40,7 @@ class PlaylistHeader extends YTNode {
|
||||
this.save_button = Parser.parse(data.saveButton);
|
||||
this.shuffle_play_button = Parser.parse(data.shufflePlayButton);
|
||||
this.menu = Parser.parse(data.moreActionsMenu);
|
||||
this.banner = Parser.parseItem(data.playlistHeaderBanner);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user