diff options
author | Andrew Cady <d@jerkface.net> | 2020-12-12 12:31:04 -0500 |
---|---|---|
committer | Andrew Cady <d@jerkface.net> | 2020-12-12 12:31:04 -0500 |
commit | dbf38e8d05191dc1a15d4fafedccf7c3a1b61e2b (patch) | |
tree | 4c87bd638c0cce8fcc7799d5b05d60d0586c29e0 | |
parent | 682e0c5f6e7bfa8841fb67b3869e305d31fba7ef (diff) |
m3u8
-rwxr-xr-x | dot/local/bin/m3u8 | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/dot/local/bin/m3u8 b/dot/local/bin/m3u8 new file mode 100755 index 0000000..f4a4e9b --- /dev/null +++ b/dot/local/bin/m3u8 | |||
@@ -0,0 +1,22 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | # TODO: Hit URL. Check if received content is m3u8. If not, try `youtube-dl -g` | ||
4 | |||
5 | for INPUT | ||
6 | do | ||
7 | case "$INPUT" in | ||
8 | http://*|https://*) | ||
9 | OUTPUT=${INPUT##*/}.mkv ;; | ||
10 | *) | ||
11 | echo "Skipping unrecognized input: $INPUT" >&2 | ||
12 | continue ;; | ||
13 | esac | ||
14 | |||
15 | # ffmpeg will prompt the user if "$OUTPUT" exists | ||
16 | if [ "$IGNORE_EXISTING" -a -e "$OUTPUT" ] | ||
17 | then | ||
18 | continue | ||
19 | else | ||
20 | ffmpeg -hide_banner -v info -i "$INPUT" -c:v copy -c:a copy "$OUTPUT" | ||
21 | fi | ||
22 | done | ||