Skip to content

Instantly share code, notes, and snippets.

@chiefy
Last active July 3, 2023 18:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chiefy/71cc9516dffd936122ffface1aae6ad6 to your computer and use it in GitHub Desktop.
Save chiefy/71cc9516dffd936122ffface1aae6ad6 to your computer and use it in GitHub Desktop.
nhlbite and the stream detector script
#!/usr/bin/env bash
#
# This script is a proxy streamer for most of those :cough: sports sites
#
# You'll need:
# * the stream detector Firefox extension (https://addons.mozilla.org/en-US/firefox/addon/hls-stream-detector/)
# * VLC
# * streamlink (https://streamlink.github.io/install.html)
# * bash (linux/osx)
#
# Usage in The Stream Detector (paste this in options, replace <> required arguments)
# <path-to-script>/nhlbite-streamer.sh "%url%" "%referer%" "%useragent%" <chromecast-ip> <vlc-path>
#
stream_url=${1:?"no stream url sent"}
referer=${2:?"no referer sent"}
user_agent=${3:?"no user-agent sent"}
chromecast_ip=${4:-192.168.1.194}
vlc_path=${5:-/Applications/VLC.app/Contents/MacOS/VLC}
streamlink \
--http-header "User-Agent=$user_agent" \
--http-header "Referer=$referer" \
--player "$vlc_path --sout=\"#chromecast{ip=$chromecast_ip},mux=hls\"" \
"$stream_url" \
best
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment