fix embeds

This commit is contained in:
Official Noob
2019-12-29 21:51:11 +00:00
committed by GitHub
parent fe608b579e
commit 87abcae249

View File

@@ -35,8 +35,7 @@ function getYouTubeVideoID(url) {
if(!["www.youtube.com","www.youtube-nocookie.com"].includes(urlObject.host)) return false;
//Get ID from searchParam
if(!urlObject.searchParams.has("v")) return false
if (["/watch", "/watch/"].includes(urlObject.pathname) || urlObject.pathname.startsWith("/tv/watch")) {
if (urlObject.searchParams.has("v") && ["/watch", "/watch/"].includes(urlObject.pathname) || urlObject.pathname.startsWith("/tv/watch")) {
id = urlObject.searchParams.get("v");
return id.length == 11 ? id : false;
} else if (urlObject.pathname.startsWith("/embed/")) {