From 3c41d90b67fad0e0873deb7d4fa2c1e78fdee113 Mon Sep 17 00:00:00 2001 From: Brahim Hadriche Date: Mon, 2 Dec 2024 13:45:29 -0500 Subject: [PATCH] [skip ci] small refactor in innertube parsing --- .../Services/Innertube/InnertubeService.bs | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/playlet-lib/src/components/Services/Innertube/InnertubeService.bs b/playlet-lib/src/components/Services/Innertube/InnertubeService.bs index f7813258..66ca1398 100644 --- a/playlet-lib/src/components/Services/Innertube/InnertubeService.bs +++ b/playlet-lib/src/components/Services/Innertube/InnertubeService.bs @@ -373,17 +373,7 @@ namespace InnertubeService end function function ParseCaptions(payload as object) as object - captions = payload["captions"] - if not IsAssociativeArray(captions) - return [] - end if - - playerCaptions = captions["playerCaptionsTracklistRenderer"] - if not IsAssociativeArray(playerCaptions) - return [] - end if - - tracks = playerCaptions["captionTracks"] + tracks = ObjectUtils.Dig(payload, ["captions", "playerCaptionsTracklistRenderer", "captionTracks"]) if not IsArray(tracks) return [] end if