From bfa31429f11493429a493544a7ddb43fb31821d9 Mon Sep 17 00:00:00 2001 From: Ajay Ramachandran Date: Sun, 3 Oct 2021 13:08:50 -0400 Subject: [PATCH] Support shorts with additional parts of url --- src/content.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/content.ts b/src/content.ts index 8c178bd1..50ca77e3 100644 --- a/src/content.ts +++ b/src/content.ts @@ -880,7 +880,7 @@ function getYouTubeVideoID(url: string): string | boolean { } else if (urlObject.pathname.startsWith("/embed/") || urlObject.pathname.startsWith("/shorts/")) { try { const id = urlObject.pathname.split("/")[2]; - if (id && id.length == 11) return id; + if (id && id.length >= 11) return id.substr(0, 11); } catch (e) { console.error("[SB] Video ID not valid for " + url); return false;