1
0
Fork 0
mirror of https://github.com/notwa/rc synced 2024-11-05 07:29:04 -08:00

use youtube-dl for twitch streams

a little studdery but ill work on it
This commit is contained in:
Connor Olding 2016-01-23 03:52:34 -08:00
parent 1a25b3adb8
commit e8e6ae5761

View file

@ -1,9 +1,8 @@
#!/bin/zsh #!/bin/zsh
# awful things # awful things
MPV_STREAM_FLAGS="--quiet --no-sub --no-ytdl --loop=force --cache-initial=1024" MPV_STREAM_FLAGS="--quiet --no-sub --loop=force --cache-secs=2 --cache-initial=1024 --cache-pause --cache-backbuffer=0 --cache-seek-min=2048"
LIVESTREAMER_FLAGS="--player-http --player-continuous-http --default-stream=source,best" 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" LIVESTREAMER_FLAGS+=" --player-passthrough=http --player-no-close"
_M_STEREO='aformat=channel_layouts=stereo' _M_STEREO='aformat=channel_layouts=stereo'
@ -39,23 +38,21 @@ watchstream() {
shift shift
if [ -n "$ZSH_VERSION" ]; then if [ -n "$ZSH_VERSION" ]; then
# zsh syntax # zsh syntax
livestreamer "$url" "$@" -p mpv $=LIVESTREAMER_FLAGS -a \ mpv $=MPV_STREAM_FLAGS "$url"
"$MPV_STREAM_FLAGS {filename}"
else else
# bash syntax # bash syntax
livestreamer "$url" "$@" -p mpv $LIVESTREAMER_FLAGS -a \ mpv $MPV_STREAM_FLAGS "$url"
"$MPV_STREAM_FLAGS {filename}"
fi fi
} }
twitch() { twitch() {
local user="$1" local user="$1"
shift shift
watchstream "twitch.tv/$user" "$@" watchstream "http://twitch.tv/$user" "$@"
} }
hitbox() { hitbox() {
local user="$1" local user="$1"
shift shift
watchstream "hitbox.tv/$user" "$@" watchstream "http://hitbox.tv/$user" "$@"
} }