From 7a7b21cd873479e4e9f1129287269b3e5a23f9c5 Mon Sep 17 00:00:00 2001 From: Michael C Date: Fri, 31 Dec 2021 18:17:15 -0500 Subject: [PATCH] add path for embedded videos and playlists --- src/content.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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;