Skip to content

Instantly share code, notes, and snippets.

@narate
Created June 12, 2017 16:27
Show Gist options
  • Save narate/06ab3c9a09b5137ab9756ef24f04590b to your computer and use it in GitHub Desktop.
Save narate/06ab3c9a09b5137ab9756ef24f04590b to your computer and use it in GitHub Desktop.
Facebook live downloader [ Update : Facebook change permission to access m3u8 url :'( ]
#!/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"
@mahdouch85
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment