Created
March 19, 2012 22:35
-
-
Save jforberg/2127743 to your computer and use it in GitHub Desktop.
SVTplayget
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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