mirror of
https://github.com/notwa/rc
synced 2024-11-05 01:19:06 -08:00
add some insanity to mpv_watch
This commit is contained in:
parent
1408a227c5
commit
3f476697d4
1 changed files with 13 additions and 4 deletions
|
@ -72,10 +72,19 @@ mpv_watch() { ### @-
|
||||||
argc -ge 1 "$0" "$@" || return
|
argc -ge 1 "$0" "$@" || return
|
||||||
pushd ~/play >/dev/null
|
pushd ~/play >/dev/null
|
||||||
local url="$1"; shift
|
local url="$1"; shift
|
||||||
mpv \
|
# checking for redundant flags might itself be redundant, but i want to be sure.
|
||||||
--af=lavfi="[$_M_PROCESS]" \
|
local seen=0
|
||||||
--ytdl-format='[width<=1280]/best' \
|
for a; do [ "$a" = "${a#--ytdl-format=}" ] || seen=1 done
|
||||||
"$@" -- "$url"
|
if [ $seen -eq 0 ]; then
|
||||||
|
mpv \
|
||||||
|
--af=lavfi="[$_M_PROCESS]" \
|
||||||
|
--ytdl-format='[width<=1280]/best' \
|
||||||
|
"$@" -- "$url"
|
||||||
|
else
|
||||||
|
mpv \
|
||||||
|
--af=lavfi="[$_M_PROCESS]" \
|
||||||
|
"$@" -- "$url"
|
||||||
|
fi
|
||||||
popd >/dev/null
|
popd >/dev/null
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue