Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save luckycdev/e697469850988afe3b72545fe7fb7856 to your computer and use it in GitHub Desktop.
Save luckycdev/e697469850988afe3b72545fe7fb7856 to your computer and use it in GitHub Desktop.
Unblock youtube with invidious including timestamp - easily changeable invidious link

BROKEN AND I PROB WONT FIX - USE THE OLDER ONE WITHOUT TIME OR FIX THIS YOURSELF

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");}
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");}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment