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 . |
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 |
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 |
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 |
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. |
All times are GMT -5. The time now is 03:38 AM. |