Skip to content

Commit

Permalink
Merge pull request #49 from OfficialNoob/patch-6
Browse files Browse the repository at this point in the history
Old function in-use
  • Loading branch information
ajayyy authored Jul 30, 2019
2 parents da20709 + 53f611a commit a1c8eca
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions popup.js
Original file line number Diff line number Diff line change
Expand Up @@ -919,8 +919,9 @@ function sendRequestToServer(type, address, callback) {
xmlhttp.send();
}

function getYouTubeVideoID(url) { // Return video id or false
function getYouTubeVideoID(url) { // Returns with video id else returns false
var regExp = /^.*((youtu.be\/)|(v\/)|(\/u\/\w\/)|(embed\/)|(watch\?))\??v?=?([^#\&\?]*).*/;
var match = url.match(regExp);
return (match && match[7].length == 11) ? match[7] : false;
var id = new URL(url).searchParams.get("v");
return (match && match[7].length == 11) ? id : false;
}

0 comments on commit a1c8eca

Please sign in to comment.