Update utils.js

This commit is contained in:
Official Noob 2019-12-29 21:42:43 +00:00 committed by GitHub
parent 1db9d25f3b
commit f74e25a482
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -35,6 +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")) {
id = urlObject.searchParams.get("v");
return id.length == 11 ? id : false;