Skip to content

Instantly share code, notes, and snippets.

@npeters
Created January 31, 2014 21:37
Show Gist options
  • Save npeters/8743699 to your computer and use it in GitHub Desktop.
Save npeters/8743699 to your computer and use it in GitHub Desktop.
URL_HTML=$1
OUT=$2
if [ "x$URL_HTML"="x" || "x$OUT"="x" ]
then
echo "$0 html outfile"
exit 1
fi
JSON=$(curl "$URL_HTML" | grep "fr_FR" | grep arte_vp_url | grep -v EXTRAIT | head -1 | sed 's/.*arte_vp_url="\([^"]*\)".*/\1/g')
F=`curl $JSON | ~/JSON.sh | grep '\["videoJsonPlayer","VSR","HTTP_REACH_EQ_1","url"\]'`
URL_MP4=$(echo "$F" | cut -d']' -f2)
URL_MP4=$(echo $URL_MP4 | sed 's/\"//g')
wget -O "$OUT" $URL_MP4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment