SkyTubeTeam / SkyTube

Copylefted libre / open source YouTube player for Android
GNU General Public License v3.0
2.24k stars 319 forks source link

Add Kids Mode #424

Open BlueFeather89 opened 5 years ago

BlueFeather89 commented 5 years ago

It would be very nice if you could add a setting to make the app kids safe/ kids friendly.

Thanks in advance.

PoorPocketsMcNewHold commented 5 years ago

Well, Since even the actual Youtube Kids app is far from being friendly even in itself, i suppose you wanted to suggest the restricted mode maybe ? Outside of that, I don´t really know if you can really access the Youtube Kids filter other than on their application.

BlueFeather89 commented 5 years ago

Yes, even the restricted mode would be a very important update for SkyTube. I think a lot of people that use SkyTube, including myself, give the phone to their kids and it would be very nice if we could restrict the app content so there will be no pratial/full nudity.

BlueFeather89 commented 5 years ago

Maybe we can have a look at the official YouTube app, it is simple to reverse engineer it, so you can have a look if there is any loophole to implement the Kids Mode into SkyTube.

amalon commented 3 years ago

I've managed to enforce strict mode search in youtube/google/duckduckgo at the LAN level for chosen devices by overriding DNS entries as CNAME entries pointing at restrict.youtube.com & equivalents, as described here: https://discourse.pi-hole.net/t/use-dns-to-force-youtube-into-restricted-mode-and-pi-hole/1996

Presumably SkyTube could quite easily have a setting to simply use restrict.youtube.com or restrictmoderate.youtube.com rather than the normal youtube domains?

gzsombor commented 3 years ago

Interesting idea, but I can't figure out, how this supposed to be work. Currently, for search, we request the page 'https://www.youtube.com/results?search_query=XXX' and parse the results. However, if I understand your suggestion, we should request 'https://restrict.youtube.com/results?search_query=XXX'. But this doesn't return anything usable. And I don't think, it is possible to change DNS entries from an Android app. Maybe, using a low level, custom http client from the app. I could totally miss something obvious, what do you suggest?

amalon commented 3 years ago

Ah okay. I guess it only works for DNS redirection then (unlike the safe.duckduckgo which appears to have a virtual host for duckduckgo.com and safe.duckduckgo.com).

In which case SkyTube would have to somehow override the "Host" HTTP header to request www.youtube.com but to the IP resolved from restrict.youtube.com. Even if an API is provided to set custom HTTP headers by whatever HTTP client SkyTube uses, it may well get overridden by the client based on the URL anyway.

Where is the code in question that performs these requests? I can't find it

gzsombor commented 3 years ago

The very simple implementation which communicate with the network lives here: HttpDownloader.java