Merges my copy youtube timestamp bookmarklet with my unblock youtube bookmarklet. It uses invidious to unblock.
You can change the invidious link easily. change the line that says var a="https://yewtu.be";
and put any link from https://redirect.invidious.io/
Code:
javascript:
function unblockYoutubeWithTime()
{
var a="https://yewtu.be/";
var b=document.getElementById("movie_player");
var c=b.getCurrentTime();
var d="?t="+parseInt(c);
var e=location.replace(a+location.search.split("v=")[1].split("&")[0]+d);
}
if(location.hostname==="www.youtube.com")
{
if (parseInt(c) === 0)
{
location.replace(a+location.pathname);
}
else
{
unblockYoutubeWithTime();
}
}
else if(location.hostname==="youtu.be")
{
if (parseInt(c) === 0)
{
location.replace(a+location.pathname);
}
else
{
unblockYoutubeWithTime();
}
}
else if(location.hostname==="www.youtube-nocookie.com")
{
if (parseInt(c) === 0)
{
location.replace(a+location.pathname);
}
else
{
unblockYoutubeWithTime();
}
}
else
{
alert("not on youtube");
}
Bookmarklet:
javascript:function unblockYoutubeWithTime(){var a="https://yewtu.be/";var b=document.getElementById("movie_player");var c=b.getCurrentTime();var d="?t="+parseInt(c);var e=location.replace(a+location.search.split("v=")[1].split("&")[0]+d);}if(location.hostname==="www.youtube.com"){if (parseInt(c) === 0){location.replace(a+location.pathname);}else{unblockYoutubeWithTime();}}else if(location.hostname==="youtu.be"){if (parseInt(c) === 0){location.replace(a+location.pathname);}else{unblockYoutubeWithTime();}}else if(location.hostname==="www.youtube-nocookie.com"){if (parseInt(c) === 0){location.replace(a+location.pathname);}else{unblockYoutubeWithTime();}}else{alert("not on youtube");}