diff --git a/.config/streamlink/config b/.config/streamlink/config index 201bc98..24a0b9d 100644 --- a/.config/streamlink/config +++ b/.config/streamlink/config @@ -5,4 +5,4 @@ title={title} - {author} #--- Video ---# -default-stream=720p,480p,best +default-stream=720p,720p60,480p,best diff --git a/.local/bin/aliases b/.local/bin/aliases index 3e0f14f..88ef663 100755 --- a/.local/bin/aliases +++ b/.local/bin/aliases @@ -100,9 +100,28 @@ shuffle() { } stream() { - QUALITY=${2:-"720p"} - - streamlink --player mpv "https://twitch.tv/$1" "$QUALITY" > /dev/null 2>&1 & + channel="$1" + quality=${2:-"best"} + 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() {