Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/perl
- # ISI DARI STORE-ID DIBAWAH INI DARI SHUDY
- # SHUDYLAH BERBAGI ILMU :3
- # ucok_karnadi(at)yahoo.com or https://twitter.com/syaifuddin_jw
- # send link from youtube contain >> (ptracking|stream_204|player_204|gen_204) to storeurl
- $|=1;
- while (<>) {
- @X = split;
- if ( $X[0] =~ m/^http\:\/\/.*/) {
- $x = $X[0];
- $_ = $X[0];
- $u = $X[0];
- } else {
- $x = $X[1];
- $_ = $X[1];
- $u = $X[1];
- }
- if ($x =~ m/^http(|s)\:\/\/.*youtube.*(ptracking|stream_204|player_204|gen_204).*(video_id|docid|v)\=([^\&\s]*).*/){
- $vid = $4 ;
- @cpn = m/[&?]cpn\=([^\&\s]*)/;
- $fn = "/var/log/squid/@cpn";
- unless (-e $fn) {
- open FH,">".$fn ;
- print FH "$vid\n";
- close FH;
- }
- $out = $x ;
- } elsif ($x =~ m/^http(|s)\:\/\/.*(youtube|google).*videoplayback.*/){
- @itag = m/[&?](itag=[0-9]*)/;
- @ids = m/[&?]id\=([^\&\s]*)/;
- @mime = m/[&?](mime\=[^\&\s]*)/;
- @cpn = m/[&?]cpn\=([^\&\s]*)/;
- $fn = "/var/log/squid/@cpn";
- if (-e $fn) {
- open FH,"<".$fn ;
- $id = <FH>;
- chomp $id ;
- close FH ;
- } else {
- $id = $ids[0] ;
- }
- @range = m/[&?](range=[^\&\s]*)/;
- $out = "http://video-srv.youtube.com.SQUIDINTERNAL/id=" . $id . "&@itag@range@mime";
- #} ### tambahan baru
- } elsif ($x=~ m/^https:\/\/fbcdn-s?(photos|profile|creative|vthumb|dragon).*akamaihd.net\/(h(photos|profile|ads|vthumb)-ak-(xpa|xfp|xap|xpf|xfa|xfa|prn|xaf|prn|ash|frc)[0-9])\/.*\/(.*)\/(.*)/) {
- $out="http://akamaihd.squid.internal/" . $5 . $6 . "\n";
- } elsif ($x=~ m/^https:\/\/fbexternal-a.akamaihd.net\/safe_image.php\?[a-zA-Z0-9\&\=].+%2F(.*\.(jpe?g|png))&.*/) {
- $out="http://akamaihd.squid.internal/" . $1 ;
- } elsif ($x=~ m/^https:\/\/fbexternal-a.akamaihd.net\/.*php\?[a-zA-Z0-9\&\=].+%2F(.*ashx).[a-z0-9](.*)/) {
- $out="http://akamaihd.squid.internal/" . $1 ;
- } elsif ($x =~ m/^https:\/\/scontent.*\.xx.fbcdn.net\/h(photos|profile|ads)-(xpa|xfp|xap|xpf|xfa|xfa|prn|xaf|prn|ash|frc)[0-9]\/.*\/(.*)\/(.*)/) {
- $out="http://fbcdn.net.squid.internal/" . $3 . $4 . "\n";
- } elsif ($x =~ m/^https:\/\/www.facebook.com\/images\/profile\/.*\/.*\/(.*)/) {
- $out="http://www.facebook.com.squid.internal/" . $1;
- } elsif ($x =~ m/^https:\/\/fbstatic-a.akamaihd.net\/rsrc.php\/.*\/(.*)/) {
- $out="http://fbstatic-a.akamaihd.net.squid.internal/" . $1;
- } elsif ($x =~ m/^https:\/\/(scontent|fbcdn).*\/hvideo.*(xpa|xfp|xap|xpf|xfa|xfa|prn|xaf|prn|ash|frc)[0-9]\/v\/.*\/(.*\mp4)/) {
- $out="http://fbcdn.akamaihd.net.squid.internal/" . $3;
- } elsif ($x =~ m/^https?:\/\/(attachment.fbsbx.com)\/(file_download.php\?id=([\d]+).*)/) {
- $out="http://fbsbx.squid.internal/" . $3 ;
- } elsif ($x =~ m/^https:\/\/www.facebook.com\/.*php\?fbid=(.*)&set=.*[a-z0-9]/) {
- $out="http://www.facebook.com.internal/" . $1 ;
- } elsif ($x =~ m/^http:\/\/[\d\w\-]+\.c\.pack\.google\.com\/.*\/(.*?\.exe)\?.*/) {
- $out="http://googlechrome.squid.internal/" . $1 ;
- } elsif ($x =~ m/^http:\/\/[\d\w\-]+\.c\.pack\.google\.com\/.*\/.*\/(.*?\.crx)\?.*/) {
- $out="http://googlechrome.squid.internal/" . $1 ;
- } elsif ($x =~ m/^http:\/\/i[1-4]\.ytimg\.com\/(.*)/) {
- $out="http://ytimg.com.squid.internal/" . $1 ;
- } elsif ($x =~ m/^http:\/\/.*\.dl\.sourceforge\.net\/(.*)/) {
- $out="http://dl.sourceforge.net.squid.internal/" . $1 ;
- #Speedtest
- } elsif ($x =~ m/^http\:\/\/.*\/speedtest\/(.*\.(jpg|txt)).*/) {
- $out="http://speedtest.squid.internal/" . $1 ;
- #reverbnation
- } elsif ($x =~ m/^http:\/\/c2lo\.(reverbnation)\.com\/(audio)_player\/.*\/(.*)[\/\?]/) {
- $out = "http://reverbnation.squid.internal/" . $1 . "/" . $2 . "/" . $3 ;
- #BLOGSPOT
- } elsif ($x =~ m/^http:\/\/[1-4]\.bp\.(blogspot\.com.*)/) {
- $out="http://blog-cdn." . $1 ;
- #AVAST
- } elsif ($x =~ m/^http:\/\/download[0-9]{3}.(avast.com.*)/) {
- $out="http://avast-cdn." . $1 ;
- #AVAST
- } elsif ($x =~ m/^http:\/\/[0-9]*\.[0-9]*\.[0-9]*\.[0-9]*\/(iavs.*)/) {
- $out="http://avast-cdn.avast.com/" . $1 ;
- #KAV
- } elsif ($x =~ m/^http:\/\/dnl-[0-9]{2}.(geo.kaspersky.com.*)/) {
- $out="http://kav-cdn." . $1 ;
- #AVG
- } elsif ($x =~ m/^http:\/\/update.avg.com/) {
- $out="http://avg-cdn." . $1 ;
- #maps.google.com
- } elsif ($x =~ m/^http:\/\/(cbk|mt|kh|mlt|tbn)[0-9]?(.google\.co(m|\.uk|\.id).*)/) {
- $out="http://" . $1 . $2 ;
- #maps.google.com
- } elsif ($x =~ m/^http:\/\/(kh|mt)[0-9]?(.google.com.*)/) {
- $out="http://" . $1 . $2 ;
- #Google
- } elsif ($x =~ m/^http:\/\/(.*\.google-analytics\.com)\/(__utm\.gif)\?.*/) {
- $out="http://google-analytics.com.squid.internal/" . $1 . $2 ;
- } elsif ($x =~ m/^http:\/\/(www\.ziddu\.com.*\.[^\/]{3,4})\/(.*?)/) {
- $out="http://" . $1 ;
- #cdn, varialble 1st path
- } elsif (($x =~ /filehippo/) && (m/^http:\/\/(.*?)\.(.*?)\/(.*?)\/(.*)\.([a-z0-9]{3,4})(\?.*)?/)) {
- @y = ($1,$2,$4,$5);
- $y[0] =~ s/[a-z0-9]{2,5}/cdn./;
- $out="http://" . $y[0] . $y[1] . "/" . $y[2] . "." . $y[3] ;
- #rapidshare
- } elsif (($x =~ /rapidshare/) && (m/^http:\/\/(([A-Za-z]+[0-9-.]+)*?)([a-z]*\.[^\/]{3}\/[a-z]*\/[0-9]*)\/(.*?)\/([^\/\?\&]{4,})$/)) {
- $out="http://cdn." . $3 . "/squid.internal/" . $5 ;
- #domain/path/.*/path/filename
- } elsif (($X[1] =~ /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/;
- $out="http://" . $y[0] . $y[1] . "/" . $y[2] . "/" . $y[3] . "." . $y[4] ;
- #youjizz. We use only domain and filename
- } elsif (($X[1] =~ /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/;
- $out="http://" . $y[0] . $y[1] . "/" . $y[2] . "." . $y[3] ;
- #general purpose for cdn servers. add above your specific servers.
- #} elsif (m/^http:\/\/([0-9.]*?)\/\/(.*?)\.(.*)\?(.*?)/) {
- #$out="http://squid-cdn-url/" . $2 . "." . $3 ;
- #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/;
- $out="http://" . $y[0] . $y[1] . "/" . $y[2] . "." . $y[3] ;
- #for yimg.com video
- } elsif ($x =~ m/^http:\/\/(.*yimg.com)\/\/(.*)\/([^\/\?\&]*\/[^\/\?\&]*\.[^\/\?\&]{3,4})(\?.*)?$/) {
- $out="http://cdn.yimg.com/" . $3 ;
- #for yimg.com doubled
- } elsif ($x =~ m/^http:\/\/(.*?)\.yimg\.com\/(.*?)\.yimg\.com\/(.*?)\?(.*)/) {
- $out="http://cdn.yimg.com/" . $3 ;
- #for yimg.com with &sig=
- } elsif ($x =~ m/^http:\/\/([^\.]*)\.yimg\.com\/(.*)/) {
- @y = ($1,$2);
- $y[0] =~ s/[a-z]+([0-9]+)?/cdn/;
- $y[1] =~ s/&sig=.*//;
- $out="http://" . $y[0] . ".yimg.com/" . $y[1] ;
- # all that ends with ;
- } elsif (m/^http:\/\/(.*?)\/(.*?)\;(.*)/) {
- $out="http://" . $1 . "/" . $2 ;
- } else {
- $out=$x;
- }
- if ( $X[0] =~ m/^http\:\/\/.*/) {
- print "OK store-id=$out\n" ;
- } else {
- print $X[0] . " OK store-id=$out\n" ;
- }
- }
- ###########################
- ##########################
- #!/usr/bin/perl
- $|=1;
- while (<>) {
- @X = split;
- if ( $X[0] =~ m/^http\:\/\/.*/) {
- $x = $X[0];
- $_ = $X[0];
- $u = $X[0];
- } else {
- $x = $X[1];
- $_ = $X[1];
- }
- ############################################################################################################################
- #sourceforge
- if ($x =~ m/^http:\/\/[^\.]+\.dl\.sourceforge\.net\/(.*)/) {
- $out="http://dl.sourceforge.net.squid.internal/$1";
- } elsif ($x =~ m/^http:\/\/.*\.gemscool.com\/dragonnest\/.*\/(.*.pak)/) {
- $out="http://dragonnest.com.squid.internal/$1";
- #reverbnation
- } elsif (sx =~ m/^http:\/\/[a-z0-9]{4}\.reverbnation\.com\/.*\/([0-9]*).*/) {
- $out="http://reverbnation.com.squid.internal/$1";
- # reverbnation
- } elsif (sx =~ m/^http:\/\/c2lo\.reverbnation\.com\/audio_player\/ec_stream_song\/(.*)\?.*/) {
- $out="http://reverbnation.squid.internal/$1";
- ###############################################
- #filehippo
- } elsif ($x =~ m/^http:\/\/.*filehippo.com\/.*\/(.*(exe|zip|7z|cab|msi|mru|mri|bz2|gzip|tgz|rar|pdf))/) {
- $out="http://filehippo.com.squid.internal/$1";
- #filehippo
- } elsif ($x =~ m/^http:\/\/.*videos.videobash.com\/(.*.mp4).*/) {
- $out="http://videobash.com.squid.internal/$1";
- #android
- } elsif ($x =~ m/^http:\/\/.*\.c\.android\.clients\.google\.com\/market\/GetBinary\/GetBinary\/(.*)\?/) {
- $out="http://android.googleplay.com.squid.internal/$1";
- #######################################################
- } elsif ($x =~ m/^http(|s)\:\/\/.*youtube.*(ptracking|stream_204|player_204|gen_204).*(video_id|docid|v)\=([^\&\s]*).*/){
- $vid = $4 ;
- @cpn = m/[&?]cpn\=([^\&\s]*)/;
- $fn = "/var/log/squid/@cpn";
- unless (-e $fn) {
- open FH,">".$fn ;
- print FH "$vid\n";
- close FH;
- }
- $out="ERR";
- } elsif ($x =~ m/^http(|s)\:\/\/.*(youtube|google).*videoplayback.*/){
- @itag = m/[&?](itag=[0-9]*)/;
- @ids = m/[&?]id\=([^\&\s]*)/;
- @mime = m/[&?](mime\=[^\&\s]*)/;
- @cpn = m/[&?]cpn\=([^\&\s]*)/;
- $fn = "/var/log/squid/@cpn";
- if (-e $fn) {
- open FH,"<".$fn ;
- $id = <FH>;
- chomp $id ;
- close FH ;
- } else {
- $id = $ids[0] ;
- }
- @range = m/[&?](range=[^\&\s]*)/;
- $out = "http://video-srv.youtube.com.squid.internal/id=" . $id . "&@itag@range@mime";
- ##########################################################################################################################
- } else {
- $out="ERR";
- }
- if ( $out =~ m/^http\:\/\/.*/) {
- print "OK store-id=$out\n" ;
- } else {
- print "ERR\n" ;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement