
▶ BLOG
KB 2330: Allow a single video without unblocking YouTube
How to allow viewing of a video on YouTube without having to unblock the entire site.
Objective
Unblock a single YouTube video, but without unblocking the entire site.
Steps
Please note that SSL decryption is required for regular expression filtering to work with HTTPS.
- To enable video playback on YouTube, you must first open two URLs with these regexes as rules in the filtering policies placed upstream of the other filtering policies:
.*(c|s)\.youtube\.com .*\.ytimg\.com .*\.googlevideo\.com/(crossdomain.xml|videoplayback?) .*\.youtube\.com/crossdomain.xml .*(youtube|googlevideo).com/.*\.(js|css) ^https://www\.youtube\.com/youtubei.* .*youtube\.com/s/_/ytmainappweb.* .*youtube\.com/upgrade_visitor_cookie.*
Note: the .* allows you to include characters before and after the written expression.
This will allow videos to be played without giving access to the YouTube site. - Then choose the videos to open for users. Let's take the URL http://www.youtube.com/watch?v=Nntzerp5WMQ as an example. First, you need to retrieve the video ID (this is the string of characters that follows the "=" sign). Here, the identifier is Nntzerp5WMQ. Add a rule to the filtering policies placed upstream of the other filtering policies on the webadmin. Insert the video identifier into a Regex, in the form:
.*Nntzerp5WMQ.*
or
.*\.youtube\.com/.*Nntzerp5WMQ.* - Confirm.
Validation
This means that viewing the video whose ID has been saved is permitted. To access it, click on the usual link. It is also possible to enter the full URL in the web browser.