Skip to content

Commit

Permalink
feat(parser): Add ActiveAccountHeader
Browse files Browse the repository at this point in the history
Found on the 'You' (a.k.a, 'Library') page.
  • Loading branch information
LuanRT committed Dec 10, 2024
1 parent c1de097 commit 5f233ae
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
24 changes: 24 additions & 0 deletions src/parser/classes/ActiveAccountHeader.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import { YTNode } from '../helpers.js';
import { type RawNode } from '../index.js';
import Text from './misc/Text.js';
import Thumbnail from './misc/Thumbnail.js';
import NavigationEndpoint from './NavigationEndpoint.js';

export default class ActiveAccountHeader extends YTNode {
static type = 'ActiveAccountHeader';

public account_name: Text;
public account_photo: Thumbnail[];
public endpoint: NavigationEndpoint;
public manage_account_title: Text;
public channel_handle: Text;

constructor(data: RawNode) {
super();
this.account_name = new Text(data.accountName);
this.account_photo = Thumbnail.fromResponse(data.accountPhoto);
this.endpoint = new NavigationEndpoint(data.serviceEndpoint);
this.manage_account_title = new Text(data.manageAccountTitle);
this.channel_handle = new Text(data.channelHandle);
}
}
1 change: 1 addition & 0 deletions src/parser/nodes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export { default as SignalAction } from './classes/actions/SignalAction.js';
export { default as UpdateChannelSwitcherPageAction } from './classes/actions/UpdateChannelSwitcherPageAction.js';
export { default as UpdateEngagementPanelAction } from './classes/actions/UpdateEngagementPanelAction.js';
export { default as UpdateSubscribeButtonAction } from './classes/actions/UpdateSubscribeButtonAction.js';
export { default as ActiveAccountHeader } from './classes/ActiveAccountHeader.js';
export { default as AddToPlaylist } from './classes/AddToPlaylist.js';
export { default as Alert } from './classes/Alert.js';
export { default as AlertWithButton } from './classes/AlertWithButton.js';
Expand Down

0 comments on commit 5f233ae

Please sign in to comment.