Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save luckycdev/5e072ba7a5de70aeee6f0afa46562779 to your computer and use it in GitHub Desktop.
Save luckycdev/5e072ba7a5de70aeee6f0afa46562779 to your computer and use it in GitHub Desktop.
Unblock any youtube link with an https://redirect.invidious.io/ link. Default = vid.puffyan.us - easily changeable

Unblock Youtube Bookmarklet

Easily changeable unblocked link. A place to get different Invidious links is https://redirect.invidious.io/ To change it: change where it says var a="https://vid.puffyan.us";

Code:

javascript:
var a="https://vid.puffyan.us";
if(location.hostname==="www.youtube.com")
{
location.assign(a+location.pathname+location.search);
}
else if(location.hostname==="youtu.be")
{
location.assign(a+location.pathname+location.search);
}
else if(location.hostname==="www.youtube-nocookie.com")
{
location.assign(a+location.pathname+location.search);
}
else
{
alert("not on youtube");
}

Bookmarklet:

javascript:var a="https://vid.puffyan.us";if(location.hostname==="www.youtube.com"){location.assign(a+location.pathname+location.search);}else if(location.hostname==="youtu.be"){location.assign(a+location.pathname+location.search);}else if(location.hostname==="www.youtube-nocookie.com"){location.assign(a+location.pathname+location.search);}else{alert("not on youtube");}
javascript:var a="https://vid.puffyan.us";if(location.hostname==="www.youtube.com"){location.assign(a+location.pathname+location.search);}else if(location.hostname==="youtu.be"){location.assign(a+location.pathname+location.search);}else if(location.hostname==="www.youtube-nocookie.com"){location.assign(a+location.pathname+location.search);}else{alert("not on youtube");}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment