YouTube Ad Punisher – Auto-reloads YouTube pages when an ad plays (github.com)

76 points by iantongeorge 2 hours ago

noitpmeder 2 hours ago

Is this actually an issue? Using uBlock Origin on firefox I don't think I have seen a youtube-forced ad in YEARS. And then adding in the SponsorBlock extension gets me around anything embedded into the video itself.

SponsorBlock is actually awesome, and for those that like to see internet numbers go up, it tells you how much your own submissions have saved other users over the years (the 11 snippets I've added have helped others skip 20d of ads).

cagey an hour ago

I run exactly same Firefox w/uBlock Origin and SponsorBlock on Linux, and aside from reliably getting "Experiencing Interruptions?" popups (which I assume are caused by the extensions doing their good work) I too have been watching YT ad-free for years.

Also a shout-out to the "Backstage Play" Firefox extension (on Android) which lets me listen to YT-sourced audio without the YT-playing Firefox tab having focus.

dns_snek an hour ago

Yes, in a sense. Youtube seems to do a lot of A/B testing over very long time frames so your experience could be completely different than other people's. I've never had an ad get past the ad blocker but I've had a lot of fake-buffering and videos refusing to play that makes the site unusable over the past 1-2 years.

I remember people telling me about this for months and I had no idea what they were talking about until one day they targeted my account as well.

ghusto 23 minutes ago

Fake buffering and videos not loading is fixed by reloading the page (sometimes twice). First thing I do when I click on a video is reload the page.

I've not seen an ad since, well, ever, actually.

wilkystyle 21 minutes ago

Jumping on this to add an additional warning: Just because an extension starts out safe does not mean it will always remain that way. This has been mentioned numerous times before on hacker news, but maintainers of any mildly to moderately popular browser extension are routinely offered tantalizingly high sums of money to either sell the extension to a less scrupulous third-party or to add data collection code for said third-party.

You are never 100% safe, but dramatically limiting the scope of what you trust is a great step in the right direction. I use two and only two browser extensions (uBlock Origin and Bitwarden) everywhere I go, and I have zero issues with ads on YouTube (or anywhere else, really).

Edit: I should also clarify that I am not speaking negative of this particular extension at all, nor the work that has gone into it.

Gander5739 13 minutes ago

Probably a pipe dream, but I have a faint hope ladybird will come up with some saner security model for extensions.

Waraqa 2 hours ago

I don't know about Firefox. But I'm using a Chromebook (which includes only one browser) and YouTube doesn't work if I use any ad-blocker.

xandrius 30 minutes ago

ryukafalz 2 hours ago

Google removed support for Manifest v2 extensions from Chrome a little while back, which were much more useful for content blocking. Ad blockers on Chrome aren't as capable as those on Firefox these days.

Balinares 2 hours ago

ranger_danger 19 minutes ago

noitpmeder 2 hours ago

noitpmeder 2 hours ago

That actually sucks. Is something like that enough to get you off chromebooks next time you need to make a purchase? (it would be for me)

drcongo an hour ago

darepublic 2 hours ago

for me (macbook not chromebook) ublock origin lite does work. Every once in a while youtube will deploy something or I will fall into some bucket that receives anti-adblock messaging. I usually switch browsers or just abstain from youtube for a while and before long youtube with adblock works again

solyin 2 hours ago

Enable Linux mode and install Firefox.

blooalien 30 minutes ago

miladyincontrol 2 hours ago

Similar, although I mostly watch on Freetube on desktop. SponsorBlock's sibling extension DeArrow is also critical imo, declickbaiting the platform really does wonders for usability.

pessimizer 2 hours ago

> Is this actually an issue? It works for me!

uBlock Origin + SponsorBlock on Firefox on Linux here, and since 6 months ago Youtube videos all stopped playing within the first minute with an error. In order to watch them, I have to yt-dlp. That being said, I also refuse cookies, spoof my UA and shuffle my reported available fonts, amongst other things.

It is of course an ongoing issue, and a lot of effort is expended for uBlock Origin to keep up. And something mysterious about my configuration has caused all of those efforts to completely fail. More people trying, the more configurations get covered.

goodmythical an hour ago

The extra you're doing on top of uBlock/sBlock must be responsible for youtube.com not loading videos given that mayn use firefox/ub/sb/linux (such as myself and others in the comments) with no issues.

You're probably appearing as a bot, and the web front-end does a lot to prevent loading that yt-dlp works to strip/skip.

If I don't want to use the web frontend, I've been using Cathode [0] which has a lot of features that make the yt-dlp experience better like actually browsing videos, keeping a playlist, etc.

[0] https://github.com/andunieee/cathode

ssl-3 an hour ago

Works very well for me with uBlock Origin with Firefox on Linux (and Android too, for that matter). I use it all the time.

But I don't run SponsorBlock anymore (I felt compelled to spend more time rating, adding, and correcting segments than manually skipping sponsor segments), or refuse cookies, or spoof my UA, or shuffle my available reported fonts.

(I mean: Youtube already knows very well who I am. I'm logged in there with my paid-for Google Workspace account.)

ragall 44 minutes ago

jonathanstrange 2 hours ago

I get the occasional "Experiencing Interruptions" bullshit and intentionally degraded performance, but I take that as an incentive to watch less youtube and do something better instead. It's still a win. But for the people who are annoyed by that, other ways of skipping ads are always welcome.

OptionOfT 2 hours ago

> Experiencing Interruptions

Software engineering is the only place where money is spent to make things worse for your customers only to then sell them a way to disable the thing.

Oranguru an hour ago

sublinear 2 hours ago

Grombobulous 21 minutes ago

The amount of effort people will go to avoid paying for content they spend hours watching is fascinating.

YouTube is the #1 streaming video service in the world. Bigger than Disney, bigger than HBO, bigger than Netflix. I say this not to point out that Google needs your money as obviously they don’t, but I say this to point out that it’s a treasure trove of content.

YouTube Premium is absolutely worth the asking price. They’ve also got student plans and a new lite plan for cheaper.

Is $9 a month really too much if you really watch YouTube enough for ads to bother you?

aniviacat 17 minutes ago

I would pay for YouTube Premium if Google let me create an account without providing (and verifying) a phone number.

For me, it is not the money that is the issue. The issue is that Google abuses the account for user-hostile behavior, like tracking.

hbarka 17 minutes ago

Desire for mental experience is human but purchasing power isn’t the same all over the world, my friend.

baoooooooooooo 6 minutes ago

I was paying like $16 for it somehow (and it still felt very much worth it) and then discovered it is included in the Gemini pro plan, so now I feel like Gemini pro only cost me $4

lucaslazarus 18 minutes ago

Yes. Yes, it is.

_ZeD_ 7 minutes ago

> The amount of effort people will go to avoid paying for content they spend hours watching is fascinating.

the amount of effort services will make stuff that were free a payment premium is fascinating.

They are removing private property, and offer back "services" where I own nothing.

Yes. My goal is to fucking suck everything from free from these big corp.

> YouTube Premium is absolutely worth the asking price. They’ve also got student plans and a new lite plan for cheaper.

No, it's not. They are taking my money for giving me nothing substantial. I don't own nothing they will give me for my money.

> Is $9 a month really too much if you really watch YouTube enough for ads to bother you?

yes it is. they should PAY ME to see ads.

tossandthrow 4 minutes ago

Yes, 9 usd a month is too much.

You pay Google for distribution, not content - even though they are making it murky.

I am not paying 9 usd to watch someone injecting sponsered segments.

Inalready payed by watching these.

Ad blockers are IMHO not just moraly acceptable, but we have a moral imperative to use them, to shield against dangerous influences and to take a stance against the marketing industry.

Waterluvian 4 minutes ago

I paid for cable and they added ads anyways. I paid for Prime Video and they added ads anyways. I want to support the creators but they want to control the terms and take an oversized cut of the revenue. And they'll squeeze those who obediently line up to be squozen anyways. You'll pay and they'll eventually introduce ads anyways. I choose to support the creators directly.

You do you, but I'm not a fool.

choppaface 12 minutes ago

Youtube keeps showing me “health” related ads that are straight up offensive. I’ve reported them and blocked them but those functions of Google conveniently are buggy and so the ads keep coming. I’m never going to give money to a bully that pays SWEs millions of dollars to ignore my safety because they’re too busy playing code golf with jax.

mschuster91 16 minutes ago

You’ll not get ad free though. Many creators do at least a 60s sponsorship deal shilling all kinds of crap. Some do 2x120 on 15min of video.

eddyg 12 minutes ago

That’s where SponsorBlock comes in.

https://web.sponsor.ajay.app/

haolez 15 minutes ago

Premium has some AI magic that lets you skip those inline ads as well. Pretty awesome :)

bigyabai 11 minutes ago

pocksuppet 11 minutes ago

michaelt 10 minutes ago

Sponsor block extension, or follow better creators.

hurfdurf 12 minutes ago

Don't watch those videos? Not Youtube's problem.

SecretDreams 8 minutes ago

> YouTube Premium is absolutely worth the asking price. They’ve also got student plans and a new lite plan for cheaper.

I pay for it. I think it's overpriced a bit compared to conventional streaming services and I think the gradient in content qualify is wide, with a lot of poor or unrelated content. I am paying for a catalogue of crap when I want a subset of diamonds. You might say this about Netflix too, but YouTube is this on steroids and costs more.

I think content creators are overpaid by YouTube, largely so they don't migrate to another content platform, and the premium payers existing to subsidize this monopolistic business practice. YouTube with ads is not useable for me, so I'm stuck paying. But it's not a good price, just no alternatives.

Give me free market YT content, and there's no way the YT premium price stays this high.

jonplackett an hour ago

I’m all for ad blockers in most places but I have completely caved in on YouTube.

My reasons are

1. YouTube seems to pay creators reasonably

2. Being able to use the YT app without the crippling of things like background playback and downloads is very useful.

3. YouTube seems get YouTube music free, so cancelled Spotify with more or less paid for it.

I know I’ve given in. And I accept it

franczesko 32 minutes ago

Alphabet also extensively does tax avoidance, censor and demonetize content, make the platform genuinely worse (dislikes removal). They additionally take blood money from governments to run their propaganda. Call me naive, but I'll never pay them a dime. Creators can be supported directly.

unrented7977 20 minutes ago

They also spy on you and sell that information for a nontrivial profit. I don't see any compelling reason to give google direct money for any purposes when they already make money from me.

pocksuppet 9 minutes ago

Seems like the best way you can coerce compliance would be to pay, then wait until they enshittify more, then stop paying. Isn't it?

xandrius 28 minutes ago

1. Reasonably? Really? Even the bigger ones are presenting how little they make vs the time it takes. Plus being pushed/forced to make shorts when they make great long form content.

2. You can use Revanced and get all those.

3. Same for YT Music, you can use revanced on android

Plus Google is evil and ruins everything it touches.

bemtevi 23 minutes ago

> 1. Reasonably? Really? Even the bigger ones are presenting how little they make vs the time it takes. Plus being pushed/forced to make shorts when they make great long form content.

YouTuber here. It's of course arguable that they don't pay well, but it's not bad. I'm not a big YouTuber either and under 10K subscribers. But I make enough per month to pay some bills and buy some food. I'm not rich at all, rather poor in fact, and without my YouTube income my money situation would be much tighter.

Alifatisk 2 hours ago

> YouTube serves an ad roughly every 60 seconds. You can't watch one minute of content without being interrupted by a commercial.

If this is true, then that's insane. I am unaware of this because I use uBlock Origin + Sponsorblock on Zen (FireFox).

JoshTriplett 2 hours ago

It depends heavily on what video you are watching. The channel can set how densely they want to advertise.

rzzzt 17 minutes ago

Someone spoke about this in a video I've seen. YT distributes ad breaks somewhat evenly along the entire piece, taking brief pauses into account, so the speaker will not be interrupted mid-sentence. The author is free to move the locations around the timeline within reasonable limits. It's possible, but a bit tedious to create an ad-free video on the producer side because you have to remove the spots one-by-one manually, and if you don't do anything about it, viewers will get the "default distribution" ad experience.

goodmythical an hour ago

I don't know if it's exactly true, but I've got a roomate that rawdogs youtube all day and I can't survive without earphones because I firmly believe that the total runtime of ads they sit their and watch is longer than the runtime of any of the content they watch.

There are often minutes long ads, the video "fails" to load, followed by another minute ad, and then the video, and if the video is long enough it may even have ad breaks within it.

The same is true for my other roomate's facebook browsing, but there at least you could simply scroll past, except this roommate likes to click on the ads "because I want to see what the solution to problem X they're offering" and is then upset when the ad ends with "visit our site to learn more" without actually explaining/demoing the product" to the point where they ask me how come none of the ads ever have the actual product in it and I just sigh and explain that if they can get you to watch a five minute ad they can be relatively more certain of you clicking through to the site and purchasing for the nth time.

I sometimes wonder how it is that ad companies believe they can get away with their bullshit, but then I remember that they are targetting the average user and the average user is...average...at best.

rightbyte 21 minutes ago

Some people are targeted with way more ads. Google measure conversion rate and target easy prey more I think ...

xpct 2 hours ago

Shouldn't be, sounds like a misrepresented statistic. Maybe it counts the full ad length, which nobody watches to the end?

jstanley 2 hours ago

You have to remember there are probably hundreds of people watching YouTube at any one time, so one ad every 60 seconds works out to less than one ad per hour per viewer.

demibabs 2 hours ago

…hundreds?

ielillo 2 hours ago

I tolerate ads as long they are quiet and consistent in their timing. I hate ads that blast through my headphones and getting an ad every time I skip portions of the video or rewind to the beginning, specially when you switch between videos and they front load you one. If youtube would put an ad consistently every x amount of time no matter if you jump through the video or open a new one, I would be happy.

ciefa 2 hours ago

> YouTube serves an ad roughly every 60 seconds.

wat??

Also, why not use uBlock origin on browsers? And on mobile, just use Morphe?

ragall 39 minutes ago

On Android, the best is Firefox with uBlock Origin, but Vivaldi and Brave (both Chromium derivatives) have built-in adblockers that work reasonably well. You also need a good DNS ad- and malware- blocker.

ssl-3 2 hours ago

Even better: Firefox with uBlock Origin on the desktop, and also Firefox with uBlock Origin on Android just the same.

(For IOS: Download/buy AdGuard from wherever you guys are allowed to get your manufacturer-approved gardening supplies and just use Safari, since it's Safari all the way down anyway.)

noahjk an hour ago

wBlock has worked great for me on iOS/Mac and I personally also combine it with Stop The Madness but it doesn't need combining to work.

xdennis 2 hours ago

I also recommend Firefox on Android with uBlock, but on the rare occasions when you need to use another browser you should probably set up a PiHole DNS server and add it to your router.

worble 32 minutes ago

ssl-3 2 hours ago

aweiher an hour ago

uBlock on mobile is the killer application - it feels like cheating, but it's just normal web usage.

Google just got greedy.

darepublic 2 hours ago

its strange because I love yt. but do I really love yt or just a thin slice of the content on there. looking at what my kids see, its a rank swamp full of toxic messaging and grooming for future gambling addictions / other neuroses. Youtube without your own curated list of channels etc. on the path of least resistance will just shove a whole bunch of objectionable brainrot in front of you

nickcw an hour ago

I got a YouTube family subscription so that my kids (who are all young adults now!) could avoid the brainrot advertisements.

I've ended up watching lots of great stuff on YouTube myself. I tend to watch on the TV where the ad blocking doesn't work so premium is great there.

I then discovered YouTube Music which you get as part of the subscription. I prefer it to Spotify - its a lot more reliable technically and the discovery is better.

So I'd count my self as a happy YouTube premium customer. I also don't have to eff around with stuff like YouTube ad blockers which gives me more free time and less stress ;-)

pocksuppet 8 minutes ago

We should make a website that mirrors yt videos, but isn't yt

o_-_o 26 minutes ago

#1. You need to first configure your Firefox with hardened user.js

#2. Install uBlock0 and check/update ALL lists (don't use just default).

Result: No issues EVER on any website.

munk-a 2 hours ago

There seems to be other good ad-blocking tech available (even on mobile) but more advertising subversion is never a bad thing, especially if it leverages a different tactic.

kidnertom 2 hours ago

The youtube ad-war continues. I refuse to pay for a subscription despite spending so much time on it consistently

jojogeo 2 hours ago

The irony is that I was actually ready to pay for a subscription to YouTube Premium; but then they started with the bullshit of serving less ads on premium rather than no ads.

Google can take a running fucking jump if they think I'm paying for less ads.

zeeveener 2 hours ago

Not sure if this is a new thing or if they're just accounting for In Video Sponsorships in their legalese, but I pay for Premium and I have never been presented with an ad while subscribed.

I know my subscription has lapsed when the tsunami of ads hits. It's remarkably stark in contrast.

Tarball10 2 hours ago

YouTube Premium does not serve any ads. Premium Lite, the cheaper plan, serves ads only on music videos and shorts.

wilg 2 hours ago

Why do you refuse to pay for it?

nomilk 2 hours ago

> Traditional ad blockers get detected by YouTube's anti-adblock system. Skip buttons take 5 seconds to appear. You sit there, hostage.

I use uBlock Origin Lite and haven't seen that waiting screen for over a year (and no YT ads, ever).

martini333 8 minutes ago

uBlock Origin on Edge; I have no ads.

bemtevi 21 minutes ago

I hate ads like everyone else. But I'm just going to put this out there that I'm a YouTuber, fairly poor, and I make enough on YouTube ads to put a little extra food on the table and pay some bills. So for those engineers making six figures and talking about ad blocking, something to think about.

Hey, I don't judge for blocking ads. But if you're going to do it, consider a subscription to YouTube.

I also disable all mid-roll ads and disable ads about gambling, weight loss, and other stuff I consider unethical.

5555watch 2 hours ago

Is there a good solution on Safari? Whatever I've tried personally, needs at least one page refresh. E.g., first load of a video throws an error, and a refresh shows a no-ads video. It's fine, makes me watch less videos, but still would be nice to have a smoother experience.

veloxo an hour ago

wBlock seems to be working well. It has replaced AdGuard and uBlock Origin Lite for me, where I sometimes encountered that issue. https://apps.apple.com/us/app/wblock-ad-blocker-for-safari/i...

nervai 2 hours ago

AdGuard has worked fine for me. No refreshes, never see youtube ads.

amelius an hour ago

Anyone else having problems playing Youtube videos in Firefox on Linux?

I always _have_ to reload, otherwise my videos won't even play.

michaelsalim an hour ago

Oh, i actually have something similar. I find that it doesn't happen on all situations though. I think mostly on new tabs. And if you wait long enough, i think it can play eventually.

tsukurimashou an hour ago

yeah same issue on linux (windows too) firefox + ublock origin, often the video is stuck on the first load and I have to refresh, the video also takes a while to start playing which can be annoying

aweiher an hour ago

I never have this problem on linux (ubuntu something)

But I have a similar problem on mobile: after some time I cant play any video (yt, reddit, whatever, ..). Then I have to kill firefox and restart, then it works again.

JackFener 2 hours ago

> YouTube serves an ad roughly every 60 seconds. You can't watch one minute of content without being interrupted by a commercial.

This is absolutely not true.

This repo does nothing, just refreshes the page and if it fails it redirects you to a YouTube mirror. What's even the point of using it?

andrewl-hn 32 minutes ago

> This is absolutely not true.

The number of ads depends on location and inventory. If I watch YT without a blocker in my area in summer I get about two ads per 10 minutes. But in December? Every local restaurant decides they want people to celebrate Christmas with them so it's 5 ads every 7-8 minutes.

When I'm in a large city I get more ads, too.

iantongeorge 36 minutes ago

Fair on the 60-second line — that was a bad generalisation. Ad density is channel-dependent; I should have said that in the README (fixing it).

The extension is not an ad blocker, it is a punisher: it detects the ad overlay before the skip button appears, grabs your exact playback position, and reloads with the timestamp so YouTube seeks back to your spot. That is the whole trick — you never sit through the ad and you do not lose your place. There is a cooldown so it cannot reload-loop, and a local ad-history popup so you can see what it caught. Nothing leaves your browser.

You are right that on Firefox with uBlock Origin + SponsorBlock you do not need this. I built it for Chrome/MV3 and locked-down browsers (Chromebook, Safari) where the blockers get detected or cannot run. If uBlock works for you, keep using uBlock — this is for the cases where it does not.

dang 25 minutes ago

Your comment here was killed by our software because they've been classified as genai text, which is not allowed on HN itself (see https://news.ycombinator.com/newsguidelines.html#generated and https://news.ycombinator.com/item?id=47340079).

(It's fine, of course, to use AI tools—we use them ourselves. Just please don't use them to generate or edit text to be read by fellow humans on Hacker News.)

It's impossible to know for sure what was LLM generated or edited, but we have to rely on imperfect classifiers or else the site would be completely flooded by genai text, which is not what the community here wants to read, nor in the intended spirit of HN.

morningsam 2 hours ago

The true ad punisher would be an extension that automatically donates a small amount of money to PeerTube, yt-dlp, and Invidious any time YouTube plays an ad. At the end of the month, a message is sent to YouTube support informing them of the amount donated.

ssl-3 2 hours ago

A true ad punisher/YouTube killer would be a unified place where people could go to watch PeerTube-provided videos, with subscriptions, ratings, recommendations, comments, and shared engagement with at least some minor sense of community.

It should be something that at least pretends to believe in itself as a first-tier service instead feeling like a wanky tech demo for a protocol when 95% of people don't care what what "protocol" even means in this context.

And that protocol, itself? It should allow for distributed storage, bandwidth, and compute. If storage and bandwidth and transcode are the greatest cost centers with building a YouTube competitor, as I often hear is the case, then it should be a simple affair for me to give a few terabytes of space, a few gbps of bandwidth, and some otherwise-idle GPU time to the community. Alas, it is not this way.

(Actually, the more I think about it the less I think that PeerTube is a good direction to go at all. The foundation isn't there.)

aweiher an hour ago

I paid for YouTube for some time to support the content creators.

But then they had this genius idea to show random Shorts every time I open the app! So I canceled. Back to the browser and ad-blocker.

Then I found out how to watch YouTube videos on mobile in desktop mode, so I can listen to videos when the screen is locked.

I pay for Nebula now to support the creators. I'm not as shortsighted as YT.

trilogic an hour ago

How about using other platforms, don´t be a beggar!

The best way to punish ads is not using their platform, simple. How they support their platform is not users problem. Ads are hateful, platform who use ads are primitive.

aozame 9 minutes ago

WAIT, what do you mean YouTube has ads??? How does that even work? Do they play before the video or something? Guess I'm just too used to using Firefox.

iekeb 2 hours ago

YouTube is so tremendously slow that I think I'd rather wait until the ad ends than wait until the page reloads.

solarpunk_enthu 2 hours ago

I am using Brave browser + VPN traffic adblock filter.

I forgot what the ads are. Occasionally I get terrified when I see someone browsing raw chrome

s09dfhks 35 minutes ago

or....just use firefox and ublock origin

MuhammedBasith 6 minutes ago

i mean atp just pay for it

sbdaman 2 hours ago

I hate that every readme is written like this now

albriorix 2 hours ago

Yea, there's a sameness to technical documentation these days for obvious reasons. Do you have an example of a README that you consider well done?

iekeb 2 hours ago

Do you miss the days when readmes all missed important sections?

rwaksmunski an hour ago

wBlock on Safari works well, both mobile and laptop.

baal80spam 2 hours ago

Brave + uBlock origin = youtube has ads?

dns_snek an hour ago

Do you still use classic uBO on Brave? Unless you manually update it from Github you might be stuck on an old vulnerable version since it was removed from the extension store, just FYI.

baal80spam 5 minutes ago

Just checked, I am on uBlock Origin 1.77.0, and the latest is 1.77.2. I don't update it manually, I guess it still updates automatically.

twiko 2 hours ago

I use Brave, no ads ever. Also you can hide channels, comments etc there is more yt specific options.