jspenguin2017 / uBlockProtector

An anti-adblock defuser for Nano Adblocker and uBlock Origin
GNU General Public License v3.0
740 stars 83 forks source link

ani.gamer.com.tw #1045

Closed LiCybora closed 5 years ago

LiCybora commented 5 years ago

Explain why is this change needed (required):

The timer boost is required for integrate with ND for skip ads (Ads not skipped without integrated with ND, they use client side timer to verify whether ad is end). Note that again I only have solution for Firefox.

Also bump version if this fix publish.

Test link (if applicable):

https://ani.gamer.com.tw/animeVideo.php?sn=11335 (Geo lock, reporter can provide VPN)

Screenshots and reproduction steps (if applicable):

  1. Connect VPN (if required)
  2. add the two timer boost (just as this PR)
  3. Use the pre-release ND on Firefox (on my page)
  4. Ads should skip automatically after several second instead of 30 (and ads are muted and hidden)

Issues that are related (if applicable):

See my related commit

Add everything else that you believe to be useful below (optional):

To ensure version number sync, maybe I make pull request here so that you can know I bump the version?

jspenguin2017 commented 5 years ago

Is there a related issue for this? https://github.com/uBlockOrigin/uAssets/issues/4290

Also, a.timewarp does the same thing, can you use that instead?

jspenguin2017 commented 5 years ago

I see that the script is async, we can intercept it and inject it ourselves.

I'm not convinced that there's no fix for Chrome.

LiCybora commented 5 years ago

Opps, I overlooked that. I will use a.timewarp instead.

Edit: Using a.timewarp seems affect all Danmaku (comment on video) speed, while no effect when using nano-booster.

There may have fix for Chrome, just I don't find it yet. This might need more works on it.

jspenguin2017 commented 5 years ago

a.timewarp can be configured to work exactly like the booster script snippets. I think I'm close to a working solution for Chrome though.

jspenguin2017 commented 5 years ago

@LiCybora I think I stamped out all the bugs, does this solution work for you?

LiCybora commented 5 years ago

Maybe also add these two: const adsTimerOffset = `<Linear skipoffset="00:00:30">`; ... payload = payload.replace(adsTimerOffset, `<Linear skipoffset="00:00:03">`);

Shorter offset will result server error by the way..

The remaining are good now! Thanks.

jspenguin2017 commented 5 years ago

Shorter offset will result server error by the way

Will result in server error? Eh... Then why do we want that?

LiCybora commented 5 years ago

I mean, shorter than 3 seconds. At least better than originally 30 secs. BTW elem.src.startsWith("https://i2.bahamut.com.tw/build/js/animeplayer.js") Change to elem.src.startsWith("https://i2.bahamut.com.tw/build/js/animeplayer.js") || elem.src.startsWith("https://i2.bahamut.com.tw/build/js/animeplayer_beta.js")

jspenguin2017 commented 5 years ago

I think it's good. Let's just ship it, what can possibly go wrong?

LiCybora commented 5 years ago

Opps, seems something really goes wrong? I see slow Danmaku speed. But it is fine for beta player. My bad... nothing wrongs now