Skip to content

Instantly share code, notes, and snippets.

@davelnewton
Created September 23, 2014 17:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save davelnewton/8df582b859e5a5407917 to your computer and use it in GitHub Desktop.
Save davelnewton/8df582b859e5a5407917 to your computer and use it in GitHub Desktop.
#! /bin/bash
if [ "$#" -ne 1 ]; then
echo "Usage: $0 infoq_presentation_url"
exit 1
fi
url_with_spaces=`curl -A "Mozilla/5.0 (iPad; U; CPU OS 3_2 like Mac OS X; en-us) AppleWebKit/531.21.10 (KHTML, like Gecko) Version/4.0.4 Mobile/7B334b Safari/531.21.10" $1 | grep "<source src=" | tr -dc "[:print:]"`
url=${url_with_spaces//<source src=/}
TMP=${url//[ \"]/}
TMP=${TMP//\/>/}
echo "Retrieving video from $TMP..."
wget $TMP
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment