Aliases: Add options to stream function

This commit is contained in:
Riyyi
2021-08-07 16:12:17 +02:00
parent 7659b826b5
commit 42586e9f8d
2 changed files with 22 additions and 3 deletions
+1 -1
View File
@@ -5,4 +5,4 @@ title={title} - {author}
#--- Video ---#
default-stream=720p,480p,best
default-stream=720p,720p60,480p,best
+21 -2
View File
@@ -100,9 +100,28 @@ shuffle() {
}
stream() {
QUALITY=${2:-"720p"}
channel="$1"
quality=${2:-"best"}
lowLatency="$3"
streamlink --player mpv "https://twitch.tv/$1" "$QUALITY" > /dev/null 2>&1 &
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() {