Browse Source

Aliases: Add options to stream function

master
Riyyi 3 years ago
parent
commit
42586e9f8d
  1. 2
      .config/streamlink/config
  2. 25
      .local/bin/aliases

2
.config/streamlink/config

@ -5,4 +5,4 @@ title={title} - {author}
#--- Video ---# #--- Video ---#
default-stream=720p,480p,best default-stream=720p,720p60,480p,best

25
.local/bin/aliases

@ -100,9 +100,28 @@ shuffle() {
} }
stream() { stream() {
QUALITY=${2:-"720p"} channel="$1"
quality=${2:-"best"}
streamlink --player mpv "https://twitch.tv/$1" "$QUALITY" > /dev/null 2>&1 & lowLatency="$3"
if [ "$quality" = "list" ]; then
streamlink "https://twitch.tv/$1" --config "/dev/null"
elif [ "$quality" != "low" ] && [ -z "$lowLatency" ]; then
echo "Starting stream https://twitch.tv/$channel at quality: $quality"
setsid -f streamlink \
--player mpv \
--stream-sorting-excludes "<480p,>=1080p" \
"https://twitch.tv/$channel" "$quality" > /dev/null 2>&1 &
else
[ "$quality" = "low" ] && quality="best"
echo "Starting stream https://twitch.tv/$channel at quality: $quality"
setsid -f streamlink \
--twitch-low-latency \
--player mpv \
--player-args '--cache=yes --demuxer-max-bytes=750k' \
--stream-sorting-excludes "<480p,>=1080p" \
"https://twitch.tv/$channel" "$quality" > /dev/null 2>&1 &
fi
} }
update_mirrorlist() { update_mirrorlist() {

Loading…
Cancel
Save