mirror of
https://github.com/LuanRT/YouTube.js.git
synced 2026-06-30 09:55:18 +00:00
refactor!: finish parser migration
Finally! :) This removes all code related to the old parser. #65
This commit is contained in:
21
lib/parser/classes/ChildVideo.js
Normal file
21
lib/parser/classes/ChildVideo.js
Normal file
@@ -0,0 +1,21 @@
|
||||
'use strict';
|
||||
|
||||
const NavigationEndpoint = require('./NavigationEndpoint');
|
||||
const Utils = require('../../utils/Utils');
|
||||
const Text = require('./Text');
|
||||
|
||||
class ChildVideo {
|
||||
type = 'ChildVideo';
|
||||
|
||||
constructor(data) {
|
||||
this.id = data.videoId;
|
||||
this.title = new Text(data.title);
|
||||
this.duration = {
|
||||
text: data.lengthText.simpleText,
|
||||
seconds: Utils.timeToSeconds(data.lengthText.simpleText)
|
||||
};
|
||||
this.endpoint = new NavigationEndpoint(data.navigationEndpoint);
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = ChildVideo;
|
||||
Reference in New Issue
Block a user