Skip to content

Instantly share code, notes, and snippets.

@LOuroboros
Forked from Tazeki/Reghook.js
Created July 22, 2019 17:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save LOuroboros/a0c04bf1c443f57cc75e8f166ad75d47 to your computer and use it in GitHub Desktop.
Save LOuroboros/a0c04bf1c443f57cc75e8f166ad75d47 to your computer and use it in GitHub Desktop.
YouTube / Invidious RegEx based URL conversion.
// ==UserScript==
// @name URL Conversion | YouTube - Invidious
// @namespace Tazeki
// @description The smallest, possibly most useful YouTube-Invidious conversion script. RegEx based. Report bugs to tangentale@protonmail.com. Sends any /www.youtube.com/ sites to Invidious 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/, 'invidio.us');
} else if (url.indexOf('www.youtu.be') !== - 1) {
window.location = url.replace(/youtu.be/, 'invidio.us');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment