Last active
June 28, 2020 02:03
-
-
Save XtinaSchelin/207cd214a44552d1a2d2f908f4da8394 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name YouTube Blocking Dammit | |
// @namespace https://xtinas.org | |
// @version 0.2 | |
// @description Block YouTube videos of cops and other racist crap. | |
// @author Xtina S. | |
// @match https://www.youtube.com/* | |
// @match https://youtube.com/* | |
// @grant none | |
// ==/UserScript== | |
var skips = ["EmFcsAJ_02Q", "uM8dBgkqJGc", "eQ5V92z-Oas", | |
"tOiiH_RdrDg", "GFrQ9S0tRFQ", "QVzkT8gQhoQ", | |
"V_UhnxIBf28", "fSXog_LKro8", "k0SkWCCWrF8", | |
"n1OpN45r7-k", "ywi33UvQ3zk", "urdg94V7NLE", | |
"nm6pyFkfdF8", "9Z6ZJrvDpys", "Fk12bruLxU0", | |
"eCZG3VjrRyE", "jiiQ1DnUVCY", "UncNXNH6m78", | |
"WJjWx-FIQCA", "CWl6_1ilRCY", "wIAsZEbZtRk", | |
"CJ8DngeVZqU", "9FAz6IIVDq0", "PQfT4rUVPCY", | |
"bsSIUHXas7M", "kakBVWFOTwc", "m_oE8Xl9NTI", | |
"jbifdwMX0fk", "_D1rPMZBxrQ", "-dqrKDuqzMU", | |
"2mxJkPNMpwA", "4leGveePcPU", "lb4kSGS6nTU", | |
"sLcZMq8o1to", "jbifdwMX0fk", "Mt86V01A9QM", | |
"Ea5ZzxjLqbw", "Ro8Rhprio9Y", "bI5p8SN-Tt4", | |
"tA2mCzIgOBM"]; | |
var phrases = [ | |
"10 little indians", | |
"ten little indians", | |
"paw patrol" | |
]; | |
setInterval(function(){ | |
for (var x = 0; x < skips.length; x++) | |
{ | |
if (document.location.href.indexOf(skips[x]) > -1) | |
{ | |
document.getElementById("logo-icon-container").click(); | |
} | |
} | |
var all_links = document.getElementsByTagName("a"); | |
for (var q = 0; q < all_links.length; q++) | |
{ | |
if (all_links[q].getAttribute("href") != null) | |
{ | |
for (x = 0; x < skips.length; x++) | |
{ | |
if (all_links[q].getAttribute("href").indexOf("watch?v=" + skips[x]) > -1) | |
{ | |
var styles = "opacity: .5"; | |
all_links[q].setAttribute("style", styles); | |
all_links[q].setAttribute("href", "/"); | |
} | |
} | |
for (x = 0; x < phrases.length; x++) | |
{ | |
if (all_links[q].getAttribute("title") != null) | |
{ | |
if (all_links[q].getAttribute("href") != "/" && all_links[q].getAttribute("title").toLowerCase().indexOf(phrases[x]) > -1) | |
{ | |
console.log(all_links[q].getAttribute("href")); | |
all_links[q].setAttribute("href", "/"); | |
all_links[q].parentNode.parentNode.parentNode.parentNode.parentNode.setAttribute("style", "opacity: .5"); | |
} | |
} | |
} | |
} | |
} | |
}, 3000); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment