GISTS/web/userscripts/InviReg.user.js
2024-05-02 00:16:45 +02:00

20 lignes
1,1 Kio
JavaScript

// ==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.1c
// @icon https://invidious.fdn.fr/favicon.ico
// @grant none
// @run-at document-start
// @downloadURL https://gist.githubusercontent.com/Albirew/4bb3bee6a8037b44cf67521284e94b93/raw/InviReg.user.js
// @updateURL https://gist.githubusercontent.com/Albirew/4bb3bee6a8037b44cf67521284e94b93/raw/InviReg.user.js
// ==/UserScript==
var url = window.location.toString();
if (url.indexOf('www.youtube.com') !== - 1) {
window.location = url.replace(/www.youtube.com/, 'invidious.fdn.fr');
} else if (url.indexOf('www.youtu.be') !== - 1) {
window.location = url.replace(/www.youtu.be/, 'invidious.fdn.fr');
}