Advertisement
albspirit86

storeid.pl

Jun 2nd, 2014
834
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.51 KB | None | 0 0
  1. #!/usr/bin/perl
  2. # ISI DARI STORE-ID DIBAWAH INI DARI SHUDY
  3. # SHUDYLAH BERBAGI ILMU :3
  4. # ucok_karnadi(at)yahoo.com or https://twitter.com/syaifuddin_jw
  5.  
  6. # send link from youtube contain >> (ptracking|stream_204|player_204|gen_204) to storeurl
  7.  
  8.  
  9. $|=1;
  10. while (<>) {
  11. @X = split;
  12.  
  13. if ( $X[0] =~ m/^http\:\/\/.*/) {
  14. $x = $X[0];
  15. $_ = $X[0];
  16. $u = $X[0];
  17. } else {
  18. $x = $X[1];
  19. $_ = $X[1];
  20. $u = $X[1];
  21. }
  22.  
  23. if ($x =~ m/^http(|s)\:\/\/.*youtube.*(ptracking|stream_204|player_204|gen_204).*(video_id|docid|v)\=([^\&\s]*).*/){
  24. $vid = $4 ;
  25. @cpn = m/[&?]cpn\=([^\&\s]*)/;
  26. $fn = "/var/log/squid/@cpn";
  27. unless (-e $fn) {
  28. open FH,">".$fn ;
  29. print FH "$vid\n";
  30. close FH;
  31. }
  32. $out = $x . "\n";
  33.  
  34. } elsif ($x =~ m/^http:\/\/.*(youtube|google).*videoplayback.*/){
  35. @itag = m/[&?](itag=[0-9]*)/;
  36. @ids = m/[&?]id\=([^\&\s]*)/;
  37. @mime = m/[&?](mime\=[^\&\s]*)/;
  38. @cpn = m/[&?]cpn\=([^\&\s]*)/;
  39. $fn = "/var/log/squid/@cpn";
  40. if (-e $fn) {
  41. open FH,"<".$fn ;
  42. $id = <FH>;
  43. chomp $id ;
  44. close FH ;
  45. } else {
  46. $id = $ids[0] ;
  47. }
  48. @range = m/[&?](range=[^\&\s]*)/;
  49. $out = "http://video-srv.youtube/id=" . $id . "&@itag@range@mime";
  50.  
  51. } elsif ($x =~ m/^http:\/\/.*(profile|photo|creative).*\.ak\.fbcdn\.net\/((h|)(profile|photos)-ak-)(snc|ash|prn)[0-9]?(.*)/) {
  52. $out="http://fbcdn.net.squid.internal/" . $2 . "fb" . $6 ;
  53.  
  54. # ytimg PENAMBAHAN
  55. } elsif ($x =~ m/^https?:\/\/i[1-4]\.ytimg\.com\/(.*)/) {
  56. $out="http://ytimg.com.squid.internal/" . $1 ;
  57.  
  58. } elsif ($x =~ m/^http:\/\/.*\.dl\.sourceforge\.net\/(.*)/) {
  59. $out="http://dl.sourceforge.net.squid.internal/" . $1 ;
  60. # chrome
  61. } elsif ($x =~ m/^http:\/\/.*\.google\.com\/.*\/.*\/.*\/.*\/(.*\.exe)/) {
  62. $out="http://chrome.squid.internal/" . $1 ;
  63.  
  64. #Speedtest
  65. } elsif ($x =~ m/^http\:\/\/.*\/speedtest\/(.*\.(jpg|txt)).*/) {
  66. $out="http://speedtest.squid.internal/" . $1 ;
  67.  
  68. #reverbnation
  69. } elsif (m/^http:\/\/[a-z0-9]{4}\.reverbnation\.com\/.*\/([0-9]*).*/) {
  70. $out="http://reverbnation.com.squid.internal/" . "$1" . "\n";
  71.  
  72. # reverbnation
  73. } elsif ($X[1] =~ m/^http:\/\/c2lo\.reverbnation\.com\/audio_player\/ec_stream_song\/(.*)\?.*/) {
  74. $out="http://reverbnation.squid.internal/" . $1 . "\n";
  75.  
  76. # 4shared preview dan download
  77. } elsif ($X[1] =~ m/^http:\/\/.*dlink__[23]Fdownload_[23]F([\w\d-]+)_3Ftsid.*/) {
  78. $1 =~ s/_5F/_/g;
  79. $out="http://4shared.squid.internal/" . $1 . "\n";
  80.  
  81. } elsif (m/^http\:\/\/.*\.4shared\.com\/download\/(.*)\/.*/) {
  82. $out="http://4shared.squid.internal/" . $1 . "\n";
  83.  
  84. #BLOGSPOT
  85. } elsif ($x =~ m/^http:\/\/[1-4]\.bp\.(blogspot\.com.*)/) {
  86. $out="http://blog-cdn." . $1 ;
  87.  
  88. #AVAST
  89. } elsif ($x =~ m/^http:\/\/download[0-9]{3}.(avast.com.*)/) {
  90. $out="http://avast-cdn." . $1 ;
  91.  
  92. #AVAST
  93. } elsif ($x =~ m/^http:\/\/[0-9]*\.[0-9]*\.[0-9]*\.[0-9]*\/(iavs.*)/) {
  94. $out="http://avast-cdn.avast.com/" . $1 ;
  95.  
  96. #KAV
  97. } elsif ($x =~ m/^http:\/\/dnl-[0-9]{2}.(geo.kaspersky.com.*)/) {
  98. $out="http://kav-cdn." . $1 ;
  99.  
  100. #AVG
  101. } elsif ($x =~ m/^http:\/\/update.avg.com/) {
  102. $out="http://avg-cdn." . $1 ;
  103.  
  104. #maps.google.com
  105. } elsif ($x =~ m/^http:\/\/(cbk|mt|khm|mlt|tbn)[0-9]?(.google\.co(m|\.uk|\.id).*)/) {
  106. $out="http://" . $1 . $2 ;
  107.  
  108. #gstatic and/or wikimapia
  109. } elsif ($x =~ m/^http:\/\/([a-z])[0-9]?(\.gstatic\.com.*|\.wikimapia\.org.*)/) {
  110. $out="http://" . $1 . $2 ;
  111.  
  112. #maps.google.com
  113. } elsif ($x =~ m/^http:\/\/(khm|mt)[0-9]?(.google.com.*)/) {
  114. $out="http://" . $1 . $2 ;
  115.  
  116. #Google
  117. } elsif ($x =~ m/^http:\/\/www\.google-analytics\.com\/__utm\.gif\?.*/) {
  118. $out="http://www.google-analytics.com/__utm.gif\n";
  119.  
  120. } elsif ($x =~ m/^http:\/\/(www\.ziddu\.com.*\.[^\/]{3,4})\/(.*?)/) {
  121. $out="http://" . $1 ;
  122.  
  123. #cdn, varialble 1st path
  124. } elsif (($x =~ /filehippo/) && (m/^https?:\/\/(.*?)\.(.*?)\/(.*?)\/(.*)\.([a-z0-9]{3,4})(\?.*)?/)) {
  125. @y = ($1,$2,$4,$5);
  126. $y[0] =~ s/[a-z0-9]{2,5}/cdn./;
  127. $out="http://" . $y[0] . $y[1] . "/" . $y[2] . "." . $y[3] ;
  128.  
  129. #rapidshare
  130. } elsif (($x =~ /rapidshare/) && (m/^http:\/\/(([A-Za-z]+[0-9-.]+)*?)([a-z]*\.[^\/]{3}\/[a-z]*\/[0-9]*)\/(.*?)\/([^\/\?\&]{4,})$/)) {
  131. $out="http://cdn." . $3 . "/squid.internal/" . $5 ;
  132.  
  133. # for yimg.com video
  134. } elsif (m/^http:\/\/(.*yimg.com)\/\/(.*)\/([^\/\?\&]*\/[^\/\?\&]*\.[^\/\?\&]{3,4})(\?.*)?$/) {
  135. print $x . "http://cdn.yimg.com//" . $3 . "\n";
  136.  
  137. # for yimg.com doubled
  138. } elsif (m/^http:\/\/(.*?)\.yimg\.com\/(.*?)\.yimg\.com\/(.*?)\?(.*)/) {
  139. print $x . "http://cdn.yimg.com/" . $3 . "\n";
  140.  
  141. # for yimg.com with &sig=
  142. } elsif (m/^http:\/\/(.*?)\.yimg\.com\/(.*)/) {
  143. @y = ($1,$2);
  144. $y[0] =~ s/[a-z]+([0-9]+)/cdn/;
  145. $y[1] =~ s/&sig=.*//;
  146. print $x . "http://" . $y[0] . ".yimg.com/" . $y[1] . "\n";
  147.  
  148.  
  149. } else {
  150. $out=$x;
  151.  
  152. }
  153. if ( $X[0] =~ m/^http\:\/\/.*/) {
  154. print "OK store-id=$out\n" ;
  155. } else {
  156. print $X[0] . " OK store-id=$out\n" ;
  157. }
  158. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement