amitbl / blocktube

YouTube™ content blocker
GNU General Public License v3.0
855 stars 57 forks source link

Comment blocking appears to be broken #397

Open lazarusinashes opened 3 months ago

lazarusinashes commented 3 months ago

Comment blocking appears to no longer work. No block channel option appears in the context menu and comments that match the filter still appear despite reinstalling the extension.

artcytracy commented 3 months ago

I am having this issue also. None of my comment content filters are working as of today.

FlashlightET commented 2 months ago

same i am now pestered by hundreds of wrong opinions in my comment sections

sawtoothpuma commented 2 months ago

same i am now pestered by hundreds of wrong opinions in my comment sections

What wrong opinions?

TimeEditor commented 2 months ago

What wrong opinions?

Yours, specifically

abudulamh commented 2 months ago

same

sawtoothpuma commented 2 months ago

What wrong opinions?

Yours, specifically

What do you mean by that?

artcytracy commented 2 months ago

What wrong opinions?

Yours, specifically

What do you mean by that?

@sawtoothpuma Please keep this thread related to the technical issue. This is not the YouTube comments section.

Warning-Forever commented 2 months ago

Same

idomori commented 2 months ago

it's not just the context menu. The entire comment blocking function is broken. They are not blocked even if you add the channel id manually.

kuroman96 commented 2 months ago

Yeah, same for me. It doesn't work anymore. The block comment option is unavailable. I can only use the classical report button from youtube that doesn't prevent you from seeing the comment anyway. Does anybody have a clue about this issue?

SavannahJohnston commented 2 months ago

Yep, just spent the last five or ten minutes trying to figure out what I was doing wrong with my regex filters, before it finally occurred to me that perhaps comment blocking isn't working at all.

De-Troll YouTube also broke recently, and when I contacted the dev he said it was because "YouTube changed some of their tags", so maybe this is caused by the same issue?

@sawtoothpuma

What wrong opinions?

Yours, specifically

What do you mean by that?

I think they were being facetious.

artcytracy commented 2 months ago

@SavannahJohnston Yes Youtube has been pushing a lot of updates in recent months. Every few weeks now it seems that it conflicts with one of my multiple adblocker extensions or BlockTube. It's a lot of work to stay one step ahead of them. I am a developer but I mostly do backend work in Python. I may start looking at the code however and see if I can't start contributing to the maintenance of some of these brilliant extensions that I rely on so heavily!

lazarusinashes commented 2 months ago

same i am now pestered by hundreds of wrong opinions in my comment sections

I personally use it to block annoying overused jokes ("I took that personally" and "plot twist:" are both in it) and I never knew how much I would miss comment blocking

GithubAnon0000 commented 2 months ago

It would be great if there was a short (or longer) tutorial here showing us how to fix errors within blocktube that had been introduced by youtube updates. I know a little bit of javascript but couldn't figure out how to debug this.

So if someone here has clues, I'd be happy to look into it – the comment section is just unbearable for me without blocktube.

@artcytracy, since you already mentioned you might look into it maybe you got clues?

GithubAnon0000 commented 2 months ago

It actually just now suddenly works again... What is going on? I didn't change anything.

artcytracy commented 2 months ago

It actually just now suddenly works again... What is going on? I didn't change anything.

What specifically is working again for you?

The comment blocking and filtering is still broken for me. This includes the menu options for blocking comments and users within the comments section which are typically in the same menu as "Report". image As an atheist I find religious content offensive. So this is the sort of content I have in my filters which are also not working.

The video and channel blocking are still working fine on my end.

I was about to pull down the code and have a look at it this evening.

GithubAnon0000 commented 2 months ago

What specifically is working again for you?

Well, all comment content rules worked again. I was offline for a few hours now, opened youtube again and the blocking doesn't work anymore... In #394 I mentioned that it is random for me. But now most of the time it doesn't work at all, so I thought it was permanent.

I did try to see if I could reset the password (see #398) and moved blocktubes files out of the profile directory. And I set a password in blocktube. But I fail to see how this could've made blocktube working again. I'll experiment though.

EDIT: I couldn't reproduce it with what I did before. To me it really seems to be working (or not working) randomly. I also never use context menu blocking. I open blocktube directly and add the rule there. If you've got any idea on how to possibly debug this, feel free to post it here.

artcytracy commented 2 months ago

I cloned the repo and tried to get setup on my desktop this evening but getting the project configured with Ubuntu to do a local build is proving quite complicated. I will try it on my work macbook tomorrow. I also know a little JS and did have a quick look at the code but nothing obvious yet.

I'm seeing ytd-comment-view-model in YouTube page inspection but not in BlockTube code.

@SavannahJohnston I looked at the recent commits for De-Troll-YouTube and he added the aforementioned syntax so thanks for that tip.

It's possible we may need to append usage of ytd-comment-renderer to include ytd-comment-view-model as jscher2000 did here. Just a bit of a wild guess though.

kuroman96 commented 2 months ago

I'm not a developer at all and I know nothing about coding. I came here to look if someone had some clues to fix the issue. Maybe someone who knows amitbl could get in contact with them and ask about this. Unfortunately, I can't do anything to help at my level. I can only realize how very useful blocktube was and how much I miss the comment blocking option.

GithubAnon0000 commented 2 months ago

I'm seeing ytd-comment-view-model in YouTube page inspection but not in BlockTube code.

@SavannahJohnston I looked at the recent commits for De-Troll-YouTube and he added the aforementioned syntax so thanks for that tip.

It's possible we may need to append usage of ytd-comment-renderer to include ytd-comment-view-model as jscher2000 did here. Just a bit of a wild guess though.

I tried to get it to work but I couldn't. I wish JS was more like C Programming... One thing is certain though. ytd-comment-renderer is referenced in inject.js (line 1577) so I guess that's the file we would need to change. Adding else if ('YTD-COMMENT-RENDERER' === parentDom.tagName || 'YTD-COMMENT-VIEW-MODEL' === parentDom.tagName) { as an example doesn't work though.

For everyone that might want to try it: it's fairly easy to use debian stable, download the dependencies and then try out the changes (since @artcytracy said that it doesn't work well with ubuntu).

I'm very interessted to see the commit and check out what exactly had to be changed to make it work again. If there are additional tipps here, I might try my luck again but I'll leave it be for now.

artcytracy commented 2 months ago

For everyone that might want to try it: it's fairly easy to use debian stable, download the dependencies and then try out the changes (since @artcytracy said that it doesn't work well with ubuntu).

To clarify, I was trying to setup Windows Subsystem for Linux but that requires me to enable visualization for Hyper V which involves going into my BIOS settings and even then might fail because of my non pro version of Windows. I didn't want to go down that rabbit hole yet.

I just did a build and unpacked the extension on my macbook and it was a lot easier than I thought it would be. I will play around with it this evening but I'm not very hopeful. I'm not a very bright crayon.

GithubAnon0000 commented 2 months ago

Just as a side note: I wonder if youtube is trying out new interfaces that look identical but aren't on a code basis. Because currently all comment content filters work perfectly fine.

Either that, or they suddenly started to work after I left my browser on for a few hours (but why would that be the case?).

If this was C I'd just run a debugger and know why it works only sometimes and not always. Of course there is the dev tools page and the console, but it's not useful to solve this problem (to me, at least). If we figure out the root cause of this, then we'll be able to solve it much more efficiently – including in the future, if new problems arise.

artcytracy commented 2 months ago

Just as a side note: I wonder if youtube is trying out new interfaces that look identical but aren't on a code basis. Because currently all comment content filters work perfectly fine.

If they were testing new interfaces they would likely not make it live until they've thoroughly tested it in a dev environment.

However, a few weeks ago something changed where my entire comments section was swapped with the video thumbnails that are usually in the right column. It remained that way until a week or two later and suddenly reverted back to the typical display.

