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

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,

https://www.youtube.com/watch?v=mPI0bCXiF3U

has the video code mPI0bCXiF3U

2. From the Smoothwall administration user interface, go to Guardian > Policy Objects > Categories.
3. Create a new custom category with the following contents:

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.

4. Within the same category, repeat:

URL patterns (click Advanced):

youtube\.com/.*<11_digit_YouTube_video_code>

for every video you want to allow access to.

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

 

Copyright © 2000-2016 Smoothwall All rights reserved.