Advertisement
albspirit86

test storeid

Oct 7th, 2014
454
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.93 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 ;
  33.  
  34. } elsif ($x =~ m/^http(|s)\:\/\/.*(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.com.SQUIDINTERNAL/id=" . $id . "&@itag@range@mime";
  50.  
  51.  
  52.  
  53. #} ### tambahan baru
  54. } 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])\/.*\/(.*)\/(.*)/) {
  55. $out="http://akamaihd.squid.internal/" . $5 . $6 . "\n";
  56.  
  57. } elsif ($x=~ m/^https:\/\/fbexternal-a.akamaihd.net\/safe_image.php\?[a-zA-Z0-9\&\=].+%2F(.*\.(jpe?g|png))&.*/) {
  58. $out="http://akamaihd.squid.internal/" . $1 ;
  59.  
  60. } elsif ($x=~ m/^https:\/\/fbexternal-a.akamaihd.net\/.*php\?[a-zA-Z0-9\&\=].+%2F(.*ashx).[a-z0-9](.*)/) {
  61. $out="http://akamaihd.squid.internal/" . $1 ;
  62.  
  63. } 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]\/.*\/(.*)\/(.*)/) {
  64. $out="http://fbcdn.net.squid.internal/" . $3 . $4 . "\n";
  65.  
  66. } elsif ($x =~ m/^https:\/\/www.facebook.com\/images\/profile\/.*\/.*\/(.*)/) {
  67. $out="http://www.facebook.com.squid.internal/" . $1;
  68.  
  69. } elsif ($x =~ m/^https:\/\/fbstatic-a.akamaihd.net\/rsrc.php\/.*\/(.*)/) {
  70. $out="http://fbstatic-a.akamaihd.net.squid.internal/" . $1;
  71.  
  72. } elsif ($x =~ m/^https:\/\/(scontent|fbcdn).*\/hvideo.*(xpa|xfp|xap|xpf|xfa|xfa|prn|xaf|prn|ash|frc)[0-9]\/v\/.*\/(.*\mp4)/) {
  73. $out="http://fbcdn.akamaihd.net.squid.internal/" . $3;
  74.  
  75. } elsif ($x =~ m/^https?:\/\/(attachment.fbsbx.com)\/(file_download.php\?id=([\d]+).*)/) {
  76. $out="http://fbsbx.squid.internal/" . $3 ;
  77.  
  78. } elsif ($x =~ m/^https:\/\/www.facebook.com\/.*php\?fbid=(.*)&set=.*[a-z0-9]/) {
  79. $out="http://www.facebook.com.internal/" . $1 ;
  80.  
  81.  
  82.  
  83. } elsif ($x =~ m/^http:\/\/[\d\w\-]+\.c\.pack\.google\.com\/.*\/(.*?\.exe)\?.*/) {
  84. $out="http://googlechrome.squid.internal/" . $1 ;
  85.  
  86. } elsif ($x =~ m/^http:\/\/[\d\w\-]+\.c\.pack\.google\.com\/.*\/.*\/(.*?\.crx)\?.*/) {
  87. $out="http://googlechrome.squid.internal/" . $1 ;
  88.  
  89.  
  90. } elsif ($x =~ m/^http:\/\/i[1-4]\.ytimg\.com\/(.*)/) {
  91. $out="http://ytimg.com.squid.internal/" . $1 ;
  92.  
  93. } elsif ($x =~ m/^http:\/\/.*\.dl\.sourceforge\.net\/(.*)/) {
  94. $out="http://dl.sourceforge.net.squid.internal/" . $1 ;
  95.  
  96. #Speedtest
  97. } elsif ($x =~ m/^http\:\/\/.*\/speedtest\/(.*\.(jpg|txt)).*/) {
  98. $out="http://speedtest.squid.internal/" . $1 ;
  99.  
  100. #reverbnation
  101. } elsif ($x =~ m/^http:\/\/c2lo\.(reverbnation)\.com\/(audio)_player\/.*\/(.*)[\/\?]/) {
  102. $out = "http://reverbnation.squid.internal/" . $1 . "/" . $2 . "/" . $3 ;
  103.  
  104.  
  105. #BLOGSPOT
  106. } elsif ($x =~ m/^http:\/\/[1-4]\.bp\.(blogspot\.com.*)/) {
  107. $out="http://blog-cdn." . $1 ;
  108.  
  109. #AVAST
  110. } elsif ($x =~ m/^http:\/\/download[0-9]{3}.(avast.com.*)/) {
  111. $out="http://avast-cdn." . $1 ;
  112.  
  113. #AVAST
  114. } elsif ($x =~ m/^http:\/\/[0-9]*\.[0-9]*\.[0-9]*\.[0-9]*\/(iavs.*)/) {
  115. $out="http://avast-cdn.avast.com/" . $1 ;
  116.  
  117. #KAV
  118. } elsif ($x =~ m/^http:\/\/dnl-[0-9]{2}.(geo.kaspersky.com.*)/) {
  119. $out="http://kav-cdn." . $1 ;
  120.  
  121. #AVG
  122. } elsif ($x =~ m/^http:\/\/update.avg.com/) {
  123. $out="http://avg-cdn." . $1 ;
  124.  
  125. #maps.google.com
  126. } elsif ($x =~ m/^http:\/\/(cbk|mt|kh|mlt|tbn)[0-9]?(.google\.co(m|\.uk|\.id).*)/) {
  127. $out="http://" . $1 . $2 ;
  128.  
  129.  
  130. #maps.google.com
  131. } elsif ($x =~ m/^http:\/\/(kh|mt)[0-9]?(.google.com.*)/) {
  132. $out="http://" . $1 . $2 ;
  133.  
  134. #Google
  135. } elsif ($x =~ m/^http:\/\/(.*\.google-analytics\.com)\/(__utm\.gif)\?.*/) {
  136. $out="http://google-analytics.com.squid.internal/" . $1 . $2 ;
  137.  
  138.  
  139. } elsif ($x =~ m/^http:\/\/(www\.ziddu\.com.*\.[^\/]{3,4})\/(.*?)/) {
  140. $out="http://" . $1 ;
  141.  
  142. #cdn, varialble 1st path
  143. } elsif (($x =~ /filehippo/) && (m/^http:\/\/(.*?)\.(.*?)\/(.*?)\/(.*)\.([a-z0-9]{3,4})(\?.*)?/)) {
  144. @y = ($1,$2,$4,$5);
  145. $y[0] =~ s/[a-z0-9]{2,5}/cdn./;
  146. $out="http://" . $y[0] . $y[1] . "/" . $y[2] . "." . $y[3] ;
  147.  
  148. #rapidshare
  149. } elsif (($x =~ /rapidshare/) && (m/^http:\/\/(([A-Za-z]+[0-9-.]+)*?)([a-z]*\.[^\/]{3}\/[a-z]*\/[0-9]*)\/(.*?)\/([^\/\?\&]{4,})$/)) {
  150. $out="http://cdn." . $3 . "/squid.internal/" . $5 ;
  151.  
  152.  
  153. #domain/path/.*/path/filename
  154. } elsif (($X[1] =~ /fucktube/) && (m/^http:\/\/(.*?)(\.[^\.\-]*?[^\/]*\/[^\/]*)\/(.*)\/([^\/]*)\/([^\/\?\&]*)\.([^\/\?\&]{3,4})(\?.*?)$/)) {
  155. @y = ($1,$2,$4,$5,$6);
  156. $y[0] =~ s/(([a-zA-A]+[0-9]+(-[a-zA-Z])?$)|([^\.]*cdn[^\.]*)|([^\.]*cache[^\.]*))/cdn/;
  157. $out="http://" . $y[0] . $y[1] . "/" . $y[2] . "/" . $y[3] . "." . $y[4] ;
  158.  
  159. #youjizz. We use only domain and filename
  160. } elsif (($X[1] =~ /media[0-9]{1,5}\.youjizz/) && (m/^http:\/\/(.*?)(\.[^\.\-]*?\.[^\/]*)\/(.*)\/([^\/\?\&]*)\.([^\/\?\&]{3,4})(\?.*?)$/)) {
  161. @y = ($1,$2,$4,$5);
  162. $y[0] =~ s/(([a-zA-A]+[0-9]+(-[a-zA-Z])?$)|([^\.]*cdn[^\.]*)|([^\.]*cache[^\.]*))/cdn/;
  163. $out="http://" . $y[0] . $y[1] . "/" . $y[2] . "." . $y[3] ;
  164.  
  165. #general purpose for cdn servers. add above your specific servers.
  166. #} elsif (m/^http:\/\/([0-9.]*?)\/\/(.*?)\.(.*)\?(.*?)/) {
  167. #$out="http://squid-cdn-url/" . $2 . "." . $3 ;
  168.  
  169. #generic http://variable.domain.com/path/filename."ex", "ext" or "exte"
  170. #http://cdn1-28.projectplaylist.com
  171. #http://s1sdlod041.bcst.cdn.s1s.yimg.com
  172. } elsif (m/^http:\/\/(.*?)(\.[^\.\-]*?\..*?)\/([^\?\&\=]*)\.([\w\d]{2,4})\??.*$/) {
  173. @y = ($1,$2,$3,$4);
  174. $y[0] =~ s/([a-z][0-9][a-z]dlod[\d]{3})|((cache|cdn)[-\d]*)|([a-zA-A]+-?[0-9]+(-[a-zA-Z]*)?)/cdn/;
  175. $out="http://" . $y[0] . $y[1] . "/" . $y[2] . "." . $y[3] ;
  176.  
  177.  
  178. #for yimg.com video
  179. } elsif ($x =~ m/^http:\/\/(.*yimg.com)\/\/(.*)\/([^\/\?\&]*\/[^\/\?\&]*\.[^\/\?\&]{3,4})(\?.*)?$/) {
  180. $out="http://cdn.yimg.com/" . $3 ;
  181.  
  182. #for yimg.com doubled
  183. } elsif ($x =~ m/^http:\/\/(.*?)\.yimg\.com\/(.*?)\.yimg\.com\/(.*?)\?(.*)/) {
  184. $out="http://cdn.yimg.com/" . $3 ;
  185.  
  186. #for yimg.com with &sig=
  187. } elsif ($x =~ m/^http:\/\/([^\.]*)\.yimg\.com\/(.*)/) {
  188. @y = ($1,$2);
  189. $y[0] =~ s/[a-z]+([0-9]+)?/cdn/;
  190. $y[1] =~ s/&sig=.*//;
  191. $out="http://" . $y[0] . ".yimg.com/" . $y[1] ;
  192.  
  193. # all that ends with ;
  194. } elsif (m/^http:\/\/(.*?)\/(.*?)\;(.*)/) {
  195. $out="http://" . $1 . "/" . $2 ;
  196.  
  197.  
  198. } else {
  199. $out=$x;
  200.  
  201. }
  202. if ( $X[0] =~ m/^http\:\/\/.*/) {
  203. print "OK store-id=$out\n" ;
  204. } else {
  205. print $X[0] . " OK store-id=$out\n" ;
  206. }
  207. }
  208.  
  209.  
  210. ###########################
  211. ##########################
  212.  
  213. #!/usr/bin/perl
  214. $|=1;
  215. while (<>) {
  216. @X = split;
  217. if ( $X[0] =~ m/^http\:\/\/.*/) {
  218. $x = $X[0];
  219. $_ = $X[0];
  220. $u = $X[0];
  221. } else {
  222. $x = $X[1];
  223. $_ = $X[1];
  224. }
  225.  
  226. ############################################################################################################################
  227. #sourceforge
  228. if ($x =~ m/^http:\/\/[^\.]+\.dl\.sourceforge\.net\/(.*)/) {
  229. $out="http://dl.sourceforge.net.squid.internal/$1";
  230.  
  231. } elsif ($x =~ m/^http:\/\/.*\.gemscool.com\/dragonnest\/.*\/(.*.pak)/) {
  232. $out="http://dragonnest.com.squid.internal/$1";
  233.  
  234. #reverbnation
  235. } elsif (sx =~ m/^http:\/\/[a-z0-9]{4}\.reverbnation\.com\/.*\/([0-9]*).*/) {
  236. $out="http://reverbnation.com.squid.internal/$1";
  237.  
  238. # reverbnation
  239. } elsif (sx =~ m/^http:\/\/c2lo\.reverbnation\.com\/audio_player\/ec_stream_song\/(.*)\?.*/) {
  240. $out="http://reverbnation.squid.internal/$1";
  241.  
  242. ###############################################
  243.  
  244. #filehippo
  245. } elsif ($x =~ m/^http:\/\/.*filehippo.com\/.*\/(.*(exe|zip|7z|cab|msi|mru|mri|bz2|gzip|tgz|rar|pdf))/) {
  246. $out="http://filehippo.com.squid.internal/$1";
  247.  
  248. #filehippo
  249. } elsif ($x =~ m/^http:\/\/.*videos.videobash.com\/(.*.mp4).*/) {
  250. $out="http://videobash.com.squid.internal/$1";
  251.  
  252. #android
  253. } elsif ($x =~ m/^http:\/\/.*\.c\.android\.clients\.google\.com\/market\/GetBinary\/GetBinary\/(.*)\?/) {
  254. $out="http://android.googleplay.com.squid.internal/$1";
  255.  
  256. #######################################################
  257. } elsif ($x =~ m/^http(|s)\:\/\/.*youtube.*(ptracking|stream_204|player_204|gen_204).*(video_id|docid|v)\=([^\&\s]*).*/){
  258. $vid = $4 ;
  259. @cpn = m/[&?]cpn\=([^\&\s]*)/;
  260. $fn = "/var/log/squid/@cpn";
  261. unless (-e $fn) {
  262. open FH,">".$fn ;
  263. print FH "$vid\n";
  264. close FH;
  265. }
  266. $out="ERR";
  267.  
  268. } elsif ($x =~ m/^http(|s)\:\/\/.*(youtube|google).*videoplayback.*/){
  269. @itag = m/[&?](itag=[0-9]*)/;
  270. @ids = m/[&?]id\=([^\&\s]*)/;
  271. @mime = m/[&?](mime\=[^\&\s]*)/;
  272. @cpn = m/[&?]cpn\=([^\&\s]*)/;
  273. $fn = "/var/log/squid/@cpn";
  274. if (-e $fn) {
  275. open FH,"<".$fn ;
  276. $id = <FH>;
  277. chomp $id ;
  278. close FH ;
  279. } else {
  280. $id = $ids[0] ;
  281. }
  282. @range = m/[&?](range=[^\&\s]*)/;
  283. $out = "http://video-srv.youtube.com.squid.internal/id=" . $id . "&@itag@range@mime";
  284. ##########################################################################################################################
  285.  
  286.  
  287. } else {
  288. $out="ERR";
  289. }
  290. if ( $out =~ m/^http\:\/\/.*/) {
  291. print "OK store-id=$out\n" ;
  292. } else {
  293. print "ERR\n" ;
  294. }
  295. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement