From ab43bd374b8532d439dabad4e88fd19082a31eb5 Mon Sep 17 00:00:00 2001 From: lara Date: Wed, 23 Dec 2020 17:01:37 +0100 Subject: [PATCH] [cliplumber] Add option for low quality video streaming --- bin/cliplumber | 6 ++++-- bin/playvideo | 9 ++++++++- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/bin/cliplumber b/bin/cliplumber index fc4542b..e48d4a0 100755 --- a/bin/cliplumber +++ b/bin/cliplumber @@ -32,7 +32,7 @@ if [ -n "$urls" ] && check_exists "youtube-dl"; then if echo "$urls" | grep -qF "scribblehub.com"; then check_exists "lncrawl" && opts="crawl|$opts" else - check_exists "mpv" && opts="play|$opts" + check_exists "mpv" && opts="play|low-play|$opts" opts="download|$opts" fi fi @@ -72,7 +72,9 @@ case "$choice" in ;; "play") playvideo "$clip" - + ;; + "low-play") + playvideo -l "$clip" ;; "audio-search") "$TERM_EMU" --single-instance mpv --ytdl-format=bestaudio ytdl://ytsearch:"$clip" diff --git a/bin/playvideo b/bin/playvideo index f637fe3..32b7d4f 100755 --- a/bin/playvideo +++ b/bin/playvideo @@ -8,4 +8,11 @@ if [ "$1" = "-h" ] || [ "$#" -lt "1" ]; then 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 +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