Guest User

liveleak

a guest
Aug 4th, 2013
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.83 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. #creates a list of the front page videos
  4. curl -s http://www.liveleak.com/ | grep 'width="120"' > menu.txt
  5. sed -i 's/<a href="//g' menu.txt
  6. sed -i 's/title=/\n&/g' menu.txt
  7. sed -i s/'"><img'[^@]*$// menu.txt
  8. sed -i 's/title="/# /g' menu.txt
  9. sed -i 's#"/></a>##g' menu.txt
  10. sed -i "s/^[ \t]*//" menu.txt
  11. awk 'NR%2{printf $0" ";next;}1' menu.txt > menulist.txt
  12. rm menu.txt
  13. sed -i 's/ /_/g' menulist.txt
  14. sed -i 's/_#/#/g' menulist.txt
  15.  
  16. #creates the select menu of the videos
  17. p=`cat menulist.txt`
  18. rm menulist.txt
  19. select CHOICE in $p
  20. do
  21.  
  22. #greps the mp4 url from the selected video and plays it with vlc
  23. curl -s "$CHOICE" | grep 'file: "http://edge.liveleak.com' > file.txt
  24. sed -i 's/        file: "//g' file.txt
  25. sed -i 's/",//g' file.txt
  26. file=`cat file.txt`
  27. rm file.txt
  28. vlc --play-and-exit $file > /dev/null 2>&1
  29. done
Add Comment
Please, Sign In to add comment