mirror of
https://github.com/LuanRT/YouTube.js.git
synced 2026-06-17 11:32:27 +00:00
- 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
28 lines
892 B
JavaScript
28 lines
892 B
JavaScript
'use strict';
|
|
|
|
const Parser = require('..');
|
|
const Text = require('./Text');
|
|
const Author = require('./Author');
|
|
const Thumbnail = require('./Thumbnail');
|
|
const NavigationEndpoint = require('./NavigationEndpoint');
|
|
|
|
class EndScreenVideo {
|
|
type = 'EndScreenVideo';
|
|
|
|
constructor(data) {
|
|
this.id = data.videoId;
|
|
this.title = new Text(data.title);
|
|
this.thumbnails = Thumbnail.fromResponse(data.thumbnail);
|
|
this.thumbnail_overlays = Parser.parse(data.thumbnailOverlays);
|
|
this.author = new Author(data.shortBylineText, data.ownerBadges);
|
|
this.endpoint = new NavigationEndpoint(data.navigationEndpoint);
|
|
this.short_view_count_text = new Text(data.shortViewCountText);
|
|
this.badges = Parser.parse(data.badges);
|
|
this.duration = {
|
|
text: new Text(data.lengthText).toString(),
|
|
seconds: data.lengthInSeconds
|
|
}
|
|
}
|
|
}
|
|
|
|
module.exports = EndScreenVideo; |