Created
October 25, 2018 07:23
-
-
Save chriskempson/b2a3b9f5a8d39c5e41203aecc04982a8 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 sh | |
title=$(echo $@ | grep -Po '(?<=copy ).+?(?=.ts)') | |
m3u8_url=$(echo $@ | grep -Po '(?<=-i ).+?\.m3u8') | |
if [ -z "$title" ] || [ -z "$m3u8_url" ]; then | |
echo "Please enter a valid ffmpeg command from http://kmake.net/gyaommsurl" | |
return | |
fi | |
echo "\nDownloading:\n$title\n\nFrom:\n$m3u8_url\n" | |
livestreamer --hls-segment-threads 10 --hls-timeout 300 --hls-segment-timeout 60 --hls-segment-attempts 10 "hls://$m3u8_url" best -o "$title.ts" | |
ffmpeg -i "$title.ts" -c copy -bsf:a aac_adtstoasc "$title.mp4" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment