Skip to content

Instantly share code, notes, and snippets.

@narate
Created June 12, 2017 16:25
Show Gist options
  • Save narate/421785a3dc0bde4e6300d7dc310f5d86 to your computer and use it in GitHub Desktop.
Save narate/421785a3dc0bde4e6300d7dc310f5d86 to your computer and use it in GitHub Desktop.
Facebook live downloader
#!/bin/bash
if [ $# -eq 0 ]
then
echo "Usage : $0 url [output]"
exit
fi
VID=$(basename $1)
if [ $# -ge 2 ]
then
OUTPUT=$2
else
TITLE=$(youtube-dl -e $1)
if [ $? -ne 0 ]
then
exit
fi
OUTPUT=$TITLE-$VID-$(date +%Y%m%d%H%M%S).mp4
fi
echo Saving file to "\"$OUTPUT\""
ffmpeg -hide_banner -v quiet -stats -i "https://www.facebook.com/video/playback/playlist.m3u8?v=$VID" -c copy "$OUTPUT"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment