lawrencehook/remove-youtube-suggestions

[FEATURE_REQUEST] Function to block/hide channels, Users and separate videos

Opened this issue · 2 comments

Is your feature request related to a problem? Please describe.

Currently, users do not have the ability to block or hide specific channels, users, or individual videos. This lack of functionality can lead to a less personalized experience on YouTube for users who wish to tailor their content consumption to their preferences. Additionally, it may result in exposure to unwanted or undesirable content.

Describe the solution you'd like

I propose implementing a feature that allows users to block or hide separate videos, users, or entire channels. This feature would include a text input area under the category "General" labeled "Block list". In this input area, users would be able to insert links to channels, usernames, or video links that they wish to block or hide from their feed. You can use https://codemirror.net/ as a text input area like Ublock origin has in the My filters page

Additional context

The ability to block or hide specific channels, users, or videos is a common feature in extensions like Ublock origin to block ads manually and automatic. By implementing this feature, users will have a greater control over their content feed, leading to a more personalized and enjoyable user experience.

Hi, I tried to get rid of videos based on the username, and it does work.

image

@lawrencehook We need to add an event listener on the search bar and scrolling. It looks like YT shows 20 results more on each scroll, so it should somehow only filter those when scrolling.

function block(username) {
    const videos = document.querySelectorAll('ytd-video-renderer')
    videos.forEach( video => {
        const currUsername = video
            .querySelector('a.yt-simple-endpoint.style-scope.yt-formatted-string')
            .getAttribute('href')
            .slice(1);
        console.log(currUsername);
    
        if (currUsername == username) {
            video.style.display = 'none';
        }
    })
}

block('@AlexHormozi');

@porobertdev
This is nice. If its possible to add the input area (block list) where users would be able to insert links to channels, usernames, or video links to block that would be nice take a look at the example below
image