mirror of
https://github.com/notwa/rc
synced 2024-11-05 02:29:06 -08:00
use youtube-dl for twitch streams
a little studdery but ill work on it
This commit is contained in:
parent
1a25b3adb8
commit
e8e6ae5761
1 changed files with 5 additions and 8 deletions
|
@ -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" "$@"
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue