diff --git a/src/content.ts b/src/content.ts index 881765e7..0730d59a 100644 --- a/src/content.ts +++ b/src/content.ts @@ -904,15 +904,15 @@ async function getVideoInfo(): Promise { function getYouTubeVideoID(document: Document): string | boolean { const url = document.URL; // skip to URL if matches youtube watch or invidious or matches youtube pattern - if ((!url.includes("youtube.com")) || url.includes("/watch") || url.includes("/embed/") || url.includes("/shorts/") || url.includes("playlist")) return getYouTubeVideoIDFromURL(url); + if ((!url.includes("youtube.com")) || url.includes("/watch") || url.includes("/shorts/") || url.includes("playlist")) return getYouTubeVideoIDFromURL(url); // skip to document if matches pattern - if (url.includes("/channel/") || url.includes("/user/") || url.includes("/c/")) return getYouTubeVideoIDFromDocument(document); + if (url.includes("/channel/") || url.includes("/user/") || url.includes("/c/") || url.includes("/embed/")) return getYouTubeVideoIDFromDocument(document); // not sure, try URL then document return getYouTubeVideoIDFromURL(url) || getYouTubeVideoIDFromDocument(document); } function getYouTubeVideoIDFromDocument(document: Document): string | boolean { - // get ID from document (channel trailer) + // get ID from document (channel trailer / embedded playlist) const videoURL = document.querySelector("[data-sessionlink='feature=player-title']")?.getAttribute("href"); if (videoURL) { onInvidious = true;