ohhdemgirls

Untitled

Mar 2nd, 2014
408
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.00 KB | None | 0 0
  1. #!/bin/bash
  2. #takes short url like so ./bam.sh http://videobam.com/DUiMr
  3. url=$1
  4. #takes $url and strips 'http://videobam.com/' to use the ID as filename
  5. out=$(echo $url |sed 's/^.\{,20\}//')
  6.  
  7. #curl gets page source, grep outputs (see end of file) then sed strips the first 241 characters, then strips everything after the api/id starting at '","auto' then removes backslashes.
  8. get=$(curl -s $url |grep ',"url":"' |sed -e 's/^.\{,241\}//' -e 's/\"','"auto.*//' -e 's/\\//g')
  9.  
  10. #simple wget, takes $get and uses -O to name to output
  11. wget -c $get -O $out.mp4
  12.  
  13.  
  14. #Grep output
  15.  
  16. var player_config = {"showErrors":false,"canvas":{"backgroundGradient":"none"},"plugins":{"controls":{"autoHide":"always","zIndex":"10"}},"playlist":[{"url":"http:\/\/i.videobam.com\/DUiMr_o.jpg","scaling":"fit"},{"scaling":"fit","url":"http:\/\/1.lw6.videobam.com\/storage\/1\/videos\/d\/du\/DUiMr\/encoded.mp4\/16bb09d2668ecb47d6002077f6ad7885\/5312d34d?ss=119","autoBuffering":false,"autoPlay":false,"bufferLength":"2"}]};\|ignore//"
Advertisement
Add Comment
Please, Sign In to add comment