aboutsummaryrefslogtreecommitdiffstats
path: root/scripts-greasemonkey/invidio_proxy_mode.user.js
blob: 27988588f237745686ae5bec30a99112137deab4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
// ==UserScript==
// @name         Invidious - ProxyMode
// @version      0.1.0
// @author       Jesús E.
// @license      GPL-3.0
// @description  This script automatically Proxy-Mode on Invidious and its various public instances.
// @namespace    InvidiousProxy
// @homepageURL  https://libregit.org/heckyel/book/src/branch/master/scripts-greasemonkey
// @include      /^http(s|)://(www[.]|)invidio[.]us/.*$/
// @include      /^http(s|)://(www[.]|proxy[.])invidious[.]snopyta[.]org/.*$/
// @include      /^http(s|)://(www[.]|)vid[.]wxzm[.]sx/.*$/
// @include      /^http(s|)://(www[.]|)invidious[.]kabi[.]tk/.*$/
// @include      /^http(s|)://(www[.]|)invidiou[.]sh/*
// @include      /^http(s|)://(www[.]|)invidious[.]enkirton[.]net/.*$/
// @include      /^http(s|)://(www[.]|)tube[.]poal[.]co/.*$/
// @include      /^http(s|)://(www[.]|)invidious[.]13ad[.]de/.*$/
// @grant        none
// ==/UserScript==

(function proxyMode() {
    'use strict';
    var consoleCSS = 'background: #000; color: #00FF00; padding: 0px 7px; border: 1px solid #00FF00; line-height: 16px;';

    if (!(/[?&]local=/).test(location.search) && !(/[?&]quality=dash/).test(location.search)) {
        location.search += (location.search ? "&" : "?") + "local=true";
        // Check
        console.log("%cUSERSCRIPT | " + GM_info.script.name + " " + GM_info.script.version + " | successfully initialized", consoleCSS);
    }
})();