mirror of
https://github.com/LuanRT/YouTube.js.git
synced 2026-06-25 07:42:11 +00:00
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:
@@ -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;
|
||||
}
|
||||
Reference in New Issue
Block a user