diff options
Diffstat (limited to 'dot/local/bin')
-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 | ||