mirror of
https://github.com/LuanRT/YouTube.js.git
synced 2026-06-28 00:56:23 +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,17 +1,16 @@
|
||||
import Parser from '../index.js';
|
||||
import Text from './misc/Text.js';
|
||||
import PlaylistPanelVideo from './PlaylistPanelVideo.js';
|
||||
|
||||
import { YTNode } from '../helpers.js';
|
||||
import { YTNode, type ObservedArray } from '../helpers.js';
|
||||
import Parser, { type RawNode } from '../index.js';
|
||||
import AutomixPreviewVideo from './AutomixPreviewVideo.js';
|
||||
import PlaylistPanelVideo from './PlaylistPanelVideo.js';
|
||||
import PlaylistPanelVideoWrapper from './PlaylistPanelVideoWrapper.js';
|
||||
import Text from './misc/Text.js';
|
||||
|
||||
class PlaylistPanel extends YTNode {
|
||||
export default class PlaylistPanel extends YTNode {
|
||||
static type = 'PlaylistPanel';
|
||||
|
||||
title: string;
|
||||
title_text: Text;
|
||||
contents;
|
||||
contents: ObservedArray<PlaylistPanelVideoWrapper | PlaylistPanelVideo | AutomixPreviewVideo>;
|
||||
playlist_id: string;
|
||||
is_infinite: boolean;
|
||||
continuation: string;
|
||||
@@ -19,7 +18,7 @@ class PlaylistPanel extends YTNode {
|
||||
preview_description: string;
|
||||
num_items_to_show: string;
|
||||
|
||||
constructor(data: any) {
|
||||
constructor(data: RawNode) {
|
||||
super();
|
||||
this.title = data.title;
|
||||
this.title_text = new Text(data.titleText);
|
||||
@@ -31,6 +30,4 @@ class PlaylistPanel extends YTNode {
|
||||
this.preview_description = data.previewDescription;
|
||||
this.num_items_to_show = data.numItemsToShow;
|
||||
}
|
||||
}
|
||||
|
||||
export default PlaylistPanel;
|
||||
}
|
||||
Reference in New Issue
Block a user