[RELEASE] Justin.tv (Video) Plugin

  Thread Rating:
  • 9 Votes - 3.67 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
burro Offline
Junior Member
Posts: 4
Joined: Jan 2012
Reputation: 0
Thumbs Up   
Post: #466
Eric_S Wrote:I made it work without 'Chown'. Note that the librtmp file does not reside in mobile"s path; therefore, mobile need not be made the owner.

Thanks to all who contributed solutions for this great add-on, as well as to you, Divingmule.

Thank you very much!!!!Smile
find quote
Japz Offline
Junior Member
Posts: 5
Joined: Jan 2012
Reputation: 0
Post: #467
Hi,

First of all, thanks for your efforts!
I ran into a little issue regarding getting an archive. (error log here: http://pastebin.com/sBjtHmye).

I'm not sure if this the proper way to fix the issue since I'm not sure what this bit of code is for, but here's a patch:
http://pastebin.com/HKLDAZsA

Cheers Smile
find quote
tofen Offline
Junior Member
Posts: 15
Joined: Jan 2010
Reputation: 0
Post: #468
Hi,

I'm trying to get this to work but didn't come very far.
I have Eden Beta 1 on Windows 7.
When I try "install from Zip-file" and select the file i downloaded (tried with both 0.2.1 and 0.2.2) I instantly get "Dependencies not met".

Anyone who have a clue why it does that?
find quote
Japz Offline
Junior Member
Posts: 5
Joined: Jan 2012
Reputation: 0
Post: #469
divingmule Wrote:If you don't mind getting your hands dirty you can try editing the default.py, around line 371 change -
Code:
swf = ' swfUrl=http://www.justin.tv/widgets/live_embed_player.swf?channel='+name
To -
Code:
swf = ' swfUrl=http://www.justin.tv/widgets/live_embed_player.swf?channel='+name+' swfVfy=True'

But I suspect code will have to be added to get the redirected swfUrl.

I've given adding redirect-resolving code a shot. Although it doesn't complain about the swf anymore, it doesn't work for the starcraft 2 streams I'm trying to watch.

Most of the streams have this kind of error:
Code:
15:27:34 T:9337408  NOTICE: DVDPlayer: Opening: rtmp://live-cdn.jtvnw.net/live/akamai2_18@6237 jtv=45d21625e27850ab02bfd69ebadfe833d89c7333:{\22swfDomains\22:\20[\22justin.tv\22,\20\22jtvx.com\22,\20\22xarth.com\22,\20\22twitchtv.com\22,\20\2​2twitch.tv\22,\20\22newjtv.com\22,\20\22jtvnw.net\22,\20\22wdtinc.com\22,\20\22i​mapweather.com\22,\20\22facebook.com\22,\20\22starcrafting.com\22],\20\22streamName\22:\20\22akamai2_18@6237\22,\20\22expiration\22:\201326641253.​722584,\20\22server\22:\20\22akamai\22} swfUrl=http://www-cdn.jtvnw.net/widgets/live_embed_player.r9d0bc2f469dfc550e3c227ddd51b7381ac3eb211.swf?channel=totalbis​cuit&referer=http://www.justin.tv/totalbiscuit&userAgent=Mozilla/5.0%20(Windows%20NT%206.1;%20WOW64;%20rv:6.0)%20Gecko/20100101%20Firefox/6.0&channel=totalbiscuit swfVfy=1 Pageurl=http://www.twitch.tv/totalbiscuit
15:27:34 T:9337408 WARNING: CDVDMessageQueue(player)::Put MSGQ_NOT_INITIALIZED
15:27:34 T:2951740272  NOTICE: Creating InputStream
15:27:34 T:2951740272   ERROR: rtmp server sent error
15:27:34 T:2951740272   ERROR: Closing connection: NetStream.Play.StreamNotFound

I'm not sure why this is. I found a post on Reddit talking about a random 3 digit ID being added to those streams, not sure if this is the culprit or even related: http://www.reddit.com/r/leagueoflegends/..._a/c3c7eht
find quote
Japz Offline
Junior Member
Posts: 5
Joined: Jan 2012
Reputation: 0
Post: #470
tofen Wrote:Hi,

I'm trying to get this to work but didn't come very far.
I have Eden Beta 1 on Windows 7.
When I try "install from Zip-file" and select the file i downloaded (tried with both 0.2.1 and 0.2.2) I instantly get "Dependencies not met".

Anyone who have a clue why it does that?

I had the same issue. You need to install the common cache plugin from the standard xbmc addons first.
find quote
tofen Offline
Junior Member
Posts: 15
Joined: Jan 2010
Reputation: 0
Post: #471
Japz Wrote:I had the same issue. You need to install the common cache plugin from the standard xbmc addons first.

Yey! Got it to work.

Thanks' a bunch.Big Grin
find quote
sam.appletv Offline
Junior Member
Posts: 4
Joined: Jan 2012
Reputation: 0
Post: #472
Hello,
first of all I want to thank you Divingmule for all your great add ons and also you too 2ndtvuser.

Secondly, I'm having problems making this add on file work on my apple tv xbmc. I have updated the librt file. but I still can't get this working. I'm a newbie and not very good at these things. Can you please give step by step instructions of how to get this add on working on my apple tv? I currently see all the stuff on my apple tv through the justintv add on but when I click anything is says playback failed.

please let me know
thanks in advance
find quote
divingmule Offline
Skilled Python Coder
Posts: 1,297
Joined: Oct 2008
Reputation: 61
Post: #473
Sounds like your librtmp isn't updated. I don't have an ATV and there have been conflicting reports about the proper directory to put the lib in. Some have had to chmod after copying. Check the ATV note in post 404, a forum search for "librtmp ATV" may provide more clues.
find quote
divingmule Offline
Skilled Python Coder
Posts: 1,297
Joined: Oct 2008
Reputation: 61
Post: #474
Japz Wrote:I've given adding redirect-resolving code a shot. Although it doesn't complain about the swf anymore, it doesn't work for the starcraft 2 streams I'm trying to watch.

Most of the streams have this kind of error:
Code:
15:27:34 T:9337408  NOTICE: DVDPlayer: Opening: rtmp://live-cdn.jtvnw.net/live/akamai2_18@6237 jtv=45d21625e27850ab02bfd69ebadfe833d89c7333:{\22swfDomains\22:\20[\22justin.tv\22,\20\22jtvx.com\22,\20\22xarth.com\22,\20\22twitchtv.com\22,\20\2​2twitch.tv\22,\20\22newjtv.com\22,\20\22jtvnw.net\22,\20\22wdtinc.com\22,\20\22i​mapweather.com\22,\20\22facebook.com\22,\20\22starcrafting.com\22],\20\22streamName\22:\20\22akamai2_18@6237\22,\20\22expiration\22:\201326641253.​722584,\20\22server\22:\20\22akamai\22} swfUrl=http://www-cdn.jtvnw.net/widgets/live_embed_player.r9d0bc2f469dfc550e3c227ddd51b7381ac3eb211.swf?channel=totalbis​cuit&referer=http://www.justin.tv/totalbiscuit&userAgent=Mozilla/5.0%20(Windows%20NT%206.1;%20WOW64;%20rv:6.0)%20Gecko/20100101%20Firefox/6.0&channel=totalbiscuit swfVfy=1 Pageurl=http://www.twitch.tv/totalbiscuit
15:27:34 T:9337408 WARNING: CDVDMessageQueue(player)::Put MSGQ_NOT_INITIALIZED
15:27:34 T:2951740272  NOTICE: Creating InputStream
15:27:34 T:2951740272   ERROR: rtmp server sent error
15:27:34 T:2951740272   ERROR: Closing connection: NetStream.Play.StreamNotFound

I'm not sure why this is. I found a post on Reddit talking about a random 3 digit ID being added to those streams, not sure if this is the culprit or even related: http://www.reddit.com/r/leagueoflegends/..._a/c3c7eht

Sounds like they are onto something there. Wondering if the three digit code is in the usher.justin.tv/find/ results?
find quote
Japz Offline
Junior Member
Posts: 5
Joined: Jan 2012
Reputation: 0
Post: #475
divingmule Wrote:Sounds like they are onto something there. Wondering if the three digit code is in the usher.justin.tv/find/ results?

Yeah I looked if I could find something in there, but not really. I'd need to do really look into what data is sent back and forth to see if it's to be found somewhere. Takes a bit more time than I have at the moment though. Smile

I did patch it to properly follow the 301s / 302s for redirects. Here's the patch (includes my last patch to fix view on some archives). If it looks OK, can you include it in the next release?

Code:
--- /tmp/plugin.video.jtv.archives/default.py    2012-01-02 09:08:24.000000000 +0000
+++ default.py    2012-01-16 18:15:58.064064527 +0000
@@ -319,8 +319,9 @@ def getVideos(name):
             url = i['video_file_url']
             title = i['title']
             part = 'Part: '+i['broadcast_part']
-            if i['last_part'] == 'true':
-                part += ' - Last Part'
+            if 'last_part' in i.keys():
+                if i['last_part'] == 'true':
+                    part += ' - Last Part'
             started = i['start_time']
             created = i['created_on']
             thumb = i['image_url_medium']
@@ -328,6 +329,14 @@ def getVideos(name):
             desc = part+'\nStarted: '+started+'\nCreated: '+created
             addLink(title+' - '+part,url,desc,duration,thumb)

+def getSwfUrl(channel_name):
+    """Helper method to grab the swf url, resolving HTTP 301/302 along the way"""
+    base_url = 'http://www.justin.tv/widgets/live_embed_player.swf?channel=%s' % channel_name
+    headers = {'User-agent' : 'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:6.0) Gecko/20100101 Firefox/6.0',
+               'Referer' : 'http://www.justin.tv/'+channel_name}
+    req = urllib2.Request(base_url, None, headers)
+    response = urllib2.urlopen(req)
+    return response.geturl()

def playLive(name):
         try:
@@ -368,7 +377,7 @@ def playLive(name):
                 xbmc.executebuiltin("XBMC.Notification(Jtv,User Token Error - This channel may be privte.,5000,"+ICON+")")
                 return
             rtmp = data[0]['connect']+'/'+data[0]['play']
-            swf = ' swfUrl=http://www.justin.tv/widgets/live_embed_player.swf?channel='+name
+            swf = ' swfUrl=%s swfVfy=1' % getSwfUrl(name)
             Pageurl = ' Pageurl=http://www.justin.tv/'+name
             url = rtmp+token+swf+Pageurl
             item = xbmcgui.ListItem(path=url)
(This post was last modified: 2012-01-16 20:16 by Japz.)
find quote
sam.appletv Offline
Junior Member
Posts: 4
Joined: Jan 2012
Reputation: 0
Post: #476
Hi Divingmule and everyone else, thanks so much for your guys help first of all!

Can someone please let me know what chmode is? I tried the step by step instructions from post #404 as here's what I did:

I am using atv XBMC Eden night build and so I tried it with both downloads of plugins.videojtv-0.2.1.zip and also plugins.video jtv2

I got the updated librtmp. file from 2ndatvuser post earlier in this thread and I also tried downloading it from:

http://pkgs.org/mandriva-cooker/mandriva...6.rpm.html


I then went into private/var/stash/applications/xbmc.frappliance/frameworks/ and replaced the librtmp file.

The only thing I don't understand in post #404 now is "you need to change owner "chown mobile librtmp.0.dylib" Can someone please let me know how to do this? I'm confused at this part.

As of now I do get the justin tv add on on my atv2 and I can view all the contents of it but when I try clicking on something to play, it restarts out of xbmc.. Please help as I think I almost have it.

Thanks in advance!
find quote
divingmule Offline
Skilled Python Coder
Posts: 1,297
Joined: Oct 2008
Reputation: 61
Post: #477
Japz Wrote:I did patch it to properly follow the 301s / 302s for redirects. Here's the patch (includes my last patch to fix view on some archives). If it looks OK, can you include it in the next release?

Looks good, will do. Thanks.
find quote
divingmule Offline
Skilled Python Coder
Posts: 1,297
Joined: Oct 2008
Reputation: 61
Post: #478
@sam.appletv
Quote:The only thing I don't understand in post #404 now is "you need to change owner "chown mobile librtmp.0.dylib" Can someone please let me know how to do this? I'm confused at this part.

I was referring to this post.

newatv2user Wrote:You might need to check and see if the owner of librtmp is mobile. If not you will need to do "chown mobile librtmp.0.dylib".

"chown" is a command to change owner of a file.
Code:
chown user path/to/file
So you would enter this in the terminal.
Code:
chown mobile private/var/stash/applications/xbmc.frappliance/frameworks/librtmp.0.dylib
or
Code:
chown mobile root/applications/XBMC.frappliance/Frameworks/librtmp.0.dylib
Whichever is the correct path.

Then there was this post by Eric_S -
Quote:I made it work without 'Chown'. Note that the librtmp file does not reside in mobile"s path; therefore, mobile need not be made the owner.

So, I'm not sure what is correct or why it would be different for some users. Maybe some others will add to the discussion.
find quote
newatv2user Offline
Senior Member
Posts: 294
Joined: May 2011
Reputation: 27
Post: #479
I think I did chown because when I did "ls -l" everything else was owned by mobile. Based on what you used to copy, it may already be owned by mobile, so you may not need to do that step.

If there is any confusion as to if this is required or not, just make sure to replace the librtmp with newer one. Try to play something. If it does not work, then do the chown step.
find quote
bbdor Offline
Junior Member
Posts: 11
Joined: Feb 2011
Reputation: 0
Post: #480
working in atv2!
find quote
Post Reply