mirror of
https://github.com/LuanRT/YouTube.js.git
synced 2026-06-26 08:08:54 +00:00
feat: add CollaboratorInfoCardContent renderer parser (#180)
This commit is contained in:
26
src/parser/classes/CollaboratorInfoCardContent.ts
Normal file
26
src/parser/classes/CollaboratorInfoCardContent.ts
Normal file
@@ -0,0 +1,26 @@
|
||||
import Text from './misc/Text';
|
||||
import Thumbnail from './misc/Thumbnail';
|
||||
import NavigationEndpoint from './NavigationEndpoint';
|
||||
|
||||
import { YTNode } from '../helpers';
|
||||
|
||||
class CollaboratorInfoCardContent extends YTNode {
|
||||
static type = 'CollaboratorInfoCardContent';
|
||||
|
||||
channel_avatar: Thumbnail[];
|
||||
custom_text: Text;
|
||||
channel_name: Text;
|
||||
subscriber_count: Text;
|
||||
endpoint: NavigationEndpoint;
|
||||
|
||||
constructor(data: any) {
|
||||
super();
|
||||
this.channel_avatar = Thumbnail.fromResponse(data.channelAvatar);
|
||||
this.custom_text = new Text(data.customText);
|
||||
this.channel_name = new Text(data.channelName);
|
||||
this.subscriber_count = new Text(data.subscriberCountText);
|
||||
this.endpoint = new NavigationEndpoint(data.endpoint);
|
||||
}
|
||||
}
|
||||
|
||||
export default CollaboratorInfoCardContent;
|
||||
@@ -38,6 +38,7 @@ import { default as ChannelVideoPlayer } from './classes/ChannelVideoPlayer';
|
||||
import { default as ChildVideo } from './classes/ChildVideo';
|
||||
import { default as ChipCloud } from './classes/ChipCloud';
|
||||
import { default as ChipCloudChip } from './classes/ChipCloudChip';
|
||||
import { default as CollaboratorInfoCardContent } from './classes/CollaboratorInfoCardContent';
|
||||
import { default as CollageHeroImage } from './classes/CollageHeroImage';
|
||||
import { default as AuthorCommentBadge } from './classes/comments/AuthorCommentBadge';
|
||||
import { default as Comment } from './classes/comments/Comment';
|
||||
@@ -305,6 +306,7 @@ const map: Record<string, YTNodeConstructor> = {
|
||||
ChildVideo,
|
||||
ChipCloud,
|
||||
ChipCloudChip,
|
||||
CollaboratorInfoCardContent,
|
||||
CollageHeroImage,
|
||||
AuthorCommentBadge,
|
||||
Comment,
|
||||
|
||||
Reference in New Issue
Block a user