mirror of
https://github.com/LuanRT/YouTube.js.git
synced 2026-06-27 00:29:16 +00:00
refactor!: finish parser migration
Finally! :) This removes all code related to the old parser. #65
This commit is contained in:
20
lib/parser/classes/AnalyticsVideo.js
Normal file
20
lib/parser/classes/AnalyticsVideo.js
Normal file
@@ -0,0 +1,20 @@
|
||||
'use strict';
|
||||
|
||||
const Thumbnail = require('./Thumbnail');
|
||||
|
||||
class AnalyticsVideo {
|
||||
type = 'AnalyticsVideo';
|
||||
|
||||
constructor(data) {
|
||||
this.title = data.videoTitle;
|
||||
this.metadata = {
|
||||
views: data.videoDescription.split('·')[0].trim(),
|
||||
published: data.videoDescription.split('·')[1].trim(),
|
||||
thumbnails: Thumbnail.fromResponse(data.thumbnailDetails),
|
||||
duration: data.formattedLength,
|
||||
is_short: data.isShort
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = AnalyticsVideo;
|
||||
Reference in New Issue
Block a user