# Watch Twitch.tv livestreams with VLC
## All-in-one
For those that just want to get to the point and start watching.
``` shell
brew install streamlink && brew cask install vlc &&
git clone https://gist.github.com/Jahhein/f96574f45b24aa797af13ce4c6812076 twitch-streamlink &&
cd twitch-streamlink &&
chmod 755 twitch.sh &&
./twitch.sh
```
## ***UPDATE!***
The package [Livestreamer][livestreamer] was depcricated when I first authored this.
A new fork of Livestream was created named [Streamlink][streamlink] therefore
I have updated all information to get up and running with Streamlink and a GUI
if the command line makes your uneasy/confused.
[streamlink]:https://streamlink.github.io/ "Streamlink.github.io"
[livestreamer]:http://livestreamer.io/ "Livestreamer.io"
---
### Requirements
- [VLC Media Player](https://www.videolan.org/vlc/index.html)
- [Streamlink Package](https://streamlink.github.io)
### Installation with Homebrew for macOS
``` shell
brew install streamlink && brew cask install vlc
```
### Streamlink GUI
The GUI is just like any application, but requires streamlink package to still
be installed.
OPTIONAL: `brew cask install streamlink-twitch-gui` for the GUI.
### Shell Script Parameters
* $1 is the stream name on twitch.tv
* $2 is the stream quality - audio, low, medium, high, best, or specific like I mention below.
Examples usages
``` shell
twitch.sh twitchpresents best # best video quality available
twitch.sh lirik 900p60 # 900p60 quality
twitch.sh monstercat audio # only stream audio
twitch.sh kitboga 480p # 480p quality
```
> *Please report any issues you come across! Thank you!*
#!/usr/bin/env bash
# -----
# Author: Jacob Hein (Jahhein)
# https://github.com/Jahhein
#
# Description:
# Streamlink script to watch Twitch.tv streams with VLC Media player
#
cat << EOF
usage: twitch.sh $1 $2 (stream name) (quality)
# Examples!
# ---------
twitch.sh twitchpresents best # best video quality available
twitch.sh lirik 900p60 # 900p60 quality
twitch.sh monstercat audio # only stream audiot
twitch.sh kitboga 480p # 480p quality
EOF
# option with twitch OAUTH token
#streamlink --twitch-oauth-token $TWITCH_TOKEN https://www.twitch.tv/"$1" "$2" > /dev/null 2>&1 &
streamlink https://www.twitch.tv/"$1" "$2" > /dev/null 2>&1 &
exit 0