FAQ  •  Register  •  Login

Twitch.tv/Justin.tv

<<

jules

DLNA master

Posts: 173

Joined: Sat Feb 02, 2013 10:21 am

Post Sun Feb 03, 2013 2:16 am

Twitch.tv/Justin.tv

This here is my plugin to watch Twitch.tv and Justin.tv livestreams via Serviio.
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:

REVISIONS:
  • V17 (15.09.2016): some API calls now require a Client ID field (thanks for the heads up szefo09)
  • 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: 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.
UNDER DEVELOPMENT:
  • pretty much nothing. let me know if you have any great ideas.
DONATION
if you like this, consider sending me some bitcoins to 15VMf7nUNgCutmQrGKu2gSQaLYfG9VtH74 or some beers to me via PayPal using this link
Attachments
twitch.groovy
V17
(7.7 KiB) Downloaded 2150 times
Last edited by jules on Thu Sep 15, 2016 3:20 pm, edited 31 times in total.
<<

devidation

Serviio newbie

Posts: 5

Joined: Wed Feb 06, 2013 5:17 pm

Post Wed Feb 06, 2013 5:26 pm

Re: Twitch.tv/Justin.tv

Hi.
First of all I want to let you know that this is working great.
However there is one thing that doesn't seem to (work) for me.
When i run a movie with resolution 1280x720 it fits perfectly fine on my screen.
But when i run the stream (which is also 1280x720) a good portion of the borders are offscreen.
The resolution doesn't match.
Is there a way to fix this?
Thank you in advance.
<<

jules

DLNA master

Posts: 173

Joined: Sat Feb 02, 2013 10:21 am

Post Thu Feb 07, 2013 1:21 am

Re: Twitch.tv/Justin.tv

Sorry, no idea.
May be a problem with either your rendering device (TV) or how ffmpeg is relaying the stream.

You can open the stream with VLC to verify it's not the source material that is at fault: hit "L" for library, then go to Local Network, Universal Plug'n'Play and open up the stream. If this looks good, it may be one of the above.

In the meantime, I've discovered another problem where the streams don't get discarded and updated after they're used once. I thought Serviio did this, but I may have misread the documentation. Will look into it some more.
<<

bobz

Serviio lover

Posts: 68

Joined: Tue Feb 05, 2013 10:46 pm

Post Thu Feb 07, 2013 2:58 am

Re: Twitch.tv/Justin.tv

Ok I am New..So plz be easy.I did all that.I see the folder but when i click it its empty i dont see any media.What am i doing wrong?
<<

jules

DLNA master

Posts: 173

Joined: Sat Feb 02, 2013 10:21 am

Post Thu Feb 07, 2013 8:34 am

Re: Twitch.tv/Justin.tv

means either you entered the url wrong, or the channel is offline (or subscription only and there are no free resolutions, but i haven't seen that happen yet). try right-clicking the entry in serviio console and do a force-refresh, then wait a minute and reload the folder in your controller.
<<

Ohvee

Serviio newbie

Posts: 11

Joined: Tue Jan 31, 2012 1:03 am

Post Thu Feb 07, 2013 3:02 pm

Re: Twitch.tv/Justin.tv

I lost hope that a twitch plugin would ever happen for serviio.

Thanks so much!
<<

bobz

Serviio lover

Posts: 68

Joined: Tue Feb 05, 2013 10:46 pm

Post Thu Feb 07, 2013 5:18 pm

Re: Twitch.tv/Justin.tv

Ok I got it working thanx.Is it possible to just type twitch.tv/entertainment or sports and it would generate a list?
<<

jules

DLNA master

Posts: 173

Joined: Sat Feb 02, 2013 10:21 am

Post Thu Feb 07, 2013 5:52 pm

Re: Twitch.tv/Justin.tv

not right now... i might add that functionality as well as VODs at some point in the future
<<

devidation

Serviio newbie

Posts: 5

Joined: Wed Feb 06, 2013 5:17 pm

Post Thu Feb 07, 2013 6:07 pm

Re: Twitch.tv/Justin.tv

it won't seem to work in VLC... . Am I doing it right?
When i'm at the universal plug and play tab. I do ctrl+V to ad the stream url. However it doesn't load the stream.
Instead the buttons is like play stop play stop play stop... .
<<

jules

DLNA master

Posts: 173

Joined: Sat Feb 02, 2013 10:21 am

Post Thu Feb 07, 2013 6:17 pm

Re: Twitch.tv/Justin.tv

you add the url in serviio as a web resource as the first post says, then you can *browse* for it in vlc... it should be a folder that contains items like "CHANNELNAME-live [720p]"

it also usually takes a minute or two for serviio to grab metadata
<<

devidation

Serviio newbie

Posts: 5

Joined: Wed Feb 06, 2013 5:17 pm

Post Thu Feb 07, 2013 7:04 pm

Re: Twitch.tv/Justin.tv

well actually I might have found the problem but I'm not sure yet because i haven't been able to test it yet.
I've read a bit about overscan. It seems that this is an option thats turned on by default on all TV's.
So its possible that this is causing the edges to fall off. Should i turn this off?
There are however some things that I'm wondering about.
By what I understand from what I read, Turning overscan off is better then leaving it on? Can someone conform this?
And if this is the case, than does this mean that I'm watching (digital TV) for 2 years and play the ps3 for some years without even noticing?
so in short, Will turning this off not only fix the missing stream edges but will it also improve daily viewing of digital TV and playing ps3 in general?
Cause actually I've never noticed it until i actually tried streaming league of legends:p
Thanks in advance.
<<

jules

DLNA master

Posts: 173

Joined: Sat Feb 02, 2013 10:21 am

Post Thu Feb 07, 2013 7:43 pm

Re: Twitch.tv/Justin.tv

http://en.wikipedia.org/wiki/Overscan

a relic from olden times... you're better off without it 10 out of 10 times, given that these times are in the present.
<<

devidation

Serviio newbie

Posts: 5

Joined: Wed Feb 06, 2013 5:17 pm

Post Thu Feb 07, 2013 7:45 pm

Re: Twitch.tv/Justin.tv

Ok then i think i will try to turn this off, If I can turn it off :/ I diden't notice it for watching tv and playing the ps3 so it doesn't realy matter if i can't.
But being able to watch streams without cut off edges which I abviously do notice would be a nice addition.
Thank you anyway.
<<

devidation

Serviio newbie

Posts: 5

Joined: Wed Feb 06, 2013 5:17 pm

Post Fri Feb 08, 2013 5:00 pm

Re: Twitch.tv/Justin.tv

I could indeed fix it by disabling overscan.
Thx again for this great plugin.
Will only use serviio for streaming twitch and stuff though as i cannot get streaming movies to work.
Keeps stuttering. Trying the same file with other media players works fine.
<<

kiwi82

Serviio newbie

Posts: 3

Joined: Fri Feb 08, 2013 8:32 pm

Post Fri Feb 08, 2013 8:42 pm

Re: Twitch.tv/Justin.tv

hello

the plugin works fine but apparently doesn't work with channels who have a password (of course i've got the password ). Any ideas? (and sorry for my poor english...)
<<

Ohvee

Serviio newbie

Posts: 11

Joined: Tue Jan 31, 2012 1:03 am

Post Mon Feb 18, 2013 11:44 pm

Re: Twitch.tv/Justin.tv

Hmm, this has not been consistently working for me. I'm not really sure where to look for logs pertaining to whether or not a stream will show up, either.

However, I've been using this program to watch streams in VLC on my pc (win7) and it works great.
https://github.com/chrippa/livestreamer

I'm not sure if they logic from that program could help this plugin, but I thought that I've pass it on.
<<

jules

DLNA master

Posts: 173

Joined: Sat Feb 02, 2013 10:21 am

Post Tue Feb 19, 2013 12:08 pm

Re: Twitch.tv/Justin.tv

Ohvee wrote:Hmm, this has not been consistently working for me. I'm not really sure where to look for logs pertaining to whether or not a stream will show up, either.

However, I've been using this program to watch streams in VLC on my pc (win7) and it works great.
https://github.com/chrippa/livestreamer

I'm not sure if they logic from that program could help this plugin, but I thought that I've pass it on.

yeah, that's nothing new. they use rtmpdump, we use ffmpeg - both frontends for librtmp.

you should get good results when everytime you want to start the stream, you refresh the item in your online sources list. i may have to re-do some of the plugin logic to get around that (and i'm not sure that i'll manage). problem is that the urls that the plugin extracts expire whenever the streamer takes his stream offline, and serviio doesn't seem to want to accept that.

you'll see an error saying ffmpeg has exited with error code 1 in serviio's logfile, and that it may not play. that's the case when ffmpeg has probed for the stream's video information and didn't get any video data, as is the case when the stream is offline.
kiwi82 wrote:hello

the plugin works fine but apparently doesn't work with channels who have a password (of course i've got the password ). Any ideas? (and sorry for my poor english...)

i've not seen any channels with password protection. if you direct me to one and give me the password to it, i may be able to implement support.
<<

Ohvee

Serviio newbie

Posts: 11

Joined: Tue Jan 31, 2012 1:03 am

Post Tue Feb 19, 2013 4:02 pm

Re: Twitch.tv/Justin.tv

Ah, I hadn't even thought about refreshing the online source. That's a pretty dumb oversight on my part.

I use serviio on my PS3 in one room and on a 2010 Bravia tv in another, so I'm rarely in the same room as the computer. However, I'll just keep my phone on me with ServiiDroid and then I can refresh the source anywhere.

Thanks!
<<

zeke

Serviio newbie

Posts: 9

Joined: Tue Feb 19, 2013 10:57 pm

Post Tue Feb 19, 2013 11:46 pm

Re: Twitch.tv/Justin.tv

Folder shows up on Serviio but doesn't show anything in the folder.

Here is all the information I can give you at the moment:

Panasonic Vierra ST30 55" TV
Serviio 1.0.1
Profile: Panasonic Vierra E/S/ST/VT (2011)
Macbook Pro 2012 OSX (I am new to OSX so it is frustrating trying to find my way around this new OS when I could do so myself in Windows fairly easily)

http://www.justin.tv/entertainment_tv11
<<

jules

DLNA master

Posts: 173

Joined: Sat Feb 02, 2013 10:21 am

Post Wed Feb 20, 2013 12:10 am

Re: Twitch.tv/Justin.tv

try serviio 1.1. that channel works just fine for me.
also have a look at the ffmpeg link for linux in the first post, maybe you can replicate the steps on your apple "computer".
Next

Return to Available plugins

Who is online

Users browsing this forum: No registered users and 3 guests

Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.