mirror of
https://github.com/LuanRT/YouTube.js.git
synced 2026-06-19 04:21:35 +00:00
30
lib/parser/contents/classes/PlaylistHeader.js
Normal file
30
lib/parser/contents/classes/PlaylistHeader.js
Normal file
@@ -0,0 +1,30 @@
|
||||
'use strict';
|
||||
|
||||
const Text = require('./Text');
|
||||
const Thumbnail = require('./Thumbnail');
|
||||
const PlaylistAuthor = require('./PlaylistAuthor');
|
||||
const Parser = require('..');
|
||||
|
||||
class PlaylistHeader {
|
||||
type = 'PlaylistHeader';
|
||||
|
||||
constructor(data) {
|
||||
this.id = data.playlistId;
|
||||
this.title = new Text(data.title);
|
||||
this.stats = data.stats.map((stat) => new Text(stat));
|
||||
this.brief_stats = data.briefStats.map((stat) => new Text(stat));
|
||||
this.author = new PlaylistAuthor({ ...data.ownerText, navigationEndpoint: data.ownerEndpoint }, data.ownerBadges, null);
|
||||
this.description = new Text(data.descriptionText);
|
||||
this.num_videos = new Text(data.numVideosText);
|
||||
this.view_count = new Text(data.viewCountText);
|
||||
this.can_share = data.shareData.canShare;
|
||||
this.can_delete = data.editableDetails.canDelete;
|
||||
this.is_editable = data.isEditable;
|
||||
this.privacy = data.privacy;
|
||||
this.save_button = Parser.parse(data.saveButton);
|
||||
this.shuffle_play_button = Parser.parse(data.shufflePlayButton);
|
||||
this.menu = Parser.parse(data.moreActionsMenu);
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = PlaylistHeader;
|
||||
@@ -16,7 +16,11 @@ class Playlist extends Feed {
|
||||
thumbnails: primary_info.thumbnail_renderer.thumbnail,
|
||||
total_items: this.#getStat(0, primary_info),
|
||||
views: this.#getStat(1, primary_info),
|
||||
last_updated: this.#getStat(2, primary_info)
|
||||
last_updated: this.#getStat(2, primary_info),
|
||||
can_share: this.page.header.can_share,
|
||||
can_delete: this.page.header.can_delete,
|
||||
is_editable: this.page.header.is_editable,
|
||||
privacy: this.page.header.privacy
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user