Advertisement
Guest User

Untitled

a guest
Sep 4th, 2011
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. #!/usr/bin/perl -l
  2.  
  3. use XML::Simple;
  4. $v=$ARGV[0];
  5. $z=XMLin(`wget -qO- "http://gdata.youtube.com/feeds/api/videos?q=$v&max-results=3"`);
  6. $URL=$z->{entry}->{(keys(%{$z->{entry}}))[0]}->{link}->[0]->{href};
  7. print $URL;
  8. $ID=$URL;
  9. $ID=~ s/(.*)v=(.*)&(.*)/\2/g;
  10.  
  11. $COOKIE_FILE="/var/tmp/cookies.txt";
  12. $REAL_URL=`youtube-dl --cookies $COOKIE_FILE -g "$URL"`;
  13. `mplayer -cookies -cookies-file $COOKIE_FILE "$REAL_URL"`;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement