Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- #takes short url like so ./bam.sh http://videobam.com/DUiMr
- url=$1
- #takes $url and strips 'http://videobam.com/' to use the ID as filename
- out=$(echo $url |sed 's/^.\{,20\}//')
- #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.
- get=$(curl -s $url |grep ',"url":"' |sed -e 's/^.\{,241\}//' -e 's/\"','"auto.*//' -e 's/\\//g')
- #simple wget, takes $get and uses -O to name to output
- wget -c $get -O $out.mp4
- #Grep output
- 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