Advertisement
punces

storerewrite.pl

Dec 22nd, 2016
564
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.27 KB | None | 0 0
  1. #!/usr/bin/perl
  2.  
  3. $|=1;
  4. while (<>) {
  5. @X = split;
  6. if ($X[0] =~ m/^http.*/) {
  7. $url = $X[0];
  8. $referer = $X[1];
  9. $urlreferer = $X[0] ." ". $X[1];
  10. } else {
  11. $chanel = $X[0];
  12. $url = $X[1];
  13. $referer = $X[2];
  14. $urlreferer = $X[1] ." ". $X[2];
  15. }
  16.  
  17. #speedtest rewrite
  18. if ($url=~ m/^https?\:\/\/.*(speedtest|espeed|api\.ookla).*\/(speedtest\.swf|speedtest-long\.swf|latency\.txt|upload\.php|speedtest-config\.php|ipaddress\.php|random.*\.jpg)/) {
  19. $out="OK rewrite-url=http://10.212.212.212:8033/speedtest/$2";
  20.  
  21. #watch rewrite
  22. } elsif ($url=~ m/(^https?\:\/\/(www|gaming)\.youtube\.com\/(watch\?v|embed|v)[\=\%\&\?\/].*[\=\%\&\?\/])(nohtml5\=1|html5\=1)(.*)/) {
  23. $out="OK rewrite-url=$1" . "nohtml5=1" . $5;
  24.  
  25. } elsif ($url=~ m/(^https?\:\/\/(www|gaming)\.youtube\.com\/(watch\?v|embed|v)[\=\%\&\?\/].*[\=\%\&\?\/].*)/) {
  26. $out="OK rewrite-url=$1" . "&nohtml5=1";
  27.  
  28. } elsif ($url=~ m/(^https?\:\/\/(www|gaming)\.youtube\.com\/(watch\?v)[\=\%\&\?\/][^\?^\&]*$)/) {
  29. $out="OK rewrite-url=$1" ."&nohtml5=1";
  30.  
  31. } elsif ($url=~ m/(^https?\:\/\/(www|gaming)\.youtube\.com\/(embed|v)[\=\%\&\?\/][^\?^\&]*$)/) {
  32. $out="OK rewrite-url=$1" ."?nohtml5=1";
  33.  
  34. } else {
  35. $out="ERR";
  36. }
  37.  
  38. if ($X[0] =~ m/^http.*/) {
  39. print "$out\n";
  40. } else {
  41. print "$chanel $out\n";
  42. }
  43. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement