Background

http://player.twitch.tv/?channel=STREAMER

Requirements

A secondary device, such as a PC, capable of running the Livestreamer application which is connected to the same network as your Wii U.

Livestreamer installed on your secondary device. It supports Windows, Linux and OSX.

A Twitch account.

Setting Up Livestreamer

Installation

C:\Program Files (x86)\Livestreamer

Editing the http_server.py File

conn.send(b"Content-Type: video/unknown\r

")

conn.send(b"Content-Type: video/mp4\r

")

Replacing the Old HTTP Server

C:\Program Files (x86)\Livestreamer\livestreamer-1.12.2-py2.7.egg\livestreamer_cli\utils

Authorizing Livestreamer and Acquiring Twitch OAuth Token

livestreamer --twitch-oauth-authenticate

http://livestreamer.tanuki.se/en/develop/twitch_oauth.html#access_token=zz341i4kdn4m5qftrewwqd3mfktwal&scope=user_read+user_subscriptions

access_token=zz341i4kdn4m5qftrewwqd3mfktwal

zz341i4kdn4m5qftrewwqd3mfktwal

Using Livestreamer to Serve Streams to Your Wii U

livestreamer --player-external-http --twitch-oauth-token=zz341i4kdn4m5qftrewwqd3mfktwal https://www.twitch.tv/blizzheroes source

error: Unable to open URL: https://api.twitch.tv/kraken/user.json (400 Client Error: Bad Request)

Available streams: audio, high, low, medium, mobile (worst), source (best)

http://192.168.1.4:52275/

[cli][info] Got HTTP request from Mozilla/5.0 (Nintendo WiiU) AppleWebKit/536.30 (KHTML, like Gecko) NX/3.0.4.2.12 NintendoBrowser/4.3.1.11264.EU

--player-external-http-port=8080

Prior to March 2017, you used to be able to view Twitch streams directly from the Wii U browser by visiting the URL for the external pop-out player:It was but a happy coincidence that this method even worked at all, as the Wii U browser isn't officially supported by the Twitch site.At the beginning of March 2017, however, watching streams using this method stopped working entirely. Where you would previously get the video stream, all you'd see is a black screen instead. This problem was reported by several Wii U owners who used the console to watch Twitch over at reddit , with seemingly no-one coming up with a solution. It seems increasingly likely that this will never be fixed by Twitch themselves, so a work-around is in order to remove the necessity of the Wii U having to interact directly with the Twitch site at all.This post presents said work-around to enable you to continue using your Wii U to watch Twitch streams on your TV using the Livestreamer stream extraction application from a secondary device, then playing it on your Wii U.First ensure you install Livestreamer on your secondary device. Check the installation instructions for your platform and download and install it as per those. If using Windows, for example, you should end up with a Livestreamer install in the default location:Unfortunately Livestreamer will identify the stream in a format unrecognizable by the WIi U by default. To correct this, we need to make a change to Livestreamer's source code. Thankfully this isn't as daunting as it first seems.The only file we need to edit is http_server.py which is responsible for making the stream available over your network. Unfortunately the one installed by the installation process on Windows is in a bytecode compiled format so cannot be edited directly. We will need to acquire the raw .py text file in order to change it.The easiest way to do this is to browse to this location . This should open the code file in your web browser. Right click this page and select "Save Page As..." and save it as http_server.py to your Desktop:Open the http_server.py file that you've just saved on your Desktop in a text editor such as Wordpad.: I specifically recommend Wordpad over Notepad as Notepad will not display the carriage returns correctly and it will be much harder to read. You should see something like this:Find the following line of code:Change it to:Save and close the file.: Ensure you do not add or remove any spaces from the beginning of the line when you are replacing it. The Python programming language uses spaces to delimit code blocks and altering the spacing will cause errors in the module, so take extra care if copy/pasting.On Windows, open the following location in Explorer:Find thefile in that directory and rename it to(or simply delete it) and then move thefile that you edited from your Desktop into this directory.The final contents of this directory should look like this:In order to use Livestreamer with Twitch, you'll need to authorize it to access your Twitch account and acquire a special authentication token. We can do this using Livestreamer itself. Before doing this, however, you should ensure that you're signed in on the Twitch site.Since Livestreamer is a command-line application, we can't just open it like a normal Windows application. We must use the command prompt to start and interact with it. Start by opening a command prompt by going to your start screen and searching for "Command Prompt", then opening it:Another way of opening a command prompt window is by holding the Windows key on your keyboard, pressing R and typinginto the Run dialog then pressing Enter. You should see the command prompt dialog box:Type the following into the command prompt window and hit enter. It should open a web page in your browser asking you to authorize Livestreamer to use your Twitch account:: After authorizing, it will take you to a "Page Not Found" error. This is perfectly fine, butWe need one more thing, the oauth token, which is actually contained in the URL of the error page. The URL should look something like this:We are interested in the "access token" part of the URL:Carefully copy the string of letters and numbers after the = sign and before the & sign at the end. In this example, the code we're interested in is:Keep this safe somewhere for now. Open a Notepad window and paste it there.: Never give this token out to anybody as it could be used to access your Twitch account. The one shown here is obviously just an example and not functional.Now you've authorized Livestreamer to access Twitch and have your access token, it can now be used to serve streams over your network to your Wii U. The simplest way to do this would be to use the following command at your command prompt:Note the inclusion of the access token we acquired previously and the URL of the stream at the end. It's important the access token is correct, otherwise you will see an error message like this when executing this command:You will need to re-check the authentication section above if you do get this to ensure you completed it correctly and copied the correct access token.The "source" at the end of the command specifies the quality of the stream. If the streamer has a transcoder, you may replace this with values such as "low", "medium" or "high" if desired. A list of supported quality options can be seen by running the command omitting the quality option entirely, upon which Livestreamer will reply with something like:After executing this command, you should see something similar to this in your command prompt window:This tells us the Livestreamer authentication has been successful and it is presently making your chosen stream available over your network. You may get a prompt from your firewall at this point requesting to authorize Livestreamer to access the network which you should permit.You should now be able to open your Wii U browser to the stream's internal URL. This is the 2nd one displayed in your command prompt; you should ignore the one beginning with 127.x. In this case I'd type the following in my Wii U browser address bar:You should see attempts by your Wii U browser to connect to the server in your command prompt window:By this point, your chosen stream should be displaying as it used to on your Wii U and TV and you can do this for whatever stream you wish to broadcast to your TV via your Wii U.Optionally, you can specify a static port number in your command by including the following:This will stop the port randomizing and allow you to set a bookmark on your Wii U to always point to your PC running Livestreamer if you also assign it a static internal LAN IP address.Happy viewing.