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

Option to get rid of india videos/block the region #38

Closed
LTGM opened this issue Sep 26, 2019 · 11 comments
Closed

Option to get rid of india videos/block the region #38

LTGM opened this issue Sep 26, 2019 · 11 comments

Comments

@LTGM
Copy link

LTGM commented Sep 26, 2019

Hi,
Do you have any ideas how can I block the entire indian region? YT gone mad recently and they trying to shove their garbage 'content' down my throat (even in incognito mode, if you try to search for new mobile phones for example and their region got 'em early you will most likely to see only their videos until big channels in Europe do their own videos/reviews)
I tried to add their alphabet but for some reason its not working properly and even if I copy certain symbol (from search results) and hit apply it will still appear in the search results??

@amitbl
Copy link
Owner

amitbl commented Sep 26, 2019

If you wish to block any video with Hindi characters in title put in the filter /[\u0900-\u097F]+/
Please note that India has another 21 languages so I'm not sure which one appears in your search results

@LTGM
Copy link
Author

LTGM commented Sep 26, 2019

Okay, thanks. I hope it will filter out most of them so I can ban the remains manually down to zero

@Capripede
Copy link

Any ideas how to block Spanish language videos?

@amitbl
Copy link
Owner

amitbl commented Sep 26, 2019

Spanish is more tricky because it uses latin letters, but try this one /[ñáéíóúü]+/i

@OldGuyInTheClub
Copy link

Is there a code for the musical note icon that is part of YT's "Official artist channel" names? I tried to copy it to find its associated vale but it is not selectable. That would let me clobber a lot of unwanted content at once.

@Capripede
Copy link

I'm note sure what this icon is. Could you provide a picture?

@OldGuyInTheClub
Copy link

OldGuyInTheClub commented Oct 2, 2019

Hope this is readable.

YouTube

I dug into the source through Inspect Element and I think this is called a Verified Artists Badge. I see something similar in other channels only with a checkmark.

When I hide the element below, the checkmark disappears. It seems to be generated from svg as opposed to being an icon. I tried putting the "M0 0h34..." bit into BlockTube without success. It would be slick if there's a way to use this icon as a trigger to block channels. I have no interest in Verified Artists nor 99% of the checkmarked channels. The fragment below is very deep in the HTML hierarchy.

<svg viewBox="0 0 24 24" preserveAspectRatio="xMidYMid meet" focusable="false" class="style-scope yt-icon" style="pointer-events: none; display: block; width: 100%; height: 100%;"><g viewBox="0 0 24 24" class="style-scope yt-icon">
        <path fill="none" d="M0 0h24v24H0z" class="style-scope yt-icon"></path>
        <path d="M12 3v10.55c-.59-.34-1.27-.55-2-.55-2.21 0-4 1.79-4 4s1.79 4 4 4 4-1.79 4-4V7h4V3h-6z" class="style-scope yt-icon"></path>
      </g></svg>

@Capripede
Copy link

I have not fully looked through the code, so I don't know exactly where blocktube looks when filtering by channel ID. Because verified artists badges svg are part of a separate element, a RegEx filter might never be looking in the right place.

My workaround with ublock origin custom filters:

youtube.com##ytd-video-renderer:has(div.badge-style-type-verified-artist)
youtube.com##ytd-compact-video-renderer:has(div.badge-style-type-verified-artist)

verified-youtube

@OldGuyInTheClub
Copy link

OldGuyInTheClub commented Oct 3, 2019

That's a great idea! I will try that.

I am having some success with a three tiered approach: Video Block to get rid of "Topics" and "Recommended" sections while BlockTube gives me a lot of finer control over specific channels, keywords, etc. My uBlock experiments were a little too aggressive because I don't know how to write good filters. I think your suggestion will fix that.

Although VideoBlock is abandoned, it seems to work so long as there are not too many filters and it doesn't affect BlockTube as far as I can tell.

[Update: The uBlock filters I copied/pasted aren't hiding the badged channels. Are there any other uBlock settings that need to be on for it to work?]
[Update 2: I think that adding the www. in front of youtube fixed it for me:
www.youtube.com##ytd-video-renderer:has(div.badge-style-type-verified-artist)
www.youtube.com##ytd-compact-video-renderer:has(div.badge-style-type-verified-artist) ]

Still trying to figure out the checkmark. Might be smarter for me to bookmark a video and search from a video page, avoiding the YT homepage entirely. Should have learned javascript and CSS instead of some other languages!

@Capripede
Copy link

To block verified channels with a check mark try this filter:

youtube.com##ytd-video-renderer:has(div.badge-style-type-verified)
youtube.com##ytd-compact-video-renderer:has(div.badge-style-type-verified)

The first line targets search results. The second line targets sidebar results.

@OldGuyInTheClub
Copy link

That's what I tried using your first example as a guide but for some reason it isn't working whether with youtube.com or www.youtube.com

But, it isn't that big a deal anymore since the mix of filters is getting rid of so much uninteresting material that a few checkmarked channels aren't that big a deal.

Thanks for your filters and to amitbl for BlockTube!

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

4 participants