mirror of
https://github.com/LuanRT/YouTube.js.git
synced 2026-06-19 04:21:35 +00:00
Things were getting a bit complicated and slow with the old parser so I decided to continue #44's work on the main codebase.
27 lines
512 B
JavaScript
27 lines
512 B
JavaScript
'use strict';
|
|
|
|
const Parser = require('../parser/contents');
|
|
|
|
/** @namespace */
|
|
class Analytics {
|
|
#page;
|
|
|
|
/**
|
|
* @param {object} response - API response.
|
|
* @constructor
|
|
*/
|
|
constructor(response) {
|
|
this.#page = Parser.parseResponse(response);
|
|
|
|
const tab = this.#page.contents.tabs.get({ selected: true });
|
|
const item = tab.content.contents.get({ target_id: null });
|
|
|
|
this.sections = item.contents;
|
|
}
|
|
|
|
get page() {
|
|
return this.#page;
|
|
}
|
|
}
|
|
|
|
module.exports = Analytics; |