Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    Blocking YouTube Shorts with Regex

    Scheduled Pinned Locked Moved pfBlockerNG
    4 Posts 3 Posters 1.4k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • A
      anishkgt
      last edited by

      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..

      S 1 Reply Last reply Reply Quote 0
      • S
        SteveITS Galactic Empire @anishkgt
        last edited by

        @anishkgt You can block domains via DNS lookup, not URLs. You'd need a proxy.

        Pre-2.7.2/23.09: Only install packages for your version, or risk breaking it. Select your branch in System/Update/Update Settings.
        When upgrading, allow 10-15 minutes to restart, or more depending on packages and device speed.
        Upvote 👍 helpful posts!

        A 1 Reply Last reply Reply Quote 0
        • A
          anishkgt @SteveITS
          last edited by

          @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)

          GertjanG 1 Reply Last reply Reply Quote 0
          • GertjanG
            Gertjan @anishkgt
            last edited by Gertjan

            @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.

            No "help me" PM's please. Use the forum, the community will thank you.
            Edit : and where are the logs ??

            1 Reply Last reply Reply Quote 1
            • First post
              Last post
            Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.