Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
deffcolony opened this issue Mar 28, 2024 · 2 comments

Comments

@deffcolony
Copy link

deffcolony commented Mar 28, 2024

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.

@porobertdev
Copy link
Contributor

porobertdev commented May 2, 2024

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');

@deffcolony
Copy link
Author

@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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants