Browse Source

[cliplumber] Add option for low quality video streaming

master
lara 5 years ago
parent
commit
ab43bd374b
  1. 6
      bin/cliplumber
  2. 9
      bin/playvideo

6
bin/cliplumber

@ -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"

9
bin/playvideo

@ -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

Loading…
Cancel
Save