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

Youtube TV (Leanback) ads not blocked #3462

Closed
k2helix opened this issue Sep 25, 2023 · 13 comments · Fixed by #3501
Closed

Youtube TV (Leanback) ads not blocked #3462

k2helix opened this issue Sep 25, 2023 · 13 comments · Fixed by #3501

Comments

@k2helix
Copy link

k2helix commented Sep 25, 2023

As the title says, I'm trying to block https://youtube.com/tv (using a PS4 or smart TV user agent) following the README example but ads still show up in any video or even when browsing. This does not happen in youtube default website so I don't know how to proceed and am looking for some advice. Thanks in advance.

@remusao
Copy link
Collaborator

remusao commented Sep 26, 2023

Hey @k2helix,

Thanks for reaching out! Could you provide more details on how to reproduce the issue? Ideally with a minimum repro script which I can run to investigate. Are you using Puppeteer, Electron, Playwright or browser blocker?

@k2helix
Copy link
Author

k2helix commented Sep 26, 2023

Hi, thanks for your response. You can see a whole electron app using it here: https://github.com/k2helix/YouTubeTV/blob/main/renderers/main/main.renderer.ts#L67 (its my fork of an app into which I tried to add adblock). Hope this is what you were asking for. Thanks again!

@remusao
Copy link
Collaborator

remusao commented Oct 6, 2023

Hi @k2helix,

There was a recent update in resources used by the adblocker to block ads on YouTube. Would you be able to check again if this brought an improvement on your end?

@k2helix
Copy link
Author

k2helix commented Oct 6, 2023

Hi, I did it when it was released some days ago and also tried injecting the blocker earlier in the code but nothing worked. Note that sometimes (like 1 out of 5 times) when opening the app video ads don't get shown but they usually do so I try reopening it a few more times until I give up.

@remusao
Copy link
Collaborator

remusao commented Oct 6, 2023

I did see some exception when trying it out locally, maybe some issue with latest resources. Cc @chrmod

image

@k2helix
Copy link
Author

k2helix commented Oct 6, 2023

I see. Please let me know if there is anything I can do or you need me to do

@JellyBrick
Copy link

JellyBrick commented Oct 7, 2023

I did see some exception when trying it out locally, maybe some issue with latest resources. Cc @chrmod

image

Additional information: Running YouTube Music with the @cliqz/adblocker enabled causes this error and disables the preload script.

image

th-ch/youtube-music#1267

JellyBrick added a commit to th-ch/youtube-music that referenced this issue Oct 7, 2023
It failed because of @cliqz/adblocker-electron.
Check see this issue: ghostery/adblocker#3462
@remusao
Copy link
Collaborator

remusao commented Oct 8, 2023

@JellyBrick @k2helix We've got a fix prepared here and locally I could get YouTube working again in Electron: #3501

@k2helix
Copy link
Author

k2helix commented Oct 9, 2023

Hi again and thanks for working on a fix! I've been trying it on the project I mentioned above and it blocks ads. However, it seems that when playing a video, there's a black screen for ~20 secs which I think that means Youtube thinks it's showing ads.
Basically it's blocking ads but the video is not played until the time for the ads that were assigned ends (or that's what I believe).

Here's a video where you can see its behaviour:
https://github.com/ghostery/adblocker/assets/49949593/a7b1415d-1865-4b5e-a1a9-91aca96a5f8e

@remusao
Copy link
Collaborator

remusao commented Oct 14, 2023

@k2helix It seems like YouTube is pushing changes recently to circumvent blocking. I've checked with the latest assets just now and I cannot reproduce the issue anymore. Is it still happening to you?

@k2helix
Copy link
Author

k2helix commented Oct 15, 2023

@remusao It seems to be working fine now. Ironical that Youtube makes changes to avoid blockers in the main website and it makes blockers work in the TV site. Thanks for your help!

@k2helix
Copy link
Author

k2helix commented Oct 15, 2023

I have been using it for a bit and now when I opened the app and played a video the same thing (a black screen) happened.

@remusao
Copy link
Collaborator

remusao commented Oct 15, 2023

Things are moving quickly and rules are updated every day. I've just merged the latest update. Hopefully that improves things but I think we should expect more instability with youtube.com in the coming days unfortunately.

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

Successfully merging a pull request may close this issue.

3 participants