mirror of
https://github.com/notwa/rc
synced 2024-11-05 06:49:03 -08:00
61 lines
1.7 KiB
Bash
61 lines
1.7 KiB
Bash
#!/bin/zsh
|
|
# awful things
|
|
|
|
MPV_STREAM_FLAGS="--quiet --no-sub --no-ytdl --loop=force --cache-initial=1024"
|
|
LIVESTREAMER_FLAGS="--player-http --player-continuous-http --default-stream=source,best"
|
|
#LIVESTREAMER_FLAGS+=" --stream-sorting-excludes=>=source"
|
|
LIVESTREAMER_FLAGS+=" --player-passthrough=http --player-no-close"
|
|
|
|
_M_STEREO='aformat=channel_layouts=stereo'
|
|
_M_PRE_EMPH='equalizer=f=50.0:g=-10:width_type=o:w=4,equalizer=f=5000:g=+05:width_type=o:w=4'
|
|
_M_POST_EMPH='equalizer=f=50.0:g=+10:width_type=o:w=4,equalizer=f=5000:g=-05:width_type=o:w=4'
|
|
_M_COMPRESS='compand=0.001|0.001:0.25|0.25:-42/-42|0/-21:6:18:-30:0.001'
|
|
_M_LIMIT='compand=0.000|0.000:0.10|0.10:-9/-9|0/-6.:3:4.5:-9'
|
|
_M_KILL="$_M_STEREO,$_M_PRE_EMPH,$_M_COMPRESS,$_M_POST_EMPH"
|
|
|
|
getladspa() {
|
|
REPLY=""
|
|
if [ -e "/usr/lib/ladspa/${1}.so" ]; then
|
|
REPLY="ladspa=f=${1}:p=${1}"
|
|
fi
|
|
}
|
|
|
|
getladspa crap_eq_const_T420
|
|
_M_SPEAKERS="$REPLY"
|
|
getladspa crap_level
|
|
_M_LEVEL="$REPLY"
|
|
|
|
_nn="$(uname -n | tr A-Z a-z)"
|
|
if [[ "$_nn" == "spectre" ]]; then
|
|
MPV_STREAM_FLAGS+=" --af=lavfi=[$_M_STEREO,$_M_KILL,alimiter=level_in=0.7071]"
|
|
fi
|
|
if [[ "$_nn" == "banshee" ]]; then
|
|
MPV_STREAM_FLAGS+=" --af=lavfi=[$_M_STEREO,$_M_LEVEL,$_M_SPEAKERS,alimiter=level_in=0.5]"
|
|
fi
|
|
_nn=
|
|
|
|
watchstream() {
|
|
local url="$1"
|
|
shift
|
|
if [ -n "$ZSH_VERSION" ]; then
|
|
# zsh syntax
|
|
livestreamer "$url" "$@" -p mpv $=LIVESTREAMER_FLAGS -a \
|
|
"$MPV_STREAM_FLAGS {filename}"
|
|
else
|
|
# bash syntax
|
|
livestreamer "$url" "$@" -p mpv $LIVESTREAMER_FLAGS -a \
|
|
"$MPV_STREAM_FLAGS {filename}"
|
|
fi
|
|
}
|
|
|
|
twitch() {
|
|
local user="$1"
|
|
shift
|
|
watchstream "twitch.tv/$user" "$@"
|
|
}
|
|
|
|
hitbox() {
|
|
local user="$1"
|
|
shift
|
|
watchstream "hitbox.tv/$user" "$@"
|
|
}
|