diff options
author | Ajay Ramachandran <[email protected]> | 2019-07-27 17:30:01 -0400 |
---|---|---|
committer | GitHub <[email protected]> | 2019-07-27 17:30:01 -0400 |
commit | b0090a3334f0cdd6f98e7c33e4076afdb668537c (patch) | |
tree | cfbb4330a6bca2e254e002d393e514d145145cda | |
parent | 30c1b2d91981020f3b0fa50f7a31573b21782c02 (diff) | |
parent | 71008319569ba94846257c11558f094f1af68b92 (diff) | |
download | SponsorBlock-b0090a3334f0cdd6f98e7c33e4076afdb668537c.tar.gz SponsorBlock-b0090a3334f0cdd6f98e7c33e4076afdb668537c.zip |
Merge pull request #37 from OfficialNoob/patch-5
getYouTubeVideoID Better ID Parser
-rw-r--r-- | content.js | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -676,5 +676,6 @@ function sendRequestToCustomServer(type, fullAddress, callback) { 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; } |