Advertisement
punces

new-storerewrite.pl

Feb 13th, 2017
411
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.00 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.  
  18. #watch rewrite
  19. if ($url=~ m/(^https?\:\/\/(www|gaming)\.youtube\.com\/(watch\?v|embed|v)[\=\%\&\?\/].*[\=\%\&\?\/])(nohtml5\=1|html5\=1)(.*)/) {
  20. $out="OK rewrite-url=$1" . "nohtml5=1" . $5;
  21.  
  22. } elsif ($url=~ m/(^https?\:\/\/(www|gaming)\.youtube\.com\/(watch\?v|embed|v)[\=\%\&\?\/].*[\=\%\&\?\/].*)/) {
  23. $out="OK rewrite-url=$1" . "&nohtml5=1";
  24.  
  25. } elsif ($url=~ m/(^https?\:\/\/(www|gaming)\.youtube\.com\/(watch\?v)[\=\%\&\?\/][^\?^\&]*$)/) {
  26. $out="OK rewrite-url=$1" ."&nohtml5=1";
  27.  
  28. } elsif ($url=~ m/(^https?\:\/\/(www|gaming)\.youtube\.com\/(embed|v)[\=\%\&\?\/][^\?^\&]*$)/) {
  29. $out="OK rewrite-url=$1" ."?nohtml5=1";
  30.  
  31. } else {
  32. $out="ERR";
  33. }
  34.  
  35. if ($X[0] =~ m/^http.*/) {
  36. print "$out\n";
  37. } else {
  38. print "$chanel $out\n";
  39. }
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement