Skip to content

Instantly share code, notes, and snippets.

@Tazeki
Last active August 1, 2019 11:45
Show Gist options
  • Save Tazeki/4474bc972710872c429e660a6b08681d to your computer and use it in GitHub Desktop.
Save Tazeki/4474bc972710872c429e660a6b08681d to your computer and use it in GitHub Desktop.
YouTube / HookTube RegEx based URL conversion.
// ==UserScript==
// @name URL Conversion | YouTube - HookTube
// @namespace Tazeki
// @description The smallest, possibly most useful YouTube-HookTube conversion script. RegEx based. Report bugs to tangentale@protonmail.com. Sends any /www.youtube.com/ sites to HookTube before page load. Does not affect /other.youtube.com/, (gaming.youtube.com, creatoracademy.youtube.com, etc.).
// @include *youtube*
// @version 1
// @grant none
// @run-at document-start
// ==/UserScript==
var url = window.location.toString();
if (url.indexOf('www.youtube.com') !== - 1) {
window.location = url.replace(/youtube.com/, 'hooktube.com');
} else if (url.indexOf('www.youtu.be') !== - 1) {
window.location = url.replace(/youtu.be/, 'hooktube.com');
}
@LOuroboros
Copy link

LOuroboros commented Jul 25, 2018

Firefox users will need to look up how to find their profile directory and maybe read a how to on Grease Monkey .

Not at all, @Lew-Rockwell-Fan. Even someone like me, who only had one single script installed was able to do it just fine.

  1. Copy the piece of code created by Tazeki
  2. Go to GreaseMonkey and hit the "New User Script" button.
  3. In the new tab that opens, paste the code and hit the floppy disk/save button
  4. Test.

And that's it. It's extremely easy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment