mirror of
https://github.com/LuanRT/YouTube.js.git
synced 2026-06-19 04:21:35 +00:00
feat: add PlaylistPanelVideoWrapper parser (#176)
* feat: add `PlaylistPanelVideoWrapper` parser * fix: `PlaylistPanelVideoWrapper` no counterpart
This commit is contained in:
18
src/parser/classes/PlaylistPanelVideoWrapper.ts
Normal file
18
src/parser/classes/PlaylistPanelVideoWrapper.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
import Parser from '..';
|
||||
import { YTNode } from '../helpers';
|
||||
import PlaylistPanelVideo from './PlaylistPanelVideo';
|
||||
|
||||
class PlaylistPanelVideoWrapper extends YTNode {
|
||||
static type = 'PlaylistPanelVideoWrapper';
|
||||
|
||||
primary: PlaylistPanelVideo | null;
|
||||
counterpart: Array<PlaylistPanelVideo | null>;
|
||||
|
||||
constructor(data: any) {
|
||||
super();
|
||||
this.primary = Parser.parseItem<PlaylistPanelVideo>(data.primaryRenderer);
|
||||
this.counterpart = data.counterpart?.map((item: any) => Parser.parseItem<PlaylistPanelVideo>(item.counterpartRenderer)) || [];
|
||||
}
|
||||
}
|
||||
|
||||
export default PlaylistPanelVideoWrapper;
|
||||
Reference in New Issue
Block a user