I've had a look at the console but I don't see any relevant errors. I also inspected the page elements. I learned I can manipulate the comment text which is kind of cool. But this isn't helping me understand the logic in inject.js. I think the filter logic is working but is likely not being applied to the correct element anymore.

I've also recently cleared caches and cookies in YouTube which resolved another issue I was having with it flagging content as unavailable in YouTube's restricted mode, which I do not even have enabled. That doesn't have any effect on content blocking though.

What OS and browser are you using?

GithubAnon0000 commented 2 months ago

However, a few weeks ago something changed where my entire comments section was swapped with the video thumbnails that are usually in the right column. It remained that way until a week or two later and suddenly reverted back to the typical display.

I still have the normal view. However, every once in a while I also get this layout. But then I just close my browser and open youtube again and the interface is normal again. My browser is configured to always delete browsing data, cookies etc. when I close it – maybe that's relevant here.

I've had a look at the console but I don't see any relevant errors. I also inspected the page elements. I learned I can manipulate the comment text which is kind of cool. But this isn't helping me understand the logic in inject.js. I think the filter logic is working but is likely not being applied to the correct element anymore.

Indeed. However, I did compare the html layouts of youtube for a) blocktubes comment blocking doesn't work and b) blocktubes comment blocking does work. I couldn't see any noticeable differences and YTD-COMMENT-VIEW-MODEL was present in both too.

What OS and browser are you using?

I am using Debian GNU/Linux (oldstable) with LibreWolf 124.0.1-1 (a firefox fork).

PS: Thanks for looking into it @artcytracy . It's nice to have a real developer look into it too, even though it's not your field of expertise.

idomori commented 2 months ago

Comment block never occasionally worked for me. It's just broken for good

Diana-Mundanna commented 1 month ago

Yeah it doesn't work for me either. I miss being able to read comments sections without them being clogged with unfunny memes and teenagers who say "bro" every other word.

misspent commented 1 month ago

You can do this with uBlock Origin filters. Add this to your my filters page and tweak or add words to your liking:

! Applies to main comments | (Add "\" before the "'" to make it apply: I\’m subbed)
youtube.com##ytd-page-manager ytd-watch-flexy #primary.ytd-watch-flexy ytd-comment-thread-renderer:has-text(/I\'m subbing | I\’m subbed/i)
! Only applies to replies of comments
youtube.com##ytd-page-manager ytd-watch-flexy #primary.ytd-watch-flexy ytd-comment-thread-renderer #expander-contents ytd-comment-view-model:has-text(/Here is new fu | Here is the fu | This is the clip | Finally it’s here | Finally Here is the fu | Telegram | Teleegram | my content is better | I forgot to close the camera | LETS BE HONEST WE ALL REMEMBER | ТАР 0N MY РIC | I upload funny | read my name | Read My Profile | you will see it | Claim your prize | Link to the clip | MY CONTENT IS SO | Look at my banner | Lucky prize winners | IM SUBBING EVERYONE | DONT READ MY PROFILE | JJ said my music was fire on my page | translate | My content is | are better than | I WANT TO BE THE MOST | parents said if I hit /i)
artcytracy commented 1 month ago

You can do this with uBlock Origin filters. Add this to your my filters page and tweak or add words to your liking:

I was not able to get uBlock Origin to work for me. Instead I am using the Unhook extension to block the entire comments section for now. It's also nice for blocking other features of YouTube I don't like.

misspent commented 1 month ago

I was not able to get uBlock Origin to work for me. Instead I am using the Unhook extension to block the entire comments section for now. It's also nice for blocking other features of YouTube I don't like.

That's a surprise. uBlock Origin has always worked for me and most others I talk to. It's a shame we can't filter comments out in some user settings YouTube offers us, but we all know that'll never be a feature. It's scary what's possible with uBlock Origin. You can remove or block nearly everything with it if you know what you're looking for, and I do hope a lot of the issues Blocktube has will be fixed as it's a massive QoL extension when it works.

idomori commented 2 weeks ago

There are other extensions I found on Chrome store that were able to block comments through context menu with no problem. It doesn't seem to be a Youtube API issue. I hope this gets fixed because I don't want to manually migrate a large rule list to a different extension as I have been using Blocktube for a very long time.

GithubAnon0000 commented 1 week ago

As a heads up: I found a youtube comment filter addon for firefox written in typescript (Yay Filter). Comment filter for individual words works for me with that extension, although regex doesn't. Maybe it could be helpful in solving the problem with blocktube...

garry-ut99 commented 1 week ago

I found these two:

But I didn't check them yet.

GithubAnon0000 commented 6 days ago

I continued to look at the code and couldn't really solve it (yet?). However, some of the following thoughts / results might help someone here. First of all: All references to code refer to inject.js.

I first tried to find out why not even the context menu is showing on the desktop version. Valid context menus are stored in const contextMenuObjects. Looking at it, there is a videoPrimaryInfoRenderer which inserts a context menu here:

Pictures

![screen1](https://github.com/amitbl/blocktube/assets/160563432/07168811-9d85-4e4f-84f3-9f4b21647b90) ![screen2](https://github.com/amitbl/blocktube/assets/160563432/4a629c15-cf29-4b60-b83c-77d7112f5497)

compactVideoRenderer on the other hand refers to this:

Pictures

![screen3](https://github.com/amitbl/blocktube/assets/160563432/6683d560-d230-4d7a-9650-0b45ef2e7ed1) ![screen4](https://github.com/amitbl/blocktube/assets/160563432/41d18e4d-298f-4214-8d8c-d090b75f94aa)

commentRenderer cannot be found on the desktop version, but is present in the mobile version. I forced loading the mobile version on firefox desktop with "responsive design mode" in dev tools and the URL https://m.youtube.com/?persist_app=1&app=m. Mobile view:

Pictures

![screen5](https://github.com/amitbl/blocktube/assets/160563432/9204d70c-f121-46f4-a0c1-e90a06bc2383) ![screen6](https://github.com/amitbl/blocktube/assets/160563432/4aab1168-f90c-432f-b388-52893f960792)

The comments on desktop are not inside commentRenderer, but inside itemSectionRenderer, commentThreadRenderer, commentViewModel. Adding them to const contextMenuObjects and other related places didn't solve the issue though.

Forcing mobile view makes blocktube work again 100% (but mobile sites on desktop monitors isn't great...)

Maybe the only problem is that commentRenderer doesn't exist on the desktop site. In that case it wouldn't be too difficult to solve, if one knows what they're doing (which I don't). If someone has some ideas, please comment them here. It might help.

(btw, the channel had been chosen only because there are likely lots of comments containing identical strings → testing purposes)

CJ-Abrams commented 5 days ago

@GithubAnon0000 Thank you for the info on the mobile UI version. It allows to better understand how the extension gathers the comment data to first display the comment action-menù popup and then to actually block the comment-author by its channel ID.

After some testing in debug-mode (applying a patch to the inject.js script to be able to at least detect each comment DOM-object in desktop UI mode) it appears that the actual comment-data intercepted and analyzed, before the the comment section is actually rendered on screen, is packed into a DOM-object named "commentViewModel" (ytd-comment-view-model in the HTML node-tree) when youtube is in desktop-UI-mode, and "commentRenderer" (ytm-comment-renderer) when youtube is in mobile-UI-mode:

Now, currently there is no clear solution for the action-menù modification (in desktop-mode): even forcing the extension to create for each comment-object an action-menù object with the expected structure and injecting in it the "Block Comment" button, when the page is rendered that modification is automatically reverted. This step should be postponed to a later point in the page processing when said modification cannot be reverted anymore.

About the comment-author channel-ID, there are instead 2 possible solution:

Also It has been pointed out in other websites that currently both the youtube API and the youtube page layout in desktop mode is still worked on so it is also possible the author is waiting youtube to reach a more stable state before updating the extension.