• Ever wanted an RSS feed of all your favorite gaming news sites? Go check out our new Gaming Headlines feed! Read more about it here.

qaopjlll

Member
Oct 27, 2017
2,788
Install Tampermonkey or similar web script extension and add this script and you'll never* have to worry about videos with Peterson or Shapiro popping up again

(Updated code below)

I had been running a similar script and it seemed to work at first, but after it stopped working I did some debugging and found that it was executing before the page elements finished loading. So I added code to wait an extra 5 seconds before executing and now it seems to be working fine. You can increase the amount of time it waits by updating the 5000 in the code to however many milliseconds you think you'll need.

One thing it does not block the associated thumbnail links to the videos as these belong to a different class. If somebody who actually knows what they're doing in javascript wants to update it to remove the thumbnails, or can figure out how to make it wait until all elements are loaded before running (I tried adding a listener but it didn't work), that would be great!

UPDATE:

I think I managed to get it to hide the entire recommendation element including the thumbnail link -- I ran this on a page that was showing Shapiro/Peterson recs and they all disappeared entirely. Now I just need to figure out how to implement an event listener to ensure that the code runs as soon as the page loads the elements.

Code:
// ==UserScript==
// @name        youtube hide recommended  crap
// @namespace   hindbrain
// @description hide youtube recommended for you in side bar
// @include     *youtube*
// @version     1
// @grant       none
// ==/UserScript==

setTimeout(function() {

//Code to run After timeout elapses
'use strict';

    //var spans = document.getElementsByClassName("yt-simple-endpoint style-scope ytd-compact-video-renderer");
    var spans = document.getElementsByClassName("style-scope ytd-watch-next-secondary-results-renderer");
    var spanschildren;
    var flag;
    console.log('spans length:' + spans.length);


    for (var i = 0; i < spans.length; i++) {
        flag = 0;
        console.log("Tag: " + spans[i].tagName);
        if (spans[i].tagName == "YTD-COMPACT-VIDEO-RENDERER"){
        console.log(spans[i].textContent);
        console.log('Text contains Shapiro: ' + spans[i].textContent.includes('Shapiro'));
        console.log('Text contains Peterson: ' + spans[i].textContent.includes('Peterson'));


        spanschildren = spans[i].children;
        console.log('spanschildren length:' + spanschildren.length);
        for (var j = 0; j < spanschildren.length; j++){
            console.log(spanschildren[j].textContent);

            if (spanschildren[j].textContent.includes('Shapiro') || spanschildren[j].textContent.includes('Peterson') || spanschildren[j].textContent.includes('JonTron')){
             flag = 1;

        }
        }
        }
     if (flag == 1){
      spans[i].hidden = "true";
     }
    }



}, 5000); //Five seconds will elapse and Code will execute.

;
 
Last edited:

Deleted member 4614

Oct 25, 2017
6,345
Make the options into an array so you can configure it to your heart's desire
 

rucury

▲ Legend ▲
Avenger
Oct 25, 2017
1,383
Puerto Rico
A quick read through the script shows it will block any video with text that includes "Shapiro", "Peterson" OR also "JonTron". Might wanna mention that.
 

Necromanti

Member
Oct 25, 2017
11,546
I don't know any JavaScript, but that seems like it would be very easy to customize and extend. Thanks.
 

Ernest

Member
Oct 25, 2017
7,463
So.Cal.
I don't get these guys recommended to me on YT, thank god.
The one I keep getting that I don't want only because I watched ONCE is Joe Rogan.
 

Neoriceisgood

One Winged Slayer
Member
Oct 26, 2017
1,142
I just run a video blocker that permanently disables channels I tick as unwanted, by now I have 90% of the commonly recommended Shapiro/Lobster compilation channels blocked.
 

Razorskin

Member
Oct 25, 2017
3,431
What if its a Ben Shapiro/Jordan Peterson video where the title or uploader doesn't include their names?
 

ChuckStank

Banned
Mar 14, 2018
242
User Banned (5 Days): Antagonizing other members and threadwhining, previous infractions, account still in junior phase
Or you can just ignore them and go on with your fragile life. Jesus fucking Christ you people.
 

Sykdom

Banned
Feb 12, 2019
993
California
I don't get these guys recommended to me on YT, thank god.
The one I keep getting that I don't want only because I watched ONCE is Joe Rogan.

I watched a few BazBattles videos and now my youtube is full of Sam Harris crap.

Or you can just ignore them and go on with your fragile life. Jesus fucking Christ you people.

o_O I usually do, you can click the video and report them to try and tailor your channel. But sometimes they just keep coming back and it gets a little annoying.
 

DrBo42

Avenger
Oct 25, 2017
3,760
Or you can just ignore them and go on with your fragile life. Jesus fucking Christ you people.
141c6d5b-2596-5d39-8b9c-d0bf84097b4b.image.jpg
 

Damaniel

