Files
YouTube.js/src/parser/classes/analytics/AnalyticsMainAppKeyMetrics.ts
LuanRT 257bd475a0 refactor: clean up parser and tests (#387)
* tests: improve coverage

* refactor: clean up nodes

* chore: lint

* feat(parser): ignore `BrandVideoShelf`

Seems to be used for ads.

* feat(parser): ignore `BrandVideoSingleton` too
2023-04-23 06:37:33 -03:00

21 lines
598 B
TypeScript

import DataModelSection from './DataModelSection.js';
import { YTNode } from '../../helpers.js';
import type { RawNode } from '../../index.js';
export default class AnalyticsMainAppKeyMetrics extends YTNode {
static type = 'AnalyticsMainAppKeyMetrics';
period: string;
sections: DataModelSection[];
constructor(data: RawNode) {
super();
this.period = data.cardData.periodLabel;
const metrics_data = data.cardData.sections[0].analyticsKeyMetricsData;
this.sections = metrics_data.dataModel.sections.map(
(section: any) => new DataModelSection(section)
);
}
}