Blocking YouTube Shorts with Regex
-
Tried following what was mentioned here. I am trying to block the shorts seen on youtube. The link to a youtube short is like this
https://www.youtube.com/shorts/wEVVhumRrHI
Thanks in advance..
-
@anishkgt You can block domains via DNS lookup, not URLs. You'd need a proxy.
-
@SteveITS That was an example of the destination i need to block. It is not possible to block that url in the firewall rules were domains are used. I was wondering if it would be possible to block YouTube shorts can be blocked via regex. Since it was done in the link mentioned here ->(https://forum.netgate.com/topic/164732/python-regex-list)
-
@anishkgt said in Blocking YouTube Shorts with Regex:
Since it was done in the link mentioned here ->(https://forum.netgate.com/topic/164732/python-regex-list)
That link shows you you can block 'anything that contains "yahoo" in the host name".
Fasten your seat belts now.
Example :
https://www.youtube.com/shorts/wEVVhumRrHI is an URL
youtube.com is a host name
www.youtube.com is a sub domain of that host name.pfBlockerng has access - can see in the clear - the domain name, "youtube.com" and the sub domain name, www.youtube.com. So it can 'filter' these. The the app or web browser on the device gets an A (IPv4) or AAAA (IPv4) as an asnwer, and it connects to this (the "youtube") server.
TLS is established first.
Only now the browser gets the actual 'page' : the video : with this command "GET /shorts/wEVVhumRrHI/".
The thing is : you can't get 'into' this TLS stream. Its encrypted. You want it be encrypted. You don't want to have access to this data stream. Like never.There is one possibilities left : use a proxy, and do MITM. Be warned : this is pure rocket science.
So, as @SteveITS said : you need a proxy.
If the shorts where accessible by the usage of a sub domain name, then it would be easy :
shorts.youtube.com can be filtered at a DNS request level, as the link shown above already shows.But Youtube (Google) etc are doing there best so nobody can filter there content. They are hiring the "best" for doing just that. So, part of the mission is : you have to be better as these couple of thousands of network engineers they employ.
edit : It's youtube that has given us a partial solution. Youtube, without a premium access, is ... well ... IHMO, its just not possible. If I had to wade through the publicity to see these 'shorts' I presume I have a problem way bigger as 'watching shorts'. But hey, its a free world. Smoking is also bad. And I should drink (not water) less.