Allow Specific YouTube Channel and its Playlist

Allow Specific YouTube Channel and its Playlist

Client Scenario

Ganpat University provides graduate programs to various colleges. Ganpat University distributes internet to their students. Ganpat University want to block entire www.youtube.com for their students, but wants some of the YouTube channels allowed which are helpful for students.
Ganpat University challenges are:
All Students should not be allowed to access www.youtube.com. If any student tries to access YouTube, then he/she should get blocked template.
Only few of the specified YouTube channel and its playlist should be allowed. These YouTube channel contains educational and knowledge sharing videos.

Solution

You can achieve this by creating policy in Request Profiles Section and bind it with policies in Access Profiles Section.

Prerequisites

HTTPS Inspection should be enabled in SafeSquid. If not enabled, you can check our document - How to enable HTTPS Inspection.
You need YouTube Channel-ID and List-ID of playlist you want to allow. You have to extract Channel-ID and List-ID of the playlist from YouTube URL before creating rules in SafeSquid.

Channel-ID and List-ID Extraction

Extract Channel-ID from YouTube Channel

1. Open the YouTube channel you want to Allow. Here we have taken CBT Nuggets Channel as an example.
Here you will get Channel-ID from the referrer URL. Channel-ID is the preceding portion of the URL after 'channel/' part. Save this part on notepad for reference.
CBT Nuggets Channel URL: https://www.youtube.com/channel/UClIFqsmxnwVNNlsvjH1D1Aw
Channel-ID: UClIFqsmxnwVNNlsvjH1D1Aw
Select any playlist of this Channel and click on PLAY ALL link on the page as shown below. Here we have selected playlist CBT Nuggets Webinars.
Extract Channel-ID from YouTube Channel to Allow Specific YouTube Channel and its Playlist

Extract List-ID from YouTube Channel

2. You can extract List-ID from the selected playlist.
List-ID is the preceding portion of the URL after '&list=' part. Save this part on notepad for reference.
In our case we have taken playlist CBT Nuggets Webinars and its URL is https://www.youtube.com/watch?v=PcB0j6uBJCA&list=PLQVJk9oC5JKo_bMWae3xsavpPMKAzIeGb
Extracted List-ID: PLQVJk9oC5JKo_bMWae3xsavpPMKAzIeGb
Extract List-ID from YouTube Channel to Allow Specific YouTube Channel and its Playlist
You can check any videos from the playlist. You will observe every Video in the playlist contain same List-ID.
URL for next video in CBT Nuggets Webinars playlist: https://www.youtube.com/watch?v=q802E2jsByI&list=PLQVJk9oC5JKo_bMWae3xsavpPMKAzIeGb&index=2
 List-ID: PLQVJk9oC5JKo_bMWae3xsavpPMKAzIeGb
Verify  List-ID from YouTube Channel to Allow Specific YouTube Channel and its Playlist 

Policy Creation

Create Policy in Request Types Section

3. After extracting the Channel-ID and List-ID we have to create policies in SafeSquid.
 Go to SafeSquid Web-GUI and click on Configure to create Policies.
Click on Configure to create policy that will allow Specific YouTube Channel and its Playlist 
4. Click on Custom Settings to open Request Types Section.
Click on Custom Settings to open Request Types Section to allow Specific YouTube Channel and its Playlist 
5. Click on Request Types Section to create the policy.
Click on Request Types Section to create the policy to allow Specific YouTube Channel and its Playlist 
6. Make sure the Global of Request Types Section is Enabled to True.
Select Global of Request Types Section is Enabled to True to Allow Specific YouTube Channel and its Playlist 
7. Click on Request Types tab to create new policy.
Click on Request Types tab to create new policy to Allow Specific YouTube Channel and its Playlist 
8. Insert appropriate comment for future use.
Insert appropriate comment for future use that describe policy of Allow Specific YouTube Channel and its Playlist 
9. You have to select YouTube Channels in Request Types field.
Select YouTube Channels in Request Types field to Allow Specific YouTube Channel and its Playlist 
10. You have to add Channel-ID and List-Id in File Field and Save the policy. You have already saved them in notepad for your reference.
 Here for CBT Nuggets channel, we added (UClIFqsmxnwVNNlsvjH1D1Aw|PLQVJk9oC5JKo_bMWae3xsavpPMKAzIeGb) in File field.
add Channel-ID and List-Id in File Field and Save the policy to Allow Specific YouTube Channel and its Playlist 
11. Create new Request Types as NUGGET CHANNEL in Added Request Types Field.
Create new Request Types as NUGGET CHANNEL in Added Request Types Field to Allow Specific YouTube Channel and its Playlist 
12. Save the Policy Created in Request Types Section.
Save the Policy Created in Request Types Section to Allow Specific YouTube Channel and its Playlist

Create Policy in Access Profiles Section

13. Go to Access Profiles section to bind with Profiles.
Select Access Profiles section to bind with Profiles to Allow Specific YouTube Channel and its Playlist 
14. Edit these two default policies with profiles name BLOCK YOUTUBE CHANNEL as shown below.
Note: You can create two new policies, if you don’t want to modify default policies.
Edit these two default policies with profiles name BLOCK YOUTUBE CHANNEL to Allow Specific YouTube Channel and its Playlist 
15. Edit the 1st, Policy. Set Enabled to TRUE and Save the Policy.
Edit one out of  two default policy as True with profiles name BLOCK YOUTUBE CHANNEL to Allow Specific YouTube Channel and its Playlist 
16. Edit the 2nd, Policy. Set this policy Enabled to TRUE.
Edit second one  out of  two default policy as True with profiles name BLOCK YOUTUBE CHANNEL to Allow Specific YouTube Channel and its Playlist 
17. Insert appropriate comment for future use.
Insert appropriate comment for future use in policy which made to allow Specific YouTube Channel and its Playlist 
18. You have to select NUGGET CHANNEL in Request Types field which we have created in Step #10. Save the Policy.
Select NUGGET CHANNEL in Request Types field in policy that allow Specific YouTube Channel and its Playlist 
19. You should check the modified Policies after saving to confirm whether its created properly or not.
saving to confirm whether its created properly or not policy that allow Specific YouTube Channel and its Playlist 

Test the Scenario

Now try to open videos other than CBT Nuggets Webinars playlist of YouTube Channel CBT Nuggets.
All the other videos will be blocked and below Template shown.
Test policy that Allow Specific YouTube Channel and its Playlist
You can check the videos from CBT Nuggets Webinars playlist of CBT Nuggets channel. Only these videos will be allowed.
Note:
This configuration will work only for videos sourced from the channel page and not from the feeds links or YouTube Videos embedded in website.
To allow all the videos of any specific YouTube Channel you have to insert List-ID's (of every playlist in that channel) and file part (of each individual unlisted videos) of URL in the File field of Request Types Section.


    • Related Articles

    • Block Specific Youtube Channel

      Overview Prevent users to access specific YouTube Channel like 'T-Series'. Note: Blocking of Specific YouTube channel and allowing all the other YouTube videos is a hypothetical scenario. YouTube website is not designed for such hypothetical ...
    • YouTube API Integration With SafeSquid To Allow Specific YouTube Videos

      Overview YouTube is a video-sharing website which provides a wide variety of videos. YouTube video content categories organize channels and videos on YouTube website. YouTube has lots of videos for entertainment like comedy, music, movies, web ...
    • Allow specific website through SafeSquid

      Client Scenario Stark tech is having 200 employees. Stark tech distributes all 200 employees into different 'User Groups'. Now Stark tech blocked all the websites for defined 'User Group' say 'General Users' Stark tech challenges are: General users ...
    • How to allow specific website through category

      Client Scenario Stark tech is having 200 employees. Stark tech distributes all 200 employees into different 'User Groups'. Now Stark tech blocked all the websites for defined 'User Group' say 'General Users' Stark tech challenges are: General users ...
    • Allow anydesk

      Overview For security reasons you blocked all the traffic to all users. But some of the users in your network need to access remote applications. Using SafeSquid you can allow specific users in your network to access remote applications. How it ...