Skip to content

Commit

Permalink
fix(ItemSection): FeedFilterChipBar parse error (#741)
Browse files Browse the repository at this point in the history
  • Loading branch information
dnicolson authored Sep 11, 2024
1 parent 094a96f commit bf6cc00
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/parser/classes/ItemSection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,19 @@ import ItemSectionHeader from './ItemSectionHeader.js';
import ItemSectionTabbedHeader from './ItemSectionTabbedHeader.js';
import CommentsHeader from './comments/CommentsHeader.js';
import SortFilterHeader from './SortFilterHeader.js';
import FeedFilterChipBar from './FeedFilterChipBar.js';

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

header: CommentsHeader | ItemSectionHeader | ItemSectionTabbedHeader | SortFilterHeader | null;
header: CommentsHeader | ItemSectionHeader | ItemSectionTabbedHeader | SortFilterHeader | FeedFilterChipBar | null;
contents: ObservedArray<YTNode>;
target_id?: string;
continuation?: string;

constructor(data: RawNode) {
super();
this.header = Parser.parseItem(data.header, [ CommentsHeader, ItemSectionHeader, ItemSectionTabbedHeader, SortFilterHeader ]);
this.header = Parser.parseItem(data.header, [ CommentsHeader, ItemSectionHeader, ItemSectionTabbedHeader, SortFilterHeader, FeedFilterChipBar ]);
this.contents = Parser.parseArray(data.contents);

if (data.targetId || data.sectionIdentifier) {
Expand Down

2 comments on commit bf6cc00

@hextor1
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dnicolson STill getting this same error after update

[YOUTUBEJS][Parser]: ShortsLockupView changed!
The following keys where altered: inline_player_data, menu_on_tap, menu_on_tap_a11y_label, badge
The class has changed to:
class ShortsLockupView extends YTNode {
static type = 'ShortsLockupView';
entity_id: string;
accessibility_text: string;
thumbnail: {
sources: {
url: string,
width: number,
height: number
}[]
};
on_tap: {
innertube_command: NavigationEndpoint
};
index_in_collection: number;
logging_directives: {
tracking_params: string,
visibility: {
types: string
},
enable_displaylogger_experiment: boolean
};
overlay_metadata: {
secondary_text: {
content: string
},
primary_text?: {
content: string
}
};
inline_player_data?: {
on_visible: {
innertube_command: NavigationEndpoint
}
};
menu_on_tap?: {
innertube_command: NavigationEndpoint
};
menu_on_tap_a11y_label?: string;
badge?: YTNodes.BadgeView | null;
constructor(data: RawNode) {
super();
this.entity_id = data.entityId;
this.accessibility_text = data.accessibilityText;
this.thumbnail = {
sources: data.thumbnail.sources.map((item: any) => ({
url: item.url,
width: item.width,
height: item.height
}))
};
this.on_tap = {
innertube_command: new NavigationEndpoint(data.onTap.innertubeCommand)
};
this.index_in_collection = data.indexInCollection;
this.logging_directives = {
tracking_params: data.loggingDirectives.trackingParams,
visibility: {
types: data.loggingDirectives.visibility.types
},
enable_displaylogger_experiment: data.loggingDirectives.enableDisplayloggerExperiment
};
this.overlay_metadata = {
secondary_text: {
content: data.overlayMetadata.secondaryText.content
},
primary_text: Reflect.has(data.overlayMetadata, 'primaryText') ? {
content: data.overlayMetadata.primaryText.content
} : undefined
};
this.inline_player_data = Reflect.has(data, 'inlinePlayerData') ? {
on_visible: {
innertube_command: new NavigationEndpoint(data.inlinePlayerData.onVisible.innertubeCommand)
}
} : undefined;
this.menu_on_tap = Reflect.has(data, 'menuOnTap') ? {
innertube_command: new NavigationEndpoint(data.menuOnTap.innertubeCommand)
} : undefined;
this.menu_on_tap_a11y_label = Reflect.has(data, 'menuOnTapA11yLabel') ? data.menuOnTapA11yLabel : undefined;
this.badge = Reflect.has(data, 'badge') ? Parser.parseItem(data.badge, YTNodes.BadgeView) : undefined;
}
}

@retrouser955
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hextor1 we told you what you need to do. Please read what we have told you and stop spamming all over the repo.

Please sign in to comment.