Skip to content

Instantly share code, notes, and snippets.

@Albirew Albirew/InviReg.user.js forked from Tazeki/Reghook.js
Last active Aug 1, 2019

Embed
What would you like to do?
YouTube / Invidious RegEx based URL conversion.
// ==UserScript==
// @name InviReg - YouTube->Invidious
// @author Albirew, heavily based on script by Tazeki
// @namespace https://gist.github.com/Albirew/
// @description The smallest, possibly most useful YouTube-Invidious conversion script. RegEx based. 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.1
// @icon https://www.invidio.us/favicon.ico
// @grant none
// @run-at document-start
// @downloadURL https://gist.githubusercontent.com/Albirew/4bb3bee6a8037b44cf67521284e94b93/raw/
// @updateURL https://gist.githubusercontent.com/Albirew/4bb3bee6a8037b44cf67521284e94b93/raw/
// ==/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
You can’t perform that action at this time.