Browse Source

Scripts: Rework stream function

master
Riyyi 3 years ago
parent
commit
be606c0e72
  1. 43
      .local/bin/aliases

43
.local/bin/aliases

@ -101,30 +101,31 @@ shuffle() {
stream() { stream() {
channel="$1" channel="$1"
quality=${2:-"best"} quality="$2"
lowLatency="$3" lowLatency="$3"
if [ "$quality" = "list" ]; then if [ -z "$quality" ]; then
streamlink "https://twitch.tv/$1" --config "/dev/null" streamlink --quiet --config "/dev/null" "https://twitch.tv/$1"
elif [ "$quality" != "low" ] && [ -z "$lowLatency" ]; then printf "Select stream quality: "
echo "Starting stream https://twitch.tv/$channel at quality: $quality" read -r quality
setsid -f streamlink \ fi
--player mpv \
--stream-sorting-excludes "<480p,>=1080p" \ if [ -n "$lowLatency" ]; then
"https://twitch.tv/$channel" "$quality" > /dev/null 2>&1 & arguments="\
else --twitch-low-latency \
[ "$quality" = "low" ] && quality="best" --player-args '--cache=yes --demuxer-max-bytes=750k' \
echo "Starting stream https://twitch.tv/$channel at quality: $quality" "
setsid -f streamlink \
--twitch-low-latency \
--twitch-disable-ads \
--twitch-disable-hosting \
--twitch-disable-reruns \
--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 fi
echo "Starting stream https://twitch.tv/$channel @ $quality"
command="setsid -f streamlink \
--twitch-disable-hosting \
--twitch-disable-reruns \
--player mpv \
--stream-sorting-excludes '<480p,>=1080p' \
$arguments \
https://twitch.tv/$channel $quality > /dev/null 2>&1"
eval "$command"
} }
update_mirrorlist() { update_mirrorlist() {

Loading…
Cancel
Save