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

Context menu blocking does not work anymore #493

Closed
keldrin2 opened this issue Nov 29, 2024 · 12 comments
Closed

Context menu blocking does not work anymore #493

keldrin2 opened this issue Nov 29, 2024 · 12 comments

Comments

@keldrin2
Copy link

as title suggests, context menu blocking is broken once again.

@keldrin2
Copy link
Author

There seem to be a lot of open issues on the same thing right now. Not a single one describes the problem correctly. Namely 490 491 489 484 and maybe some others.

@luxidoptera
Copy link

Mhm, corroborating. BlockTube itself still works fine, but context menu blocking is broken.

@sclient
Copy link

sclient commented Nov 30, 2024

Yup, just installed the extension today. Tried to block all kinds of videos, all of them continue to show up.

@keldrin2
Copy link
Author

keldrin2 commented Dec 1, 2024

at the moment you have to edit the block list manually.

@sclient
Copy link

sclient commented Dec 2, 2024

That is more annoying than seeing some videos repeatedly, so.... Oh well. Guess Ill just wait for an update, surely it wont be too long.

@keldrin2
Copy link
Author

keldrin2 commented Dec 2, 2024

It is.

If it helps you, I made a little python script to get the channel ID from a channel link.

import requests
import sys
from bs4 import BeautifulSoup as bs

def main():
    if len(sys.argv) == 2:
        response = requests.get(sys.argv[1])
        if response.status_code == 200:
            soup = bs(response.content, "lxml")
            for link in soup.find_all("link"):
                if link.get("href") and link.get("href").find("channel_id=") > 0:
                    print(link["href"].split("=")[1])
                    exit(0)
    else:
        print(f"Usage: {sys.argv[0]} URL")


if __name__ == "__main__":
    main()

@RubenKelevra
Copy link

Blocking itself works fine, just the addition of new channels with their channel-ids does not.

You can still add the "title" of the channel under channel names and they will be blocked.

The converter site in the readme also will just throw 400 codes as response:

https://vabs.github.io/youtube-channel-name-converter/

@josephcrowell
Copy link

YouTube changed the dom structure again and the event sink variable can't be populated again.

@zaXsa
Copy link

zaXsa commented Dec 4, 2024

I think the issue is the same as with 0.4.4:
Adding new eventSink location should work @amitbl

if (!eventSink) {
   eventSink = getObjectByPath(this.parentElement.parentElement, 'polymerController.forwarder_.eventSink');
}

found it using

    for (const [key1, value1] of Object.entries(this.parentElement.parentElement)) {
        if (value1 !== null && typeof(value1) === 'object') {
          for (const [key2, value2] of Object.entries(value1)) {
            if (value2 !== null && typeof(value2) === 'object') {
              for (const [key3, value3] of Object.entries(value2)) {       
                if (key3.includes('eventSink')) {
                  console.log('Found: ' + `${key1}:${key2}:${key3}`);
                }
              }
            }
    
            if (key2.includes('eventSink')) {
              console.log('Found: ' + `${key1}:${key2}`);
            }
          }
        }

        if (key1.includes('eventSink')) {
          console.log('Found: ' + `${key1}`);
        }
      }

Note as you can see looking at my code i usually don't work with javascript or any webdev but this seems to work.

Edit: fixed code blocks

@keldrin2
Copy link
Author

fixed in v0.4.5

@RubenKelevra
Copy link

Thanks @keldrin2!

@keldrin2
Copy link
Author

Thanks @keldrin2!

Wasn't me who fixed it. I just noticed it's fixed in the newest release and closed my bug report.

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

7 participants
@sclient @RubenKelevra @josephcrowell @luxidoptera @zaXsa @keldrin2 and others