[cliplumber] Add option for low quality video streaming

This commit is contained in:
lara 2020-12-23 17:01:37 +01:00
parent c9c60062ce
commit ab43bd374b
2 changed files with 12 additions and 3 deletions

View file

@ -32,7 +32,7 @@ if [ -n "$urls" ] && check_exists "youtube-dl"; then
if echo "$urls" | grep -qF "scribblehub.com"; then if echo "$urls" | grep -qF "scribblehub.com"; then
check_exists "lncrawl" && opts="crawl|$opts" check_exists "lncrawl" && opts="crawl|$opts"
else else
check_exists "mpv" && opts="play|$opts" check_exists "mpv" && opts="play|low-play|$opts"
opts="download|$opts" opts="download|$opts"
fi fi
fi fi
@ -72,7 +72,9 @@ case "$choice" in
;; ;;
"play") "play")
playvideo "$clip" playvideo "$clip"
;;
"low-play")
playvideo -l "$clip"
;; ;;
"audio-search") "audio-search")
"$TERM_EMU" --single-instance mpv --ytdl-format=bestaudio ytdl://ytsearch:"$clip" "$TERM_EMU" --single-instance mpv --ytdl-format=bestaudio ytdl://ytsearch:"$clip"

View file

@ -8,4 +8,11 @@ if [ "$1" = "-h" ] || [ "$#" -lt "1" ]; then
exit 1 exit 1
fi fi
mpv --ytdl-format='bestvideo[height<=?720]+bestaudio/best' "$1" 2>&1 | grep 'ERROR:' | tee /dev/fd/2 | xargs -n1 -d "\n" notify-send quality=720
if [ "$1" = "-l" ]; then
shift
quality=360
fi
mpv --ytdl-format="bestvideo[height<=?$quality]+bestaudio/best" "$1" 2>&1 | grep 'ERROR:' | notify_err