rc/bin/playvideo

21 lines
560 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
quality=720
if [ "$1" = "-l" ]; then
shift
quality=360
fi
2024-03-18 22:18:01 +00:00
# https://github.com/mpv-player/mpv/issues/4241
#mpv --ytdl-format="bestvideo[height<=?$quality]+bestaudio/best" "$@" 2>&1 | grep 'ERROR:' | notify_err
mpv --ytdl-format="bestvideo[height<=?$quality][fps<=?30][vcodec!=?vp9]+bestaudio/best[height<=?$quality]" "$@" 2>&1 | grep 'ERROR:' | notify_err