sh Twitch.tv通过VLC媒体播放器直播

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了sh Twitch.tv通过VLC媒体播放器直播相关的知识,希望对你有一定的参考价值。

# 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

以上是关于sh Twitch.tv通过VLC媒体播放器直播的主要内容,如果未能解决你的问题,请参考以下文章

Ionic iOS 上的 Twitch 嵌入式播放器无法正常工作

VLC 21年,重新审视低延迟直播

如何在 PHP 中发出 Https 请求

XMLHttprequest 无法使用 twitch.tv api

Ubuntu 16.04安装VLC播放器,替代系统默认播放器

如何在 VLC 中播放 HLS 流