mirror of
https://github.com/LuanRT/YouTube.js.git
synced 2026-06-19 20:41:17 +00:00
feat(parser): Parse targetId
Used by the UI to identify interactions/commands sent by nodes deep into the response (ChipCloudChip, Button, etc..)
This commit is contained in:
@@ -517,6 +517,10 @@ export function parseResponse<T extends IParsedResponse = IParsedResponse>(data:
|
||||
if (data.entries) {
|
||||
parsed_data.entries = data.entries.map((entry) => new NavigationEndpoint(entry));
|
||||
}
|
||||
|
||||
if (data.targetId) {
|
||||
parsed_data.target_id = data.targetId;
|
||||
}
|
||||
|
||||
return parsed_data;
|
||||
}
|
||||
|
||||
@@ -75,6 +75,7 @@ export interface IParsedResponse {
|
||||
items?: SuperParsedResult<YTNode>;
|
||||
entries?: NavigationEndpoint[];
|
||||
entries_memo?: Memo;
|
||||
target_id?: string;
|
||||
continuation_endpoint?: YTNode;
|
||||
player_response?: IPlayerResponse;
|
||||
watch_next_response?: INextResponse;
|
||||
|
||||
@@ -112,6 +112,7 @@ export interface IRawResponse {
|
||||
cpn: string;
|
||||
cpnSource: CpnSource;
|
||||
},
|
||||
targetId?: string;
|
||||
items?: RawNode[];
|
||||
frameworkUpdates?: any;
|
||||
engagementPanels?: RawNode[];
|
||||
|
||||
Reference in New Issue
Block a user