mirror of
https://github.com/LuanRT/YouTube.js.git
synced 2026-06-17 03:22:15 +00:00
26 lines
487 B
JavaScript
26 lines
487 B
JavaScript
'use strict';
|
|
|
|
const Parser = require('../contents');
|
|
|
|
/** @namespace */
|
|
class Analytics {
|
|
#page;
|
|
|
|
/**
|
|
* @param {object} response - API response.
|
|
*/
|
|
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; |