Skip to content

Commit

Permalink
feat: add parser support for MultiImage community posts (#298)
Browse files Browse the repository at this point in the history
  • Loading branch information
ChunkyProgrammer authored Jan 29, 2023
1 parent ceefbed commit de61782
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/parser/classes/PostMultiImage.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import Parser from '../index';
import BackstageImage from './BackstageImage';

import { YTNode } from '../helpers';

class PostMultiImage extends YTNode {
static type = 'PostMultiImage';

images : BackstageImage[];

constructor(data: any) {
super();
this.images = Parser.parseArray(data.images, BackstageImage);
}
}

export default PostMultiImage;
2 changes: 2 additions & 0 deletions src/parser/map.ts
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,7 @@ import { default as PlaylistVideoList } from './classes/PlaylistVideoList';
import { default as PlaylistVideoThumbnail } from './classes/PlaylistVideoThumbnail';
import { default as Poll } from './classes/Poll';
import { default as Post } from './classes/Post';
import { default as PostMultiImage } from './classes/PostMultiImage';
import { default as ProfileColumn } from './classes/ProfileColumn';
import { default as ProfileColumnStats } from './classes/ProfileColumnStats';
import { default as ProfileColumnStatsEntry } from './classes/ProfileColumnStatsEntry';
Expand Down Expand Up @@ -551,6 +552,7 @@ export const YTNodes = {
PlaylistVideoThumbnail,
Poll,
Post,
PostMultiImage,
ProfileColumn,
ProfileColumnStats,
ProfileColumnStatsEntry,
Expand Down

0 comments on commit de61782

Please sign in to comment.