From ea873e38b1962b5ee06f510f5869248c85a601dc Mon Sep 17 00:00:00 2001 From: Koichi Yamamoto Date: Sun, 23 Apr 2023 16:37:02 +0900 Subject: [PATCH] feat: Add support for chapter thumbnails --- lib/info-extras.js | 1 + typings/index.d.ts | 1 + 2 files changed, 2 insertions(+) diff --git a/lib/info-extras.js b/lib/info-extras.js index e735a4a8..9927efea 100644 --- a/lib/info-extras.js +++ b/lib/info-extras.js @@ -361,5 +361,6 @@ exports.getChapters = info => { return chapters.map(chapter => ({ title: getText(chapter.chapterRenderer.title), start_time: chapter.chapterRenderer.timeRangeStartMillis / 1000, + thumbnails: chapter.chapterRenderer.thumbnail && chapter.chapterRenderer.thumbnail.thumbnails, })); }; diff --git a/typings/index.d.ts b/typings/index.d.ts index dd9e8d4d..11aa1da0 100644 --- a/typings/index.d.ts +++ b/typings/index.d.ts @@ -226,6 +226,7 @@ declare module 'ytdl-core' { interface Chapter { title: string; start_time: number; + thumbnails: thumbnail[]; } interface MoreVideoDetails extends Omit, Omit {