From 49a166a6b247bca2e9a28888378bda17242a40f2 Mon Sep 17 00:00:00 2001 From: Ajay Date: Mon, 10 Oct 2022 23:34:34 -0400 Subject: [PATCH] Fix key moments importing as chapters --- src/utils/pageUtils.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/utils/pageUtils.ts b/src/utils/pageUtils.ts index d753752c..ff25cac6 100644 --- a/src/utils/pageUtils.ts +++ b/src/utils/pageUtils.ts @@ -70,7 +70,8 @@ export function getExistingChapters(currentVideoID: VideoID, duration: number): const chaptersBox = document.querySelector("ytd-macro-markers-list-renderer"); const chapters: SponsorTime[] = []; - if (chaptersBox) { + // .ytp-timed-markers-container indicates that key-moments are present, which should not be divided + if (chaptersBox && !(document.querySelector(".ytp-timed-markers-container")?.childElementCount > 0)) { let lastSegment: SponsorTime = null; const links = chaptersBox.querySelectorAll("ytd-macro-markers-list-item-renderer > a"); for (const link of links) {