From ad63ec28471f151f313da4b19a4233a3541f7829 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=87=B1=E6=81=A9Kane?= <50613gary@gmail.com> Date: Sun, 13 Mar 2022 00:22:05 +0800 Subject: [PATCH] fix nullable chapters --- play-dl/YouTube/utils/extractor.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/play-dl/YouTube/utils/extractor.ts b/play-dl/YouTube/utils/extractor.ts index ec245bd..e240e29 100644 --- a/play-dl/YouTube/utils/extractor.ts +++ b/play-dl/YouTube/utils/extractor.ts @@ -232,7 +232,7 @@ export async function video_basic_info(url: string, options: InfoOptions = {}): const rawChapters = initial_response.playerOverlays.playerOverlayRenderer.decoratedPlayerBarRenderer.decoratedPlayerBarRenderer.playerBar?.multiMarkersPlayerBarRenderer.markersMap.find( (m: any) => m.key === 'DESCRIPTION_CHAPTERS' - ).value.chapters; + )?.value?.chapters; const chapters: VideoChapter[] = []; if (rawChapters) { for (const { chapterRenderer } of rawChapters) {