Aliases: Add options to stream function
This commit is contained in:
@@ -5,4 +5,4 @@ title={title} - {author}
|
||||
|
||||
#--- Video ---#
|
||||
|
||||
default-stream=720p,480p,best
|
||||
default-stream=720p,720p60,480p,best
|
||||
|
||||
+21
-2
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user