Browse Source

Initial Commit

master
IBR 8 months ago
commit
d9e5a9fc1d
  1. 0
      README.md
  2. 11
      reddit.js
  3. 40
      youtube.js

0
README.md

11
reddit.js

@ -0,0 +1,11 @@
// ==UserScript==
// @name Reddit to Old Reddit redirector
// @namespace reddit_to_oldreddit_redirector
// @description Redirect Reddit links to Old Reddit
// @include https://www.reddit.com*
// @version 1.0
// @grant none
// ==/UserScript==
// alert("Redirecting");
window.location = window.location.href.replace( "www.reddit.com", "old.reddit.com" );

40
youtube.js

@ -0,0 +1,40 @@
// ==UserScript==
// @name Youtube to Invidious redirector
// @namespace youtube_to_invidious_redirector
// @description Redirect Youtube links to Invidious
// @include https://www.youtube.com/
// @include https://www.google.com/sorry/index*
// @include https://invidious.13ad.de/channel/*
// @version 1.0
// @grant none
// ==/UserScript==
// Redirect from google error page
if (window.location.host === "www.google.com") {
const urlParams = new URLSearchParams(window.location.search);
let cont = urlParams.get('continue');
cont = decodeURI(cont);
cont = cont.replace( "www.youtube.com", getInstance() );
window.location = cont;
// Redirect youtube
} else if (window.location.host === "www.youtube.com") {
// window.location = window.location.href.replace( "www.youtube.com", getInstance() );
// Fix instance issues
} else {
window.location = window.location.href.replace( "invidious.13ad.de/channel", "invidious.snopyta.org/channel" );
}
function getInstance() {
const instances = [
"invidious.snopyta.org",
"yewtu.be",
"invidious.13ad.de"
];
// return instances[0];
return instances[Math.floor(Math.random() * instances.length)]
}
Loading…
Cancel
Save