Skip to content

Instantly share code, notes, and snippets.

@tozevv
Last active November 27, 2016 22:45
Show Gist options
  • Save tozevv/1e0a0dace86167d56e7f01a25855c097 to your computer and use it in GitHub Desktop.
Save tozevv/1e0a0dace86167d56e7f01a25855c097 to your computer and use it in GitHub Desktop.
Simple tool to fetch Microsoft Smooth Streaming files.
#!/bin/sh
#
# Simple Microsoft Smooth Streaming fetch.
#
echo $PATH
if [ $# -eq 0 ]
then
echo "Usage: fetch-mss.sh <ism-url>"
fi
function download {
FILE=$(basename $1)
curl $1 -o $FILE
}
ISM_URL=$1
ISM_PATH=$(dirname $ISM_URL)
ISMC_URL="$ISM_URL"c
echo Downloading $ISM_URL
download $ISM_URL
download $ISMC_URL
ISM_FILE=$(basename $ISM_URL)
TRACKS=$(grep -o 'src="[^"]*"' $ISM_FILE | tr -d '"' | sed s/src=//g)
for TRACK in $TRACKS; do
download $ISM_PATH/$TRACK;
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment