[cliplumber] Add option for low quality video streaming
This commit is contained in:
parent
c9c60062ce
commit
ab43bd374b
2 changed files with 12 additions and 3 deletions
|
@ -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"
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue