AdguardTeam / AdguardForAndroid

Open bug tracker for Android version of AdGuard.
https://adguard.com/
1.36k stars 90 forks source link

Blocking Youtube ads by "sharing" video to our app #2994

Closed ameshkov closed 3 years ago

ameshkov commented 5 years ago

Problem Description

There is no normal solution to adblocking on Youtube besides watching it in the browser (or rooting your device). Well, and besides purchasing YT Premium, but it's not available in a lot of countries.

Proposed Solution

Allow watching Youtube videos right inside AdGuard (without ads, obviously).

  1. Add a sharing provider for YT videos URLs. Let's call it "Watch without ads".
  2. The video is opened in AdGuard (just like you could open it in Telegram or NewPipe).
  3. The player should support:
    • Standard video controls
    • Tap to pause/play
    • Double-tap to seek
    • Slide up/down to control the volume
    • Setting menu with the following options:
      • Change orientation (portrait/album)
      • Changing quality
      • Picture-in-picture mode
      • Enable/disable captions
      • Share option (with timecode)
  4. Add an additional screen to the app's onboarding explaining how to use this feature
  5. Add "Youtube settings" under the "Content Blocking" settings with the following options there:
    • ON/OFF the sharing provider
    • The same explanation the as on the onboarding screen

Please note, that we cannot and do not want to replace the YT app. There are some awesome solutions for that already (see NewPipe).

Alternatives Considered

  1. We cannot and do not want to replace the YT app. There are some awesome solutions for that already (see NewPipe).
  2. Automatic ad-skipping. Ridiculously hard to maintain. All the examples I've seen are quite unstable.
  3. Virtualization (see #2889). Feasible, but much harder to implement, and worthy of a separate product.
lancelot-moon commented 5 years ago

For the 2nd point in Alternatives Considered: https://github.com/AdguardTeam/AdguardForAndroid/issues/2427

This is valid. It also has a free version. https://play.google.com/store/apps/details?id=com.agooday.skipadspro

But I don't know if it's safe to use.

Great ideas! Just it looks like essentially watching YouTube with a browser, right? I remember the upper resolution of YouTube video by mobile browsers is limited in 720p. (YT app can use 1080p.)

snhv commented 5 years ago

How about just sending it to the browser?

lancelot-moon commented 5 years ago

May you give the options of playing speed if possible? I mean 0.5x, 0.75x, normal, 1.25x and 1.5x speed. Thanks.

ameshkov commented 5 years ago

How about just sending it to the browser?

It won't provide picture-in-picture

ministr91 commented 3 years ago

Это костыль. Перемотка 15 секунд, но куда подевались мои 10? Неизвестно в каком качестве видео запускается

zero77 commented 3 years ago

Instead of developing and maintaining a video player would it not be easier to just recommend an existing one like, NewPipe.

TPS commented 3 years ago

I tried to determine what AG had done (blocked, modified, &c) with the YT link I shared, but didn't find any entries in the log. Not implemented?

Chinaski1 commented 3 years ago

Yes at this stage this info not implemented in the filtering log.

TPS commented 3 years ago

Yes at this stage this info not implemented in the filtering log.

Planned? ETA?

Chinaski1 commented 3 years ago

Tentatively by version 4.0.

artemiv4nov commented 3 years ago

@TPS Hi! I guess the YouTube traffic can't be shown in the Filtering log because the AdGuard app makes requests to YouTube. The AdGuard traffic is not taken into account by ourselves.

TPS commented 3 years ago

That's a problem, isn't it? How does 1 debug, &c?

artemiv4nov commented 3 years ago

No, that's not a problem

ameshkov commented 3 years ago

@TPS blocking YT ads in this case is not achieved via declarative rules, rather by using YT Iframe API with additional parameters to disable ads. Debugging it is only possible if you're an AdGuard dev, you need access to the code to change anything.