Advertisement
suprianto

store-id YT

Jul 27th, 2014
367
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.59 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. # send link from youtube contain >> (ptracking|stream_204|player_204|gen_204) to storeurl
  6.  
  7.  
  8. $|=1;
  9. while (<>) {
  10. @X = split;
  11.  
  12. if ( $X[0] =~ m/^http\:\/\/.*/) {
  13. $x = $X[0];
  14. $_ = $X[0];
  15. $u = $X[0];
  16. } else {
  17. $x = $X[1];
  18. $_ = $X[1];
  19. $u = $X[1];
  20. }
  21.  
  22. if ($x =~ m/^http(|s):\/\/.*youtube.*(ptracking|stream_204|player_204|gen_204).*(video_id|docid|v)\=([^\&\s]*).*/){
  23. $vid = $4 ;
  24. @cpn = m/[&?]cpn\=([^\&\s]*)/;
  25. if (defined($vid )) {
  26. $fn = "/var/log/squid/@cpn";
  27. unless (-e $fn) {
  28. open FH,">".$fn ;
  29. print FH "$vid\n";
  30. close FH;
  31. }
  32. }
  33. $out=$x . "\n";
  34.  
  35. } elsif ($x =~ m/^http(|s):\/\/.*(youtube|google|googlevideo).*videoplayback.*/){
  36. @itag = m/[&?](itag=[0-9]*)/;
  37. @ids = m/[&?]id\=([^\&\s]*)/;
  38. @mime = m/[&?](mime\=[^\&\s]*)/;
  39. @cpn = m/[&?]cpn\=([^\&\s]*)/;
  40. if (defined($cpn[0])) {
  41. $fn = "/var/log/squid/@cpn";
  42. if (-e $fn) {
  43. open FH,"<".$fn ;
  44. $id = <FH>;
  45. chomp $id ;
  46. close FH ;
  47. } else {
  48. $id = $ids[0] ;
  49. }
  50. } else {
  51. $id = $ids[0] ;
  52. }
  53. @range = m/[&?](range=[^\&\s]*)/;
  54. $out="http://video-srv.youtube.com.squid.internal/id=" . $id . "&@itag@range@mime\n";
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement