mirror of
https://github.com/LuanRT/YouTube.js.git
synced 2026-06-24 23:32:32 +00:00
* tests: improve coverage * refactor: clean up nodes * chore: lint * feat(parser): ignore `BrandVideoShelf` Seems to be used for ads. * feat(parser): ignore `BrandVideoSingleton` too
21 lines
598 B
TypeScript
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)
|
|
);
|
|
}
|
|
} |