1
0
Fork 0
mirror of https://github.com/notwa/rc synced 2024-05-20 10:53:23 -07: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
# 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+=" --stream-sorting-excludes=>=source"
LIVESTREAMER_FLAGS+=" --player-passthrough=http --player-no-close"
_M_STEREO='aformat=channel_layouts=stereo'
@ -39,23 +38,21 @@ watchstream() {
shift
if [ -n "$ZSH_VERSION" ]; then
# zsh syntax
livestreamer "$url" "$@" -p mpv $=LIVESTREAMER_FLAGS -a \
"$MPV_STREAM_FLAGS {filename}"
mpv $=MPV_STREAM_FLAGS "$url"
else
# bash syntax
livestreamer "$url" "$@" -p mpv $LIVESTREAMER_FLAGS -a \
"$MPV_STREAM_FLAGS {filename}"
mpv $MPV_STREAM_FLAGS "$url"
fi
}
twitch() {
local user="$1"
shift
watchstream "twitch.tv/$user" "$@"
watchstream "http://twitch.tv/$user" "$@"
}
hitbox() {
local user="$1"
shift
watchstream "hitbox.tv/$user" "$@"
watchstream "http://hitbox.tv/$user" "$@"
}