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
This commit is contained in:
LuanRT
2023-04-23 06:37:33 -03:00
committed by GitHub
parent f66f0bd656
commit 257bd475a0
358 changed files with 2823 additions and 3126 deletions

View File

@@ -1,9 +1,10 @@
import Author from './misc/Author.js';
import NavigationEndpoint from './NavigationEndpoint.js';
import Text from './misc/Text.js';
import { YTNode } from '../helpers.js';
import { type RawNode } from '../index.js';
import NavigationEndpoint from './NavigationEndpoint.js';
import Author from './misc/Author.js';
import Text from './misc/Text.js';
class WatchCardRichHeader extends YTNode {
export default class WatchCardRichHeader extends YTNode {
static type = 'WatchCardRichHeader';
title: Text;
@@ -12,7 +13,7 @@ class WatchCardRichHeader extends YTNode {
author: Author;
style: string;
constructor(data: any) {
constructor(data: RawNode) {
super();
this.title = new Text(data.title);
this.title_endpoint = new NavigationEndpoint(data.titleNavigationEndpoint);
@@ -21,6 +22,4 @@ class WatchCardRichHeader extends YTNode {
this.author.name = this.title.toString();
this.style = data.style;
}
}
export default WatchCardRichHeader;
}