This script saves the video streams from the Arte +7 liberty local.
You only need to run the script with the main url of your target video stream, as example:
Syntax: ./arte_plus7_downloader.sh "url"
Example: ./arte_plus7_downloader.sh "http://plus7.arte.tv/de/1697660,CmC=3024668,scheduleId=3004936.html/"
Simply to use, no need to explain it completely...
arte_plus7_downloader.sh:
#!/bin/sh
# check for syntax
if [ $# -eq 0 ] ; then
echo "Syntax: ${0} \"url\""
echo "Example: ${0} \"http://plus7.arte.tv/de/1697660,CmC=3024668,scheduleId=3004936.html/\""
exit 1
fi
# download from:
URL="${1}"
# save location
LOCATION="/Download/Arte"
# html dump
HTMLTMP="/tmp/arte_tmp"
# date of today
DATE=`date +%y%m%d`
# check if html dump file exist
if [ ! -e ${HTMLTMP} ] ; then
# create file
touch ${HTMLTMP}
else
# if file exist deleted contents
echo "" > ${HTMLTMP}
fi
# get main page with video info
curl -m 5 --connect-timeout 5 -# ${URL} > ${HTMLTMP}
# parse title out of the html dump
TITLE=`cat ${HTMLTMP} | grep -e 'meta name=\"Title\"' | sed 's/ .*\=//g;s/.-.ARTE+7.*>//g;s/\"//g;s/;//g;s/ /_/g'`
# parse for wmv/mms container file
WMV=`cat ${HTMLTMP} | grep -e 'availableFormats.*PG_HQ_DE.wmv' | sed 's/availableFormats.*\=//g;s/\"//g;s/;//g;s/ //g'`
# get container file
curl -m 5 --connect-timeout 5 -# ${WMV} > ${HTMLTMP}
# get mms stream address
WMV=`cat ${HTMLTMP} | grep -e 'PG_HQ_DE.wmv' | sed 's///g;s/ //g'`
echo "${TITLE} - ${WMV}"
# get the dump with mplayer
mplayer -dumpstream "${WMV}" -dumpfile "${LOCATION}/${TITLE}-${DATE}.wmv"
# error handling
if [ $? = "1" ] ; then
echo "Error! Retrying download"
"${0}" "${URL}"
fi
echo ""
What is missing/ToDO:
+ a better error handling
+ self fetching RSS Feed script to automate download process - something like bashpodder
+ further description and options