Twitch.tv/Justin.tv
I've had an algorithmically equivalent script running for a different purpose for dozens of months now and decided to create a plugin for this great application that I just recently discovered -- thanks for making Serviio, zip.
INSTRUCTIONS:
- read and follow the instructions in this post (since August 2014, Twitch has messed up their Encoding)
- Open your stream or VOD in the browser and find the URL,
- e.g. for a livestream something like: http://www.twitch.tv/CHANNELNAME
- or for a VOD something similar to: http://www.twitch.tv/wcs/b/478169160 or http://www.twitch.tv/kaitlyn/c/3495972 or http://www.twitch.tv/wintergaming/v/3704243
- Add a URL of the above scheme as a Web Resource under Online sources
- The resulting folder will have all available qualities to choose from. "Source" is the highest quality; the names are identical to those in the flash player.
REVISIONS:
- V18 (16.02.2021): updated for new APIs
- V17 (15.09.2016): some API calls now require a Client ID field (thanks for the heads up szefo09) [4448]
- V16 (02.04.2016): twitch api urls are apparently now https only, should be fixed [1340]
- V15 (04.02.2015): added support for /v/ vods [6311]
- V14 (18.12.2014): even newer API urls (Author: ivanmalm)
- V13 (02.12.2014): newer api urls used, vod extraction fixed (courtesy of commandercool).
- V12 (22.09.2014): fixed VODs; now displaying as segments. [2642]
- V11 (24.01.2014): fixed stream grabbing to include tokens. [7586]
- V10 (15.01.2014): added support for VODs. [398]
- V9 (20.12.2013): removed RTMP streams since they are now disabled and will likely be defunct forever. [1069]
- V8 (14.12.2013): simplified HLS/mobile grabbing, fixed a bug from V5 that broke rtmpurl generation, updated swfUrl [236]
- V7 (11.12.2013): changed mobile stream grabber to also get source quality [136]
- V6 (09.12.2013): added support for displaying mobile streams [33]
- V5 (11.08.2013): worked around some pointless twitch api output, fixed a bug with transcoding
- V4 (16.06.2013): worked around bug-inducing twitch swf redirection [4867]
- V3 (04.02.2013): fixed more escaping, fixed a bug for null-valued jtv tokens (reuploaded) [3212]
- V2 (03.02.2013): fixed jtv token escaping for linux [15]
- V1 (03.02.2013): initial release [6]
COMPATIBILITY:
I've successfully tested it on Serviio 1.2.1-1.7. You will currently (August/September 2014) have to compile/download a custom version of FFMPEG, see this post: http://forum.serviio.org/viewtopic.php?p=94157#p94157
Some NOTES:
- This plugin circumvents advertisements that partnered streamers can display to gain a revenue. So ideally you shouldn't use this plugin; support them by watching their ads.
- Some channels have resolutions/qualities that are reserved for users that buy a subscription from a channel. This plugin does not display those resolutions, as they don't come with the required authorization token from the server.
FIRST LINE SUPPORT:
- If you get error messages like "Unknown video file type", try updating the ffmpeg.exe file in the serviio/lib/ folder with a static build from here: http://ffmpeg.zeranoe.com/builds/
- You will occasionally need to force refresh a stream via the Serviio Console and wait 15-60 seconds afterwards until the stream list entries work again. This is due to the fact that the URLs spit out by Twitch/Justin are at best only valid for the duration of the stream being online, at worst only for a few minutes (after which you have to get a fresh one)
- It's always a good idea to double-check what you're seeing. So if you're looking at what your TV shows you on Serviio and it's not what you expect, try looking at it with VLC.
- If video starts playing, but then suddenly stops, then that's probably due to Twitch's streaming servers being overloaded again. It happens, particularly when bigger LoL tournaments are being streamed.
- pretty much nothing. let me know if you have any great ideas.
if you like this, consider sending me some bitcoins to 15VMf7nUNgCutmQrGKu2gSQaLYfG9VtH74 or some beers to me via PayPal using this link