fix: getVideoId() with clip (#1055)

This commit is contained in:
ThomasTech authored and GitHub committed 2024-06-16 14:24:21 +02:00
1 parent eda0aca9e9
commit bf98563c17
2 files changed
+2 -2

No files matched your search

@@ -504,7 +504,7 @@ function getVideoId() {
const urlObject = new URL(window.location.href);
const pathname = urlObject.pathname;
if (pathname.startsWith("/clip")) {
return document.querySelector("meta[itemprop='videoId']").content;
return (document.querySelector("meta[itemprop='videoId']") || document.querySelector("meta[itemprop='identifier']")).content;
} else {
if (pathname.startsWith("/shorts")) {
return pathname.slice(8);
+1 -1
View File
@@ -66,7 +66,7 @@ function getVideoId(url) {
const urlObject = new URL(url);
const pathname = urlObject.pathname;
if (pathname.startsWith("/clip")) {
return document.querySelector("meta[itemprop='videoId']").content;
return (document.querySelector("meta[itemprop='videoId']") || document.querySelector("meta[itemprop='identifier']")).content;
} else {
if (pathname.startsWith("/shorts")) {
return pathname.slice(8);