mirror of
https://github.com/LuanRT/YouTube.js.git
synced 2026-06-26 00:02:09 +00:00
refactor!: finish parser migration
Finally! :) This removes all code related to the old parser. #65
This commit is contained in:
28
lib/parser/classes/EndScreenVideo.js
Normal file
28
lib/parser/classes/EndScreenVideo.js
Normal file
@@ -0,0 +1,28 @@
|
||||
'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;
|
||||
Reference in New Issue
Block a user