The Fallen
Oct 27, 2017
6,535
Portland, OR
In all my years of YouTube, I've never been recommended any videos from Shapiro or Peterson (or any of those 'XYZ OWNS CUCK SJWS!' videos I'm always hearing about) - guess I'm not on the right (or wrong, I guess) part of YouTube for that. Any script that guarantees that is a good idea in my book though.
 

Orin_linwe

Member
Nov 26, 2017
706
Malmoe, Sweden.
Doing God's work.

Bless.

EDIT: The problem with "just ignoring" these videos is that youtube's algorithm has a tendency to recommend alt-right content to a degree that's hard to hand-wave as just anecdotal, or conspiratorial.

A couple of months ago I clicked on one of those videos as a curiosity, but closed it after a minute or two. For the next 2-3 weeks more than half of my recommended videos were alt-right dullards. This never happens with other types of videos, when I veer away from the content I usually watch.

Like, if I click on a "how to hand-make a key" video because I'm drunk, my recommendation-list won't suddenly be dominated by locksmithing stuff for weeks on end.

I don't particularly care exactly why this happens. I'm assuming it's due to a lot of factors that are data-driven, rather than ideological (ie, I don't think youtube has any ideological interest in pushing alt-right loons to the front).

But it would be nice if I didn't have to think of entire categories of videos as digital, infectious diseases.
 
Last edited:
OP
OP
qaopjlll

qaopjlll

Member
Oct 27, 2017
2,788
UPDATE:

I think I managed to get it to hide the entire recommendation element including the thumbnail link -- I ran this on a page that was showing Shapiro/Peterson recs and they all disappeared entirely.

Code:
// ==UserScript==
// @name        youtube hide recommended  crap
// @namespace   hindbrain
// @description hide youtube recommended for you in side bar
// @include     *youtube*
// @version     1
// @grant       none
// ==/UserScript==

setTimeout(function() {

//Code to run After timeout elapses
'use strict';

    //var spans = document.getElementsByClassName("yt-simple-endpoint style-scope ytd-compact-video-renderer");
    var spans = document.getElementsByClassName("style-scope ytd-watch-next-secondary-results-renderer");
    var spanschildren;
    var flag;
    console.log('spans length:' + spans.length);


    for (var i = 0; i < spans.length; i++) {
        flag = 0;
        console.log("Tag: " + spans[i].tagName);
        if (spans[i].tagName == "YTD-COMPACT-VIDEO-RENDERER"){
        console.log(spans[i].textContent);
        console.log('Text contains Shapiro: ' + spans[i].textContent.includes('Shapiro'));
        console.log('Text contains Peterson: ' + spans[i].textContent.includes('Peterson'));
 

        spanschildren = spans[i].children;
        console.log('spanschildren length:' + spanschildren.length);
        for (var j = 0; j < spanschildren.length; j++){
            console.log(spanschildren[j].textContent);

            if (spanschildren[j].textContent.includes('Shapiro') || spanschildren[j].textContent.includes('Peterson') || spanschildren[j].textContent.includes('JonTron')){
             flag = 1;

        }
        }
        }
     if (flag == 1){
      spans[i].hidden = "true";
     }
    }



}, 5000); //Five seconds will elapse and Code will execute.

;
 

Hero_of_the_Day

Avenger
Oct 27, 2017
17,329
I just run a video blocker that permanently disables channels I tick as unwanted, by now I have 90% of the commonly recommended Shapiro/Lobster compilation channels blocked.

What are you using to do that? I was trying to find something to let me block shit channels the other day and wasn't successful.

Or you can just ignore them and go on with your fragile life. Jesus fucking Christ you people.

Why the fuck would it bother you that some of us would like to stop seeing garbage all over youtube?
 

deathkiller

Member
Apr 11, 2018
923
I suppose that everyone experience differs but in my case I rarely see recommendations of right wing propaganda, after watching hundreds of youtube videos almost always ignoring them the algorithm seems to have gotten a clue that I am not interested. The last time I saw one as recommended was the typical "answer/response" vid to a left wing one that led me to look for and watch the original one instead.
 

Neoriceisgood

One Winged Slayer
Member
Oct 26, 2017
1,142
Or you can just ignore them and go on with your fragile life. Jesus fucking Christ you people.

This thread is entirely about facilitation such behavior.

Seriously though, what has you so upset at people wanting to unclog their recs? I like it when YT suggestions actually include stuff I want to watch & not the same 4 videos I have zero interest in.
 

Crossing Eden

Member
Oct 26, 2017
53,304
I use video blocker. Much more specific and I can do it on the spot whenever YT makes a dumb recommendation.
 

Aftermath

Member
Oct 27, 2017
3,756
Well IOnly use Youtube on my TV mostly, so some of these options such as scripts etc aren't available on my TV device but incase someone is in the same boat I just tried this -

I was able to at least use the three dots option on a mobile device such as a tablet by downloading YouTube logging into that and on videos click the three dots under a video thumbnail and choose not interested, to get rid of people like pewdiepie, I don't know if it will work in the long run based on OP's experience but maybe YouTube will get the hint.

But if it wasn't for this thread I wouldn't have even known that so thanks.
 
Last edited: