Something went wrong. Try again.
Personal dotfiles.
Something went wrong. Try again.
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253#!/bin/bash
# Install twitch plugin:## INSTALL_DIR="${XDG_DATA_HOME:-${HOME}/.local/share}/streamlink/plugins"; mkdir -p "$INSTALL_DIR"; curl -L -o "$INSTALL_DIR"/twitch.py 'https://github.com/2bc4/streamlink-ttvlol/releases/latest/download/twitch.py'
# purple script credentialsPURPLE_CLIENT_ID=hvxqh56odhgw9hcgm4krxyztmgn82nPURPLE_CLIENT_SECRET=mrk3wt08q4aw5ll5nz58pf6e2wlmwg
# select streamif [ $# -eq 1 ]; then STREAM=$1else # obtain the list of streams JSON_STREAM_LIST=$(purple --popular -l es) # create visual options OPTIONS_LIST=$(echo "$JSON_STREAM_LIST" | jq -r '.[] | "\(.user_name) - \(.viewer_count) - \(.game_name) - \(.title)"') IFS=$'\n' read -r -d '' -a options <<< "$OPTIONS_LIST" # create stream options STREAM_LIST=$(echo "$JSON_STREAM_LIST" | jq -r '.[] | "\(.user_login)"') IFS=$'\n' read -r -d '' -a streams <<< "$STREAM_LIST" # select stream choice=$(printf "%s\n" "${options[@]}" | fuzzel --dmenu --width 88) [[ -z "$choice" ]] && exit 1 for i in "${!options[@]}"; do if [[ "${options[$i]}" == "$choice" ]]; then STREAM="${streams[$i]}" break fi donefi
# play streamPROXIES=( "https://twitch.nadeko.net/" "https://eu2.luminous.dev" "https://as.luminous.dev" "https://lb-as.cdn-perfprod.com" "https://lb-sa.cdn-perfprod.com" "https://eu.luminous.dev" "https://lb-eu3.cdn-perfprod.com" "https://lb-eu5.cdn-perfprod.com")
PROXY_LIST=$(IFS=,; echo "${PROXIES[*]}")streamlink "https://www.twitch.tv/$STREAM" best \ --player mpv \ --twitch-proxy-playlist="$PROXY_LIST" \ --twitch-low-latency \ --twitch-proxy-playlist-fallback