mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2025-12-09 04:57:09 +03:00
Fix key moments importing as chapters
This commit is contained in:
@@ -70,7 +70,8 @@ export function getExistingChapters(currentVideoID: VideoID, duration: number):
|
|||||||
const chaptersBox = document.querySelector("ytd-macro-markers-list-renderer");
|
const chaptersBox = document.querySelector("ytd-macro-markers-list-renderer");
|
||||||
|
|
||||||
const chapters: SponsorTime[] = [];
|
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;
|
let lastSegment: SponsorTime = null;
|
||||||
const links = chaptersBox.querySelectorAll("ytd-macro-markers-list-item-renderer > a");
|
const links = chaptersBox.querySelectorAll("ytd-macro-markers-list-item-renderer > a");
|
||||||
for (const link of links) {
|
for (const link of links) {
|
||||||
|
|||||||
Reference in New Issue
Block a user