rc/bin/playvideo

12 lines
327 B
Text
Raw Normal View History

2020-11-20 18:12:05 +00:00
#!/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>"
2020-11-20 18:12:05 +00:00
exit 1
fi
mpv --ytdl-format='bestvideo[height<=?720]+bestaudio/best' "$1" 2>&1 | grep 'ERROR:' | tee /dev/fd/2 | xargs -n1 -d "\n" notify-send