TOPIC: pfSense users

Re: pfSense users 28 May 2012 01:35 #533912

  • szerocool7's Avatar
  • szerocool7
  • Online
  • Platinum Boarder
  • Platinum Boarder
  • Posts: 3003
  • Thanks: 205

incubus14 wrote:

szerocool7 wrote: tanong ko lang hindi naba gumana yung smartvideo add on or autobuffer ng greasemonkey sa youtube

na 240p.

lagi nalang naka 360 kahit anong video.

ganun din ba sa inyo using firefox?


may mga ibang videos na ok naman, may iba na hindi.


naka config kasi sa client pc ko na 240p lang yung youtube by default.

ok naman sya lastweek.. pero ngayon naka 360p lagi lahat.. hindi ko alam kung hindi na gumagana yung smartvideo or auto buffer. or baka nag reprogram na youtube para hindi na gumagana yung script.

Please Log in or Create an account to join the conversation.

Re: pfSense users 28 May 2012 02:01 #533924

  • lenardzone's Avatar
  • lenardzone
  • Online
  • Senior Boarder
  • Senior Boarder
  • Posts: 312
  • Thanks: 17
check mo firefox mo baka hinde compatible sa smartvideo add ons mo.install mo latest update ng firefox yung firefox 12 yan gamit ko ngaun tyaka yung latest ng smartvideo addons..uncheck mo na lang yung automatic upadate ng firefox para hinde magkaproblema pag may update yung firefox...tagal ko na gamit yung smartvideo wala pako naging problema sa youtube w lusca :)

Please Log in or Create an account to join the conversation.

Re: pfSense users 28 May 2012 02:23 #533937

  • szerocool7's Avatar
  • szerocool7
  • Online
  • Platinum Boarder
  • Platinum Boarder
  • Posts: 3003
  • Thanks: 205
^parehas tayo gamit lenard..

Please Log in or Create an account to join the conversation.

Re: pfSense users 28 May 2012 02:46 #533947

  • athenaxd's Avatar
  • athenaxd
  • Offline
  • Platinum Boarder
  • Platinum Boarder
  • Posts: 16947
  • Thanks: 3429
Nang hihinayang talaga ako dun sa 1TB na WD Caviar Black tapos pala yung PSU Huntkey pinalagay ni Sir Eric ang lupet.

Please Log in or Create an account to join the conversation.

Re: pfSense users 28 May 2012 02:56 #533950

  • athenaxd's Avatar
  • athenaxd
  • Offline
  • Platinum Boarder
  • Platinum Boarder
  • Posts: 16947
  • Thanks: 3429
Repost ko lang delete all scripts related to youtube sa storeurl.pl file ninyo and replace with this
# youtube all types
} elsif (m/^http:\/\/([0-9.]{4}|.*\.youtube\.com|.*\.googlevideo\.com|.*\.video\.google\.com)\/videoplayback\?(.*)/) {
$p_str = $2;
$tag = "";
$alg = "";
$id = "";
$range = "";
if ($p_str =~ m/(itag=[0-9]*)/){$tag = "&".$1}
if ($p_str =~ m/(algorithm=[a-z]*\-[a-z]*)/){$alg = "&".$1}
if ($p_str =~ m/(id=[a-zA-Z0-9]*)/){$id = "&".$1}
if ($p_str =~ m/(range=[0-9\-]*)/){$range = "&".$1; $range =~ s/-//; $range =~ s/range=//; }
print $x . "video-srv.youtube.com.SQUIDINTERNAL/" . $tag . "&" . $alg . "&" . $id . "&" . $range . "\n";

there is no need to clear your cache the old videos which is handle by the previous script will be deleted later.

50 second buffering is not a problem it is a bandwidth saving feature by youtube.

yun sinasabi ni deeza na kesyo hahatian daw sa 50-60 segments ang video nagkakamali sila

50-60 seconds hahatiin yung video para magaan i cache.

kaya pansin ninyo kahit hindi ninyo tapusin yung video (buffered by half)

pag nag refresh kayo ng screen 50 sec buffered agad siya yun yung 50/60 portion

so a 4 minute video will be split to 4
The following user(s) said Thank You: Zorpo

Please Log in or Create an account to join the conversation.

Last edit: Post by athenaxd.

Re: pfSense users 28 May 2012 03:21 #533963

  • kyohisro's Avatar
  • kyohisro
  • Online
  • Platinum Boarder
  • Platinum Boarder
  • Posts: 5444
  • Thanks: 213

athenaxd wrote: Repost ko lang delete all scripts related to youtube sa storeurl.pl file ninyo and replace with this

# youtube all types
} elsif (m/^http:\/\/([0-9.]{4}|.*\.youtube\.com|.*\.googlevideo\.com|.*\.video\.google\.com)\/videoplayback\?(.*)/) {
$p_str = $2;
$tag = "";
$alg = "";
$id = "";
$range = "";
if ($p_str =~ m/(itag=[0-9]*)/){$tag = "&".$1}
if ($p_str =~ m/(algorithm=[a-z]*\-[a-z]*)/){$alg = "&".$1}
if ($p_str =~ m/(id=[a-zA-Z0-9]*)/){$id = "&".$1}
if ($p_str =~ m/(range=[0-9\-]*)/){$range = "&".$1; $range =~ s/-//; $range =~ s/range=//; }
print $x . "video-srv.youtube.com.SQUIDINTERNAL/" . $tag . "&" . $alg . "&" . $id . "&" . $range . "\n";

there is no need to clear your cache the old videos which is handle by the previous script will be deleted later.

50 second buffering is not a problem it is a bandwidth saving feature by youtube.

yun sinasabi ni deeza na kesyo hahatian daw sa 50-60 segments ang video nagkakamali sila

50-60 seconds hahatiin yung video para magaan i cache.

kaya pansin ninyo kahit hindi ninyo tapusin yung video (buffered by half)

pag nag refresh kayo ng screen 50 sec buffered agad siya yun yung 50/60 portion

so a 4 minute video will be split to 4



salamat baka pwede lagay na niyo yun full storeurl.pl

Please Log in or Create an account to join the conversation.

Last edit: Post by kyohisro.

Re: pfSense users 28 May 2012 07:19 #533998

  • bugalting's Avatar
  • bugalting
  • Online
  • Senior Boarder
  • Senior Boarder
  • Posts: 302
  • Thanks: 13

athenaxd wrote: ano specs ng pfsense box natin?


yung nilagay ko sa TheNet.com G620 4 GB DDR3 1 TB Harddrive WD Gigabyte H621M Caviar BLACK ^__^


bos hindi po ba conflict sa diskless yung pfsense?

Please Log in or Create an account to join the conversation.

Re: pfSense users 28 May 2012 20:35 #534215

  • athenaxd's Avatar
  • athenaxd
  • Offline
  • Platinum Boarder
  • Platinum Boarder
  • Posts: 16947
  • Thanks: 3429

kyohisro wrote:

athenaxd wrote: Repost ko lang delete all scripts related to youtube sa storeurl.pl file ninyo and replace with this

# youtube all types
} elsif (m/^http:\/\/([0-9.]{4}|.*\.youtube\.com|.*\.googlevideo\.com|.*\.video\.google\.com)\/videoplayback\?(.*)/) {
$p_str = $2;
$tag = "";
$alg = "";
$id = "";
$range = "";
if ($p_str =~ m/(itag=[0-9]*)/){$tag = "&".$1}
if ($p_str =~ m/(algorithm=[a-z]*\-[a-z]*)/){$alg = "&".$1}
if ($p_str =~ m/(id=[a-zA-Z0-9]*)/){$id = "&".$1}
if ($p_str =~ m/(range=[0-9\-]*)/){$range = "&".$1; $range =~ s/-//; $range =~ s/range=//; }
print $x . "video-srv.youtube.com.SQUIDINTERNAL/" . $tag . "&" . $alg . "&" . $id . "&" . $range . "\n";

there is no need to clear your cache the old videos which is handle by the previous script will be deleted later.

50 second buffering is not a problem it is a bandwidth saving feature by youtube.

yun sinasabi ni deeza na kesyo hahatian daw sa 50-60 segments ang video nagkakamali sila

50-60 seconds hahatiin yung video para magaan i cache.

kaya pansin ninyo kahit hindi ninyo tapusin yung video (buffered by half)

pag nag refresh kayo ng screen 50 sec buffered agad siya yun yung 50/60 portion

so a 4 minute video will be split to 4



salamat baka pwede lagay na niyo yun full storeurl.pl

#!/usr/bin/perl
# $Rev$
# by chudy_fernandez@yahoo.com
# Youtube updates at http://wiki.squid-cache.org/ConfigExamples/DynamicContent/YouTube/Discussion
$|=1;
while (<>) {
    @X = split;
#	$X[1] =~ s/&sig=.*//;
	$x = $X[0] . " ";
	$_ = $X[1];
	$u = $X[1];

			#photos-X.ak.fbcdn.net where X a-z
if (m/^http:\/\/photos-[a-z]?(.ak.fbcdn.net.*)/) {
	print $x . "http://photos" . $1  . "\n";

			#maps.google.com
} elsif (m/^http:\/\/(khm|mt)[0-9]?(.google.com.*)/) {
	print $x . "http://" . $1  . $2 . "\n";
	
		# all types of youtube videos
} elsif (m/^http:\/\/([0-9.]{4}|.*\.youtube\.com|.*\.googlevideo\.com|.*\.video\.google\.com)\/videoplayback\?(.*)/) {
	$p_str = $2;
	$tag = "";
	$alg = "";
	$id = "";
	$range = "";
	if ($p_str =~ m/(itag=[0-9]*)/){$tag = "&".$1}
	if ($p_str =~ m/(algorithm=[a-z]*\-[a-z]*)/){$alg = "&".$1}
	if ($p_str =~ m/(id=[a-zA-Z0-9]*)/){$id = "&".$1}
	if ($p_str =~ m/(range=[0-9\-]*)/){$range = "&".$1; $range =~ s/-//; $range =~ s/range=//; }
	print $x . "video-srv.youtube.com.SQUIDINTERNAL/" . $tag . "&" . $alg . "&" . $id . "&" . $range . "\n";

	
	
} elsif (m/^http:\/\/www\.google-analytics\.com\/__utm\.gif\?.*/) {
	print $x . "http://www.google-analytics.com/__utm.gif\n";

			#Cache High Latency Ads
} elsif (m/^http:\/\/([a-z0-9.]*)(\.doubleclick\.net|\.quantserve\.com|\.googlesyndication\.com|yieldmanager|cpxinteractive)(.*)/) {
	$y = $3;$z = $2;
	for ($y) {
	s/pixel;.*/pixel/;
	s/activity;.*/activity/;
	s/(imgad[^&]*).*/\1/;
	s/;ord=[?0-9]*//;
	s/;&timestamp=[0-9]*//;
	s/[&?]correlator=[0-9]*//;
	s/&cookie=[^&]*//;
	s/&ga_hid=[^&]*//;
	s/&ga_vid=[^&]*//;
	s/&ga_sid=[^&]*//;
	# s/&prev_slotnames=[^&]*//
	# s/&u_his=[^&]*//;
	s/&dt=[^&]*//;
	s/&dtd=[^&]*//;
	s/&lmt=[^&]*//;
	s/(&alternate_ad_url=http%3A%2F%2F[^(%2F)]*)[^&]*/\1/;
	s/(&url=http%3A%2F%2F[^(%2F)]*)[^&]*/\1/;
	s/(&ref=http%3A%2F%2F[^(%2F)]*)[^&]*/\1/;
	s/(&cookie=http%3A%2F%2F[^(%2F)]*)[^&]*/\1/;
	s/[;&?]ord=[?0-9]*//;
	s/[;&]mpvid=[^&;]*//;
	s/&xpc=[^&]*//;
	# yieldmanager
	s/\?clickTag=[^&]*//;
	s/&u=[^&]*//;
	s/&slotname=[^&]*//;
	s/&page_slots=[^&]*//;
	}
	print $x . "http://" . $1 . $2 . $y . "\n";

			#cache high latency ads
} elsif (m/^http:\/\/(.*?)\/(ads)\?(.*?)/) {
	print $x . "http://" . $1 . "/" . $2  . "\n";

} elsif (m/^http:\/\/(www\.ziddu\.com.*\.[^\/]{3,4})\/(.*?)/) {
	print $x . "http://" . $1 . "\n";

			#cdn, varialble 1st path
} elsif (($u =~ /filehippo/) && (m/^http:\/\/(.*?)\.(.*?)\/(.*?)\/(.*)\.([a-z0-9]{3,4})(\?.*)?/)) {
	@y = ($1,$2,$4,$5);
	$y[0] =~ s/[a-z0-9]{2,5}/cdn./;
	print $x . "http://" . $y[0] . $y[1] . "/" . $y[2] . "." . $y[3] . "\n";

			#rapidshare
} elsif (($u =~ /rapidshare/) && (m/^http:\/\/(([A-Za-z]+[0-9-.]+)*?)([a-z]*\.[^\/]{3}\/[a-z]*\/[0-9]*)\/(.*?)\/([^\/\?\&]{4,})$/)) {
	print $x . "http://cdn." . $3 . "/SQUIDINTERNAL/" . $5 . "\n";

} elsif (($u =~ /maxporn/) && (m/^http:\/\/([^\/]*?)\/(.*?)\/([^\/]*?)(\?.*)?$/)) {
	print $x . "http://" . $1 . "/SQUIDINTERNAL/" . $3 . "\n";
	
			#domain/path/.*/path/filename
} elsif (($u =~ /fucktube/) && (m/^http:\/\/(.*?)(\.[^\.\-]*?[^\/]*\/[^\/]*)\/(.*)\/([^\/]*)\/([^\/\?\&]*)\.([^\/\?\&]{3,4})(\?.*?)$/)) {
	@y = ($1,$2,$4,$5,$6);
	$y[0] =~ s/(([a-zA-A]+[0-9]+(-[a-zA-Z])?$)|([^\.]*cdn[^\.]*)|([^\.]*cache[^\.]*))/cdn/;
	print $x . "http://" . $y[0] . $y[1] . "/" . $y[2] . "/" . $y[3] . "." . $y[4] . "\n";

			#like porn hub variables url and center part of the path, filename etention 3 or 4 with or without ? at the end
} elsif (($u =~ /tube8|pornhub|xvideos/) && (m/^http:\/\/(([A-Za-z]+[0-9-.]+)*?(\.[a-z]*)?)\.([a-z]*[0-9]?\.[^\/]{3}\/[a-z]*)(.*?)((\/[a-z]*)?(\/[^\/]*){4}\.[^\/\?]{3,4})(\?.*)?$/)) {
	print $x . "http://cdn." . $4 . $6 . "\n";

			#for yimg.com video
} elsif (m/^http:\/\/(.*yimg.com)\/\/(.*)\/([^\/\?\&]*\/[^\/\?\&]*\.[^\/\?\&]{3,4})(\?.*)?$/) {
	print $x . "http://cdn.yimg.com//" . $3 . "\n";
	
			#for yimg.com doubled
} elsif (m/^http:\/\/(.*?)\.yimg\.com\/(.*?)\.yimg\.com\/(.*?)\?(.*)/) {
	print $x . "http://cdn.yimg.com/"  . $3 . "\n";

			#for yimg.com with &sig=
} elsif (m/^http:\/\/([^\.]*)\.yimg\.com\/(.*)/) {
	@y = ($1,$2);
	$y[0] =~ s/[a-z]+([0-9]+)?/cdn/;
	$y[1] =~ s/&sig=.*//;
	print $x . "http://" . $y[0] . ".yimg.com/"  . $y[1] . "\n";
			
			#youjizz. We use only domain and filename
} elsif (($u =~ /media[0-9]{1,5}\.youjizz/) && (m/^http:\/\/(.*?)(\.[^\.\-]*?\.[^\/]*)\/(.*)\/([^\/\?\&]*)\.([^\/\?\&]{3,4})(\?.*?)$/)) {
	@y = ($1,$2,$4,$5);
	$y[0] =~ s/(([a-zA-A]+[0-9]+(-[a-zA-Z])?$)|([^\.]*cdn[^\.]*)|([^\.]*cache[^\.]*))/cdn/;
	print $x . "http://" . $y[0] . $y[1] . "/" . $y[2] . "." . $y[3] . "\n";

			#general purpose for cdn servers. add above your specific servers.
} elsif (m/^http:\/\/([0-9.]*?)\/\/(.*?)\.(.*)\?(.*?)/) {
	print $x . "http://squid-cdn-url//" . $2  . "." . $3 . "\n";

			# spicific extention
# } elsif (m/^http:\/\/(.*?)\.(jp(e?g|e|2)|gif|png|tiff?|bmp|ico|flv|wmv|3gp|mp(4|3)|exe|msi|zip|on2|mar|swf).*?/) {
	# @y = ($1,$2);
	# $y[0] =~ s/((cache|cdn)[-\d]*)|([a-zA-A]+-?[0-9]+(-[a-zA-Z]*)?)/cdn/;
	# print $x . "http://" . $y[0] . "." . $y[1] . "\n";

			#generic http://variable.domain.com/path/filename."ex", "ext" or "exte"
			#http://cdn1-28.projectplaylist.com
			#http://s1sdlod041.bcst.cdn.s1s.yimg.com
} elsif (m/^http:\/\/(.*?)(\.[^\.\-]*?\..*?)\/([^\?\&\=]*)\.([\w\d]{2,4})\??.*$/) {
	@y = ($1,$2,$3,$4);
	$y[0] =~ s/([a-z][0-9][a-z]dlod[\d]{3})|((cache|cdn)[-\d]*)|([a-zA-A]+-?[0-9]+(-[a-zA-Z]*)?)/cdn/;
	print $x . "storeurl://" . $y[0] . $y[1] . "/" . $y[2] . "." . $y[3] . "\n";

			# all that ends with ;
} elsif (m/^http:\/\/(.*?)\/(.*?)\;(.*)/) {
	print $x . "http://" . $1 . "/" . $2  . "\n";

} else {
	print $x . $_ . "\n";
}
}
The following user(s) said Thank You: lanzkie31, kurtkyle

Please Log in or Create an account to join the conversation.

Re: pfSense users 28 May 2012 21:54 #534238

  • kjshoot2ill's Avatar
  • kjshoot2ill
  • Offline
  • Platinum Boarder
  • Platinum Boarder
  • Posts: 5416
  • Thanks: 813

#!/usr/bin/perl
# $Rev$
# by chudy_fernandez@yahoo.com
# Youtube updates at http://wiki.squid-cache.org/ConfigExamples/DynamicContent/YouTube/Discussion
$|=1;
while (<>) {
    @X = split;
#	$X[1] =~ s/&sig=.*//;
	$x = $X[0] . " ";
	$_ = $X[1];
	$u = $X[1];

			#photos-X.ak.fbcdn.net where X a-z
if (m/^http:\/\/photos-[a-z]?(.ak.fbcdn.net.*)/) {
	print $x . "http://photos" . $1  . "\n";

			#maps.google.com
} elsif (m/^http:\/\/(khm|mt)[0-9]?(.google.com.*)/) {
	print $x . "http://" . $1  . $2 . "\n";
	
		# all types of youtube videos
} elsif (m/^http:\/\/([0-9.]{4}|.*\.youtube\.com|.*\.googlevideo\.com|.*\.video\.google\.com)\/videoplayback\?(.*)/) {
	$p_str = $2;
	$tag = "";
	$alg = "";
	$id = "";
	$range = "";
	if ($p_str =~ m/(itag=[0-9]*)/){$tag = "&".$1}
	if ($p_str =~ m/(algorithm=[a-z]*\-[a-z]*)/){$alg = "&".$1}
	if ($p_str =~ m/(id=[a-zA-Z0-9]*)/){$id = "&".$1}
	if ($p_str =~ m/(range=[0-9\-]*)/){$range = "&".$1; $range =~ s/-//; $range =~ s/range=//; }
	print $x . "video-srv.youtube.com.SQUIDINTERNAL/" . $tag . "&" . $alg . "&" . $id . "&" . $range . "\n";

	
	
} elsif (m/^http:\/\/www\.google-analytics\.com\/__utm\.gif\?.*/) {
	print $x . "http://www.google-analytics.com/__utm.gif\n";

			#Cache High Latency Ads
} elsif (m/^http:\/\/([a-z0-9.]*)(\.doubleclick\.net|\.quantserve\.com|\.googlesyndication\.com|yieldmanager|cpxinteractive)(.*)/) {
	$y = $3;$z = $2;
	for ($y) {
	s/pixel;.*/pixel/;
	s/activity;.*/activity/;
	s/(imgad[^&]*).*/\1/;
	s/;ord=[?0-9]*//;
	s/;&timestamp=[0-9]*//;
	s/[&?]correlator=[0-9]*//;
	s/&cookie=[^&]*//;
	s/&ga_hid=[^&]*//;
	s/&ga_vid=[^&]*//;
	s/&ga_sid=[^&]*//;
	# s/&prev_slotnames=[^&]*//
	# s/&u_his=[^&]*//;
	s/&dt=[^&]*//;
	s/&dtd=[^&]*//;
	s/&lmt=[^&]*//;
	s/(&alternate_ad_url=http%3A%2F%2F[^(%2F)]*)[^&]*/\1/;
	s/(&url=http%3A%2F%2F[^(%2F)]*)[^&]*/\1/;
	s/(&ref=http%3A%2F%2F[^(%2F)]*)[^&]*/\1/;
	s/(&cookie=http%3A%2F%2F[^(%2F)]*)[^&]*/\1/;
	s/[;&?]ord=[?0-9]*//;
	s/[;&]mpvid=[^&;]*//;
	s/&xpc=[^&]*//;
	# yieldmanager
	s/\?clickTag=[^&]*//;
	s/&u=[^&]*//;
	s/&slotname=[^&]*//;
	s/&page_slots=[^&]*//;
	}
	print $x . "http://" . $1 . $2 . $y . "\n";

			#cache high latency ads
} elsif (m/^http:\/\/(.*?)\/(ads)\?(.*?)/) {
	print $x . "http://" . $1 . "/" . $2  . "\n";

} elsif (m/^http:\/\/(www\.ziddu\.com.*\.[^\/]{3,4})\/(.*?)/) {
	print $x . "http://" . $1 . "\n";

			#cdn, varialble 1st path
} elsif (($u =~ /filehippo/) && (m/^http:\/\/(.*?)\.(.*?)\/(.*?)\/(.*)\.([a-z0-9]{3,4})(\?.*)?/)) {
	@y = ($1,$2,$4,$5);
	$y[0] =~ s/[a-z0-9]{2,5}/cdn./;
	print $x . "http://" . $y[0] . $y[1] . "/" . $y[2] . "." . $y[3] . "\n";

			#rapidshare
} elsif (($u =~ /rapidshare/) && (m/^http:\/\/(([A-Za-z]+[0-9-.]+)*?)([a-z]*\.[^\/]{3}\/[a-z]*\/[0-9]*)\/(.*?)\/([^\/\?\&]{4,})$/)) {
	print $x . "http://cdn." . $3 . "/SQUIDINTERNAL/" . $5 . "\n";

} elsif (($u =~ /maxporn/) && (m/^http:\/\/([^\/]*?)\/(.*?)\/([^\/]*?)(\?.*)?$/)) {
	print $x . "http://" . $1 . "/SQUIDINTERNAL/" . $3 . "\n";
	
			#domain/path/.*/path/filename
} elsif (($u =~ /fucktube/) && (m/^http:\/\/(.*?)(\.[^\.\-]*?[^\/]*\/[^\/]*)\/(.*)\/([^\/]*)\/([^\/\?\&]*)\.([^\/\?\&]{3,4})(\?.*?)$/)) {
	@y = ($1,$2,$4,$5,$6);
	$y[0] =~ s/(([a-zA-A]+[0-9]+(-[a-zA-Z])?$)|([^\.]*cdn[^\.]*)|([^\.]*cache[^\.]*))/cdn/;
	print $x . "http://" . $y[0] . $y[1] . "/" . $y[2] . "/" . $y[3] . "." . $y[4] . "\n";

			#like porn hub variables url and center part of the path, filename etention 3 or 4 with or without ? at the end
} elsif (($u =~ /tube8|pornhub|xvideos/) && (m/^http:\/\/(([A-Za-z]+[0-9-.]+)*?(\.[a-z]*)?)\.([a-z]*[0-9]?\.[^\/]{3}\/[a-z]*)(.*?)((\/[a-z]*)?(\/[^\/]*){4}\.[^\/\?]{3,4})(\?.*)?$/)) {
	print $x . "http://cdn." . $4 . $6 . "\n";

			#for yimg.com video
} elsif (m/^http:\/\/(.*yimg.com)\/\/(.*)\/([^\/\?\&]*\/[^\/\?\&]*\.[^\/\?\&]{3,4})(\?.*)?$/) {
	print $x . "http://cdn.yimg.com//" . $3 . "\n";
	
			#for yimg.com doubled
} elsif (m/^http:\/\/(.*?)\.yimg\.com\/(.*?)\.yimg\.com\/(.*?)\?(.*)/) {
	print $x . "http://cdn.yimg.com/"  . $3 . "\n";

			#for yimg.com with &sig=
} elsif (m/^http:\/\/([^\.]*)\.yimg\.com\/(.*)/) {
	@y = ($1,$2);
	$y[0] =~ s/[a-z]+([0-9]+)?/cdn/;
	$y[1] =~ s/&sig=.*//;
	print $x . "http://" . $y[0] . ".yimg.com/"  . $y[1] . "\n";
			
			#youjizz. We use only domain and filename
} elsif (($u =~ /media[0-9]{1,5}\.youjizz/) && (m/^http:\/\/(.*?)(\.[^\.\-]*?\.[^\/]*)\/(.*)\/([^\/\?\&]*)\.([^\/\?\&]{3,4})(\?.*?)$/)) {
	@y = ($1,$2,$4,$5);
	$y[0] =~ s/(([a-zA-A]+[0-9]+(-[a-zA-Z])?$)|([^\.]*cdn[^\.]*)|([^\.]*cache[^\.]*))/cdn/;
	print $x . "http://" . $y[0] . $y[1] . "/" . $y[2] . "." . $y[3] . "\n";

			#general purpose for cdn servers. add above your specific servers.
} elsif (m/^http:\/\/([0-9.]*?)\/\/(.*?)\.(.*)\?(.*?)/) {
	print $x . "http://squid-cdn-url//" . $2  . "." . $3 . "\n";

			# spicific extention
# } elsif (m/^http:\/\/(.*?)\.(jp(e?g|e|2)|gif|png|tiff?|bmp|ico|flv|wmv|3gp|mp(4|3)|exe|msi|zip|on2|mar|swf).*?/) {
	# @y = ($1,$2);
	# $y[0] =~ s/((cache|cdn)[-\d]*)|([a-zA-A]+-?[0-9]+(-[a-zA-Z]*)?)/cdn/;
	# print $x . "http://" . $y[0] . "." . $y[1] . "\n";

			#generic http://variable.domain.com/path/filename."ex", "ext" or "exte"
			#http://cdn1-28.projectplaylist.com
			#http://s1sdlod041.bcst.cdn.s1s.yimg.com
} elsif (m/^http:\/\/(.*?)(\.[^\.\-]*?\..*?)\/([^\?\&\=]*)\.([\w\d]{2,4})\??.*$/) {
	@y = ($1,$2,$3,$4);
	$y[0] =~ s/([a-z][0-9][a-z]dlod[\d]{3})|((cache|cdn)[-\d]*)|([a-zA-A]+-?[0-9]+(-[a-zA-Z]*)?)/cdn/;
	print $x . "storeurl://" . $y[0] . $y[1] . "/" . $y[2] . "." . $y[3] . "\n";

			# all that ends with ;
} elsif (m/^http:\/\/(.*?)\/(.*?)\;(.*)/) {
	print $x . "http://" . $1 . "/" . $2  . "\n";

} else {
	print $x . $_ . "\n";
}
}


same din sa gamit ko pati tetris ngcacache..^__^
sa ganitong script wala pa akong na encounter na issue sa YT..

Please Log in or Create an account to join the conversation.

Last edit: Post by kjshoot2ill.

Re: pfSense users 28 May 2012 22:28 #534248

  • obiwan0515's Avatar
  • obiwan0515
  • Online
  • Senior Boarder
  • Senior Boarder
  • Posts: 279
  • Thanks: 6

kjshoot2ill wrote:

#!/usr/bin/perl
# $Rev$
# by chudy_fernandez@yahoo.com
# Youtube updates at http://wiki.squid-cache.org/ConfigExamples/DynamicContent/YouTube/Discussion
$|=1;
while (<>) {
    @X = split;
#	$X[1] =~ s/&sig=.*//;
	$x = $X[0] . " ";
	$_ = $X[1];
	$u = $X[1];

			#photos-X.ak.fbcdn.net where X a-z
if (m/^http:\/\/photos-[a-z]?(.ak.fbcdn.net.*)/) {
	print $x . "http://photos" . $1  . "\n";

			#maps.google.com
} elsif (m/^http:\/\/(khm|mt)[0-9]?(.google.com.*)/) {
	print $x . "http://" . $1  . $2 . "\n";
	
		# all types of youtube videos
} elsif (m/^http:\/\/([0-9.]{4}|.*\.youtube\.com|.*\.googlevideo\.com|.*\.video\.google\.com)\/videoplayback\?(.*)/) {
	$p_str = $2;
	$tag = "";
	$alg = "";
	$id = "";
	$range = "";
	if ($p_str =~ m/(itag=[0-9]*)/){$tag = "&".$1}
	if ($p_str =~ m/(algorithm=[a-z]*\-[a-z]*)/){$alg = "&".$1}
	if ($p_str =~ m/(id=[a-zA-Z0-9]*)/){$id = "&".$1}
	if ($p_str =~ m/(range=[0-9\-]*)/){$range = "&".$1; $range =~ s/-//; $range =~ s/range=//; }
	print $x . "video-srv.youtube.com.SQUIDINTERNAL/" . $tag . "&" . $alg . "&" . $id . "&" . $range . "\n";

	
	
} elsif (m/^http:\/\/www\.google-analytics\.com\/__utm\.gif\?.*/) {
	print $x . "http://www.google-analytics.com/__utm.gif\n";

			#Cache High Latency Ads
} elsif (m/^http:\/\/([a-z0-9.]*)(\.doubleclick\.net|\.quantserve\.com|\.googlesyndication\.com|yieldmanager|cpxinteractive)(.*)/) {
	$y = $3;$z = $2;
	for ($y) {
	s/pixel;.*/pixel/;
	s/activity;.*/activity/;
	s/(imgad[^&]*).*/\1/;
	s/;ord=[?0-9]*//;
	s/;&timestamp=[0-9]*//;
	s/[&?]correlator=[0-9]*//;
	s/&cookie=[^&]*//;
	s/&ga_hid=[^&]*//;
	s/&ga_vid=[^&]*//;
	s/&ga_sid=[^&]*//;
	# s/&prev_slotnames=[^&]*//
	# s/&u_his=[^&]*//;
	s/&dt=[^&]*//;
	s/&dtd=[^&]*//;
	s/&lmt=[^&]*//;
	s/(&alternate_ad_url=http%3A%2F%2F[^(%2F)]*)[^&]*/\1/;
	s/(&url=http%3A%2F%2F[^(%2F)]*)[^&]*/\1/;
	s/(&ref=http%3A%2F%2F[^(%2F)]*)[^&]*/\1/;
	s/(&cookie=http%3A%2F%2F[^(%2F)]*)[^&]*/\1/;
	s/[;&?]ord=[?0-9]*//;
	s/[;&]mpvid=[^&;]*//;
	s/&xpc=[^&]*//;
	# yieldmanager
	s/\?clickTag=[^&]*//;
	s/&u=[^&]*//;
	s/&slotname=[^&]*//;
	s/&page_slots=[^&]*//;
	}
	print $x . "http://" . $1 . $2 . $y . "\n";

			#cache high latency ads
} elsif (m/^http:\/\/(.*?)\/(ads)\?(.*?)/) {
	print $x . "http://" . $1 . "/" . $2  . "\n";

} elsif (m/^http:\/\/(www\.ziddu\.com.*\.[^\/]{3,4})\/(.*?)/) {
	print $x . "http://" . $1 . "\n";

			#cdn, varialble 1st path
} elsif (($u =~ /filehippo/) && (m/^http:\/\/(.*?)\.(.*?)\/(.*?)\/(.*)\.([a-z0-9]{3,4})(\?.*)?/)) {
	@y = ($1,$2,$4,$5);
	$y[0] =~ s/[a-z0-9]{2,5}/cdn./;
	print $x . "http://" . $y[0] . $y[1] . "/" . $y[2] . "." . $y[3] . "\n";

			#rapidshare
} elsif (($u =~ /rapidshare/) && (m/^http:\/\/(([A-Za-z]+[0-9-.]+)*?)([a-z]*\.[^\/]{3}\/[a-z]*\/[0-9]*)\/(.*?)\/([^\/\?\&]{4,})$/)) {
	print $x . "http://cdn." . $3 . "/SQUIDINTERNAL/" . $5 . "\n";

} elsif (($u =~ /maxporn/) && (m/^http:\/\/([^\/]*?)\/(.*?)\/([^\/]*?)(\?.*)?$/)) {
	print $x . "http://" . $1 . "/SQUIDINTERNAL/" . $3 . "\n";
	
			#domain/path/.*/path/filename
} elsif (($u =~ /fucktube/) && (m/^http:\/\/(.*?)(\.[^\.\-]*?[^\/]*\/[^\/]*)\/(.*)\/([^\/]*)\/([^\/\?\&]*)\.([^\/\?\&]{3,4})(\?.*?)$/)) {
	@y = ($1,$2,$4,$5,$6);
	$y[0] =~ s/(([a-zA-A]+[0-9]+(-[a-zA-Z])?$)|([^\.]*cdn[^\.]*)|([^\.]*cache[^\.]*))/cdn/;
	print $x . "http://" . $y[0] . $y[1] . "/" . $y[2] . "/" . $y[3] . "." . $y[4] . "\n";

			#like porn hub variables url and center part of the path, filename etention 3 or 4 with or without ? at the end
} elsif (($u =~ /tube8|pornhub|xvideos/) && (m/^http:\/\/(([A-Za-z]+[0-9-.]+)*?(\.[a-z]*)?)\.([a-z]*[0-9]?\.[^\/]{3}\/[a-z]*)(.*?)((\/[a-z]*)?(\/[^\/]*){4}\.[^\/\?]{3,4})(\?.*)?$/)) {
	print $x . "http://cdn." . $4 . $6 . "\n";

			#for yimg.com video
} elsif (m/^http:\/\/(.*yimg.com)\/\/(.*)\/([^\/\?\&]*\/[^\/\?\&]*\.[^\/\?\&]{3,4})(\?.*)?$/) {
	print $x . "http://cdn.yimg.com//" . $3 . "\n";
	
			#for yimg.com doubled
} elsif (m/^http:\/\/(.*?)\.yimg\.com\/(.*?)\.yimg\.com\/(.*?)\?(.*)/) {
	print $x . "http://cdn.yimg.com/"  . $3 . "\n";

			#for yimg.com with &sig=
} elsif (m/^http:\/\/([^\.]*)\.yimg\.com\/(.*)/) {
	@y = ($1,$2);
	$y[0] =~ s/[a-z]+([0-9]+)?/cdn/;
	$y[1] =~ s/&sig=.*//;
	print $x . "http://" . $y[0] . ".yimg.com/"  . $y[1] . "\n";
			
			#youjizz. We use only domain and filename
} elsif (($u =~ /media[0-9]{1,5}\.youjizz/) && (m/^http:\/\/(.*?)(\.[^\.\-]*?\.[^\/]*)\/(.*)\/([^\/\?\&]*)\.([^\/\?\&]{3,4})(\?.*?)$/)) {
	@y = ($1,$2,$4,$5);
	$y[0] =~ s/(([a-zA-A]+[0-9]+(-[a-zA-Z])?$)|([^\.]*cdn[^\.]*)|([^\.]*cache[^\.]*))/cdn/;
	print $x . "http://" . $y[0] . $y[1] . "/" . $y[2] . "." . $y[3] . "\n";

			#general purpose for cdn servers. add above your specific servers.
} elsif (m/^http:\/\/([0-9.]*?)\/\/(.*?)\.(.*)\?(.*?)/) {
	print $x . "http://squid-cdn-url//" . $2  . "." . $3 . "\n";

			# spicific extention
# } elsif (m/^http:\/\/(.*?)\.(jp(e?g|e|2)|gif|png|tiff?|bmp|ico|flv|wmv|3gp|mp(4|3)|exe|msi|zip|on2|mar|swf).*?/) {
	# @y = ($1,$2);
	# $y[0] =~ s/((cache|cdn)[-\d]*)|([a-zA-A]+-?[0-9]+(-[a-zA-Z]*)?)/cdn/;
	# print $x . "http://" . $y[0] . "." . $y[1] . "\n";

			#generic http://variable.domain.com/path/filename."ex", "ext" or "exte"
			#http://cdn1-28.projectplaylist.com
			#http://s1sdlod041.bcst.cdn.s1s.yimg.com
} elsif (m/^http:\/\/(.*?)(\.[^\.\-]*?\..*?)\/([^\?\&\=]*)\.([\w\d]{2,4})\??.*$/) {
	@y = ($1,$2,$3,$4);
	$y[0] =~ s/([a-z][0-9][a-z]dlod[\d]{3})|((cache|cdn)[-\d]*)|([a-zA-A]+-?[0-9]+(-[a-zA-Z]*)?)/cdn/;
	print $x . "storeurl://" . $y[0] . $y[1] . "/" . $y[2] . "." . $y[3] . "\n";

			# all that ends with ;
} elsif (m/^http:\/\/(.*?)\/(.*?)\;(.*)/) {
	print $x . "http://" . $1 . "/" . $2  . "\n";

} else {
	print $x . $_ . "\n";
}
}


same din sa gamit ko pati tetris ngcacache..^__^
sa ganitong script wala pa akong na encounter na issue sa YT..



ayos master!

Please Log in or Create an account to join the conversation.

Moderators: Itwarehouse Speclin
Time to create page: 0.179 seconds