2020-11-20 18:12:05 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
2020-12-23 15:43:24 +00:00
|
|
|
# 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
|
|
|
|
|
2020-12-23 16:01:37 +00:00
|
|
|
quality=720
|
|
|
|
|
|
|
|
if [ "$1" = "-l" ]; then
|
|
|
|
shift
|
|
|
|
quality=360
|
|
|
|
fi
|
|
|
|
|
2021-02-14 22:44:41 +00:00
|
|
|
mpv --ytdl-format="bestvideo[height<=?$quality]+bestaudio/best" "$@" 2>&1 | grep 'ERROR:' | notify_err
|