How do I allow specific YouTube videos?

Article #: Product Castle
1278 Guardian All

Summary

This article describes how to allow access to specific YouTube videos, while YouTube in general remains blocked.

Problem

Allowing individual videos for YouTube can be time-consuming and tedious — finding then listing each video's URL in a category.

Solution

Please note: This solution will not work if the content modification 'Youtube restricted mode' is enabled. This solution is most appropriate for customers who do not use GSuite for education.

Note: As YouTube defaults to HTTPS, you will need to enable HTTPS Decrypt and Inspect for YouTube — see https://help.smoothwall.net/Latest/Content/modules/guardian3/cgi-bin/guardian/https.htm

  1. You need the 11-digit YouTube video code for each video you want to allow access to. The video code forms part of the URL. For example,
  2. https://www.youtube.com/watch?v=mPI0bCXiF3U

    has the video code mPI0bCXiF3U

  3. From the Smoothwall administration user interface, go to Guardian > Policy Objects > Categories.
  4. Create a new custom category with the following contents:
  5. Domain / URL filtering:

    • s.youtube.com
    • googlevideo.com
    • youtube.com/crossdomain.xml
    • ytimg.com/yt
    • ytimg.com/crossdomain.xml
    • s.ytimg.com
    • c.youtube.com
    • youtube.com/yts

    URL patterns (click Advanced):

    • cache[0-9]\.c\.youtube\.com
    • youtube\.com/.*<11_digit_YouTube_video_code>

    where 11_digit_YouTube_video_code is the video code copied from the URL.

  6. Within the same category, repeat:
  7. URL patterns (click Advanced):

    • youtube\.com\/.*<11_digit_YouTube_video_code>

    for every video you want to allow access.

Tip: To allow embedded videos, use youtube\.com\/embed/.*<11_digit_YouTube_video_code> instead.

Tip: To allow YouTube playlists, use youtube\.com\/.*<22_digit_YouTube_playlist_code> instead

Attribution:

Last updated: Author: Contributions by:
27th March 2017  

TE

SN