Files
YouTube.js/lib/parser/contents/classes/PlaylistVideo.js
LuanRT 748e34758f feat: tidy things up and implement more renderers
- Finished Library parser
- Fixed search continuations
- Improved channel parser
- Improved playlist parser
- Added support for posts of type poll
- Improved History parser
- Removed redundant code
2022-06-20 03:02:42 -03:00

30 lines
948 B
JavaScript

'use strict';
const Text = require('./Text');
const Parser = require('..');
const Thumbnail = require('./Thumbnail');
const PlaylistAuthor = require('./PlaylistAuthor');
const NavigationEndpoint = require('./NavigationEndpoint');
class PlaylistVideo {
type = 'PlaylistVideo';
constructor(data) {
this.id = data.videoId;
this.index = new Text(data.index);
this.title = new Text(data.title);
this.author = new PlaylistAuthor(data.shortBylineText);
this.thumbnails = Thumbnail.fromResponse(data.thumbnail);
this.thumbnail_overlays = Parser.parse(data.thumbnailOverlays);
this.set_video_id = data?.setVideoId;
this.endpoint = new NavigationEndpoint(data.navigationEndpoint);
this.is_playable = data.isPlayable;
this.menu = Parser.parse(data.menu);
this.duration = {
text: new Text(data.lengthText).text,
seconds: parseInt(data.lengthSeconds)
}
}
}
module.exports = PlaylistVideo;