mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2025-12-11 22:17:21 +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/")) {
|
} else if (urlObject.pathname.startsWith("/embed/") || urlObject.pathname.startsWith("/shorts/")) {
|
||||||
try {
|
try {
|
||||||
const id = urlObject.pathname.split("/")[2];
|
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) {
|
} catch (e) {
|
||||||
console.error("[SB] Video ID not valid for " + url);
|
console.error("[SB] Video ID not valid for " + url);
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
Reference in New Issue
Block a user