Created
January 17, 2014 22:06
-
-
Save csparker247/8482613 to your computer and use it in GitHub Desktop.
Downloads all webm and mp4 videos found in an html page. Needs better pattern matching...
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
curl -# -o test.html "$1" | |
mkdir downloaded-vids | |
for line in $(cat test.html); do | |
url=$(echo $line | grep -e .*http.*webm.* -e .*http.*mp4.* | sed 's/src=\(.*\)/\1/' | tr -d \') | |
if [[ ! -z $url ]]; then | |
curl -# -o downloaded-vids/$(basename $url) $url | |
fi | |
done | |
du -hcs downloaded-vids/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment