early return if url is youtube clips url

This commit is contained in:
Michael C 2022-02-06 01:05:19 -05:00
parent e8307a2af7
commit 48124e56d6
No known key found for this signature in database
GPG key ID: FFB04FB3B878B7B4

View file

@ -918,6 +918,8 @@ async function getVideoInfo(): Promise<void> {
function getYouTubeVideoID(document: Document): string | boolean {
const url = document.URL;
// clips should never skip, going from clip to full video has no indications.
if (url.includes("youtube.com/clip/")) return false;
// skip to URL if matches youtube watch or invidious or matches youtube pattern
if ((!url.includes("youtube.com")) || url.includes("/watch") || url.includes("/shorts/") || url.includes("playlist")) return getYouTubeVideoIDFromURL(url);
// skip to document and don't hide if on /embed/