dotfiles/local/bin/dlsubs

26 lines
353 B
Plaintext
Raw Normal View History

2021-11-02 15:33:23 -04:00
#!/bin/sh
LANG=pob
usage() {
echo "usage: dlsubs <files>"
exit 1
}
[ -z "$1" ] && usage
for arg in "$@"; do
case "$arg" in
*.mkv|*.mp4 )
if [ ! -f "$arg" ]; then
echo "$arg is not a file"
usage
fi ;;
*) echo "$arg is neither a .mkv nor a .mp4 file"; usage ;;
esac
done
for input in "$@"; do
subdl --lang=$LANG "$input"
done