Skip to content

Instantly share code, notes, and snippets.

@csparker247
Created January 17, 2014 22:06
Show Gist options
  • Save csparker247/8482613 to your computer and use it in GitHub Desktop.
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...
#!/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