Comment on YouTubeAprilFix in lusca-cache

23 views
Skip to first unread message

codesite...@google.com

unread,
Jun 1, 2013, 12:59:11 PM6/1/13
to lusc...@googlegroups.com
Comment by aspansya...@gmail.com:

Needs better step explanation about this case.
Steps:
1- Create listening server port 8888
2- in request part
a- select the generate_204? url
b- get the referer request.headers.referer
get the v=(.*) from the
c- get the id=(.*)&itag=(.*)
var myquerystring=url.parse(request.url,true).query;
3- create a file named id that contains the referer header v=(.*)
in directory called /data/YouTube/hacked/$id
and put inside the file the value of the referer header
4- update store_url_rewrite as follows

if( $QS =~ m/id=([a-z0-9A-Z\-\_]+)/ ){ $ID="&id=$1"; $ScalarID="$1";}
$FILE='/data/YouTube/hacked/'.$ScalarID;
if ( -e $FILE ) {
local $/=undef;
open FILE,$FILE;
$CONTENT=<FILE>;
close FILE;
}else {
$CONTENT=$ID;
}
5- finally set your batch file to run endlessly in the background and
point squid-cache to use url_regex
(http://(.*)\.youtube.com/generate_204\?(.*)?&id=([0-9a-zA-Z\-\_]+)(.*)?)
acl parent proxy 127.0.0.1 port 8888

6- Happy Caching

For more information:
http://code.google.com/p/lusca-cache/wiki/YouTubeAprilFix
Reply all
Reply to author
Forward
0 new messages