Skip to content

Instantly share code, notes, and snippets.

@yifeiyin
Last active November 13, 2020 06:24
Show Gist options
  • Save yifeiyin/013e494d08e92a45d93a092ed55aa739 to your computer and use it in GitHub Desktop.
Save yifeiyin/013e494d08e92a45d93a092ed55aa739 to your computer and use it in GitHub Desktop.
Download MyMedia Video
#!/bin/sh
# Usage:
# $ mymediadl URL [FILE_NAME]
mymediadl() {
URL=$(echo "$1" | awk -F '/' '{ print $NF }')
echo "Downloading $URL"
NAME="$2"
if [[ -z $NAME ]]; then
NAME=$(date -R)
fi
ffmpeg \
-v warning \
-stats \
-i "https://stream.library.utoronto.ca:1935/MyMedia/play/mp4:1/$URL.mp4/playlist.m3u8" \
-c copy \
"$NAME.mp4"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment