#!/bin/sh # TODO: Hit URL. Check if received content is m3u8. If not, try `youtube-dl -g` for INPUT do case "$INPUT" in http://*|https://*) OUTPUT=${INPUT##*/}.mkv ;; *) echo "Skipping unrecognized input: $INPUT" >&2 continue ;; esac # ffmpeg will prompt the user if "$OUTPUT" exists if [ "$IGNORE_EXISTING" -a -e "$OUTPUT" ] then continue else ffmpeg -hide_banner -v info -i "$INPUT" -c:v copy -c:a copy "$OUTPUT" fi done