mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2025-12-10 21:47:06 +03:00
Support shorts with additional parts of url
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user