From 0a99342ccbd6f8b1c611ef6b157a599ff5ae2247 Mon Sep 17 00:00:00 2001 From: Luan Date: Sat, 9 Nov 2024 16:36:40 -0300 Subject: [PATCH] fix(VideoAttributeView): Parse `secondarySubtitle` only if exists --- src/parser/classes/VideoAttributeView.ts | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/parser/classes/VideoAttributeView.ts b/src/parser/classes/VideoAttributeView.ts index 908f0379..696fd4e3 100644 --- a/src/parser/classes/VideoAttributeView.ts +++ b/src/parser/classes/VideoAttributeView.ts @@ -14,7 +14,7 @@ export default class VideoAttributeView extends YTNode { image_style: string; title: string; subtitle: string; - secondary_subtitle: { + secondary_subtitle?: { content: string }; orientation: string; @@ -34,9 +34,13 @@ export default class VideoAttributeView extends YTNode { this.image_style = data.imageStyle; this.title = data.title; this.subtitle = data.subtitle; - this.secondary_subtitle = { - content: data.secondarySubtitle.content - }; + + if (Reflect.has(data, 'secondarySubtitle')) { + this.secondary_subtitle = { + content: data.secondarySubtitle.content + }; + } + this.orientation = data.orientation; this.sizing_rule = data.sizingRule; this.overflow_menu_on_tap = new NavigationEndpoint(data.overflowMenuOnTap);