rc/bin/playvideo
2021-02-14 23:44:41 +01:00

19 lines
365 B
Bash
Executable file

#!/bin/sh
# Load helper functions
source "$(dirname "$(rreadlink "$0")")/../lib/utils.sh"
if [ "$1" = "-h" ] || [ "$#" -lt "1" ]; then
>&2 echo "Usage: $0 [-l] <video url>"
exit 1
fi
quality=720
if [ "$1" = "-l" ]; then
shift
quality=360
fi
mpv --ytdl-format="bestvideo[height<=?$quality]+bestaudio/best" "$@" 2>&1 | grep 'ERROR:' | notify_err