diff options
author | Official Noob <[email protected]> | 2019-08-23 17:19:44 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2019-08-23 17:19:44 +0100 |
commit | a2af4dba524913123f85de61fe18350b9d6c30ea (patch) | |
tree | 992945264e48d61f3af7eaacc5b6036e72981aad | |
parent | fc4da038e9888fb8dbe65a64937f7fc971b13ed4 (diff) | |
download | SponsorBlock-a2af4dba524913123f85de61fe18350b9d6c30ea.tar.gz SponsorBlock-a2af4dba524913123f85de61fe18350b9d6c30ea.zip |
Added back getYouTubeVideoStartTime
-rw-r--r-- | utils.js | 13 |
1 files changed, 12 insertions, 1 deletions
@@ -37,4 +37,15 @@ function getYouTubeVideoID(url) { return false; } } -}
\ No newline at end of file + return false; +} + +//returns the start time of the video if there was one specified (ex. ?t=5s) +function getYouTubeVideoStartTime(url) { + let searchParams = new URL(url).searchParams; + let startTime = searchParams.get("t"); + if (startTime == null) { + startTime = searchParams.get("time_continue"); + } + return startTime; +} |