Skip to content

Instantly share code, notes, and snippets.

@jforberg
Created March 19, 2012 22:35
Show Gist options
  • Save jforberg/2127743 to your computer and use it in GitHub Desktop.
Save jforberg/2127743 to your computer and use it in GitHub Desktop.
SVTplayget
#!/bin/bash
# Requires curl and rtmpdump, aside from the usual Unix tools.
if [ ! $@ ]
then
echo "No URLs to fetch!"
exit 1
fi
for url in $*
do
echo "Fetching $url..."
rtmp_url="$(curl $url 2> /dev/null |
tr '"' '\n' |
grep 'dynamicStreams' |
head -n 1 |
awk -F 'url:' '{ print $2 }' |
sed 's/,.*$//g')"
echo "URI appears to be $rtmp_url."
filename="${rtmp_url##*/}"
echo "Dumping to $filename..."
rtmpdump -r $rtmp_url -o $filename 2>&1
echo "Dump complete."
echo
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment