Last active
May 28, 2023 01:59
-
-
Save niemasd/1c5abb067808ef890a45c08fc4318069 to your computer and use it in GitHub Desktop.
Download an M3U8 video stream and output it as an MKV using ffmpeg
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
#!/usr/bin/env bash | |
if [ "$#" -ne 2 ] ; then | |
echo "USAGE: $0 <m3u8_url> <out_file>"; exit | |
fi | |
base=$(echo "$1" | rev | cut -d'/' -f2- | rev) | |
curl -s $1 | grep -v "^#" | sed -e "s>^>$base/>" | xargs curl -s | ffmpeg -i pipe:0 -c:v copy -c:a copy $2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment