x0a / uBO-YouTube

Easier way to exempt your favorite YouTube channels from adblocking.
GNU General Public License v3.0
124 stars 8 forks source link

Ads just skip to the last second on subscribed channels #35

Closed lazzerss closed 3 years ago

azalty commented 3 years ago

I don't have this problem, maybe you could give more infos?

Are you sure you didn't blacklist some advertisers?

lazzerss commented 3 years ago

I haven't blacklisted anyone, and the only setting turned on right now is the "Whitelist subscribed channels by default"

x0a commented 3 years ago

Thank you for the report.

This one might be difficult to fix because of the fact that the subscribe status isn't usually available when ads begin to play.

I'll see if I can make some changes to behavior depending on whether this setting is enabled.

x0a commented 3 years ago

Hey @suhax-ux and @azalty,

While testing potential fixes with Postman, I've realized I'll have to write my own Postman-like javascript utility with cloning/editing capabilities in order to fix this issue (and deal with other issues).

For context, part of the reason this extension generally works is because YouTube has very graciously exposed important metadata in the DOM. For an example, go to the YouTube home page and enter this in the console (press F12) document.querySelector('ytd-rich-grid-media').data. Unfortunately YouTube does not expose the subscribe status in this metadata. Also I've realized that we shouldn't really depend on this behavior because A) it's very uncommon and B) YouTube could change it at any time. Also, while YouTube has a public API, it's expensive to use (especially for a free project like this). So fix this, other issues, and to prevent future problems I'll have to start cloning some YouTube capability in the extension, like simulating clicking on related/homepage videos and loading the corresponding metadata, making changes before the user clicks the actual link.

YT intentionally makes this difficult because they want people to use their public API (and they're not exactly fond of this idea of selectively blocking ads) so it will be difficult. Could potentially take a month or so.

I'll try to half-ass a solution during that time that I'll push if I can't accomplish this goal.

In the meantime, I'll fix the Import Subscriptions feature so you can import most of your subscriptions at once.

Thanks again for the report and your patience

azalty commented 3 years ago

No problem! I don't use this feature, so that's why I wasn't experiencing any problem. I thought it was about something else.

Good luck with that ❤️

And yea, it sucks. Sometimes, your only solution is to do hacky fixes and techniques that aren't stable and probably won't last :-/ - I understand your pain

lazzerss commented 3 years ago

Thank you! This extension is really awesome!

I hope it works, but importing my subscriptions would be fine aswell

x0a commented 3 years ago

Thank you for your patience! Just wrapped up a major re-write of the back-end code and have added some functionality to address this issue. This extension now locally caches a list of subscribed channels. The list is loaded when you first visit the YouTube home page and is updated as you subscribed/unsubscribe to channels, or change users. It is then saved and available upon restarting the browser.

That way the subscribe status can be applied as soon as channel ID data is available, for related videos, video suggestions, home page videos, etc.

It works fairly well in my testing but I'm leaving this issue open for a good time until you've had a chance to properly test it.


Chrome update instructions

  1. Open the Settings menu by clicking at the top right
  2. Under More Tools click on Extensions
  3. Click on the Update button.

Firefox update instructions

  1. Open the Settings menu by clicking at the top right.
  2. Click on Addons
  3. Open the Addons management menu by clicking the gear
  4. Click on Check for updates. This should update all extensions.