Created
January 22, 2018 02:06
-
-
Save sprngr/d070711eca2cb08eaba37c743bc6ad7f to your computer and use it in GitHub Desktop.
Removes specified channels from showing up in your YouTube results
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 Channel Results Filter | |
// @version 0.2 | |
// @description Removes specified channels from showing up in your YouTube results | |
// @author sprngr | |
// @match https://www.youtube.com/* | |
// @grant none | |
// ==/UserScript== | |
window.onload = (function() { | |
'use strict'; | |
// Using Markiplier as an example here. Supports YouTube username or channel hash that can be found in the link back to a profile. | |
// Searches for instances of links back to a profile, and removes the parent container. Polls every 500ms to check due to autoloads. | |
var channelList = ['markiplierGAME']; | |
var removeResultsForChannel = function(channel) { | |
var channelResults = document.querySelectorAll('[href*="/' + channel + '"]'); | |
channelResults.forEach(function(channel) { | |
console.log("removing video"); | |
channel.closest('ytd-video-renderer, ytd-playlist-renderer').remove(); | |
}); | |
}; | |
setInterval(function(){ | |
channelList.forEach(function(channel) { | |
removeResultsForChannel(channel); | |
}, 500); | |
}); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment