LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Enterprise Linux Forums > Linux - Enterprise
User Name
Password
Linux - Enterprise This forum is for all items relating to using Linux in the Enterprise.

Notices


Reply
  Search this Thread
Old 11-18-2013, 04:21 AM   #1
raju_t
LQ Newbie
 
Registered: Nov 2013
Posts: 6

Rep: Reputation: Disabled
How to allow specific video on youtube and block all other in Squid Proxy


I am unsing Squid Proxy for Internet connection.

Presently I blocked youtube by adding following lines in squid proxy.
acl sites dstdomain .youtube.com
http_access deny sites
so the users can't access youtube. This access list blocked youtube sites.
but I have to allow some video's on youtube so that users can see this. so i added following access list to allow this specific video before above deny statement.
acl youtube_allow url_regex ^ http://www.youtube.com/????/?????/.....
http_access allow youtube_allow
acl sites dstdomain .youtube.com
http_access deny sites

but adding this access list users can't access specifc video which I allow

Pl any body help to solve this peoblem .
 
Old 11-18-2013, 07:16 AM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,165
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Hi,

Usually a youtube URL is like this: http://www.youtube.com/watch?v=<some gibberish>
In this case you have to escape any occurence of "?" as it's a special character in a regex (matches the previous character).
Also you should not leave a blank space between the caret (^) and the starting http... odf the URL:
Code:
acl youtube_allow url_regex ^http://www.youtube.com/watch\?v=MyNiceVideo
Regards
 
Old 11-19-2013, 12:04 AM   #3
raju_t
LQ Newbie
 
Registered: Nov 2013
Posts: 6

Original Poster
Rep: Reputation: Disabled
Thank u Bathory (GUru)
Actually there is no space between ^ and http , the ACL list in Config file is as follows :

acl youtube_allow url_regex -i ^http://www.youtube.com/playlist?list...8SfwcZJErwuhiH
http_access allow youtube_allow
acl sites dstdomain .youtube.com
http_access deny sites

These above Access list does not allow specific url ie youtube_allow
It deny whole youtube sites .

Pl help me to solve this problem
 
Old 11-19-2013, 02:05 AM   #4
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,165
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
I've already told you that you need to escape the "?" in the URL:
Code:
acl youtube_allow url_regex -i ^http://www.youtube.com/playlist\?list=PLVok63jpnHrH20P9qRP8SfwcZJErwuhiH
 
Old 11-21-2013, 01:54 AM   #5
raju_t
LQ Newbie
 
Registered: Nov 2013
Posts: 6

Original Poster
Rep: Reputation: Disabled
Problem was solved . Thank u bathory (Guru).

Another problem is that after word i blocked flash by adding this lines.
acl flash_ads rep_mime_type application/x-shockwave-flash
acl youtube_allow url_regex -i ^http://www.youtube.com/playlist\?lis...8SfwcZJErwuhiH
acl sites dstdomain .youtube.com
http_access allow youtube_allow
http_access deny sites
http_reply_access deny flash_ads
This line block all flash video . Problem is that how i can allow flash for only allowed video on youtube (Access list name is : youtube_allow) so that this video will be display and all other video will be blocked.

Last edited by raju_t; 11-21-2013 at 05:09 AM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Squid intercept proxy: Can't play youtube videos while logged in ACiD GRiM Linux - Server 3 09-14-2012 03:10 AM
block bad youtube content only with Squid Guard Kumado Linux - Server 1 09-02-2010 06:22 PM
Squid Redirect specific domain to an Secondary (External) Squid Proxy Zxarr Linux - Server 2 04-20-2010 12:50 PM
[SOLVED] Not able to upload videos to youtube using the Squid proxy server chandramani_yadav Linux - Server 4 08-13-2009 02:26 AM
Squid proxy unable to view video Youtube yuth Linux - Server 1 07-23-2009 10:47 AM

LinuxQuestions.org > Forums > Enterprise Linux Forums > Linux - Enterprise

All times are GMT -5. The time now is 06:16 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration