Kodi Community Forum
[RELEASE] Justin.tv (Video) Plugin - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Support (https://forum.kodi.tv/forumdisplay.php?fid=33)
+--- Forum: Add-on Support (https://forum.kodi.tv/forumdisplay.php?fid=27)
+---- Forum: Video Add-ons (https://forum.kodi.tv/forumdisplay.php?fid=154)
+---- Thread: [RELEASE] Justin.tv (Video) Plugin (/showthread.php?tid=51981)



- flip387 - 2011-08-27

I was trying with the latest compile of rtmpdump and have been getting the below issue:

Code:
DEBUG: Invoking deleteStream
ERROR: RTMP_ReadPacket, failed to read RTMP packet header
DEBUG: Closing connection.

Full Output
Code:
$ /usr/local/bin/rtmpdump -r "rtmp://199.9.252.15/app/jtv_tBpjfk26PMv7ZD3" --jtv "f60d3e9b9da4cececb871600d96c66ddaed31113:{"swfDomains": ["justin.tv", "jtvx.com", "xarth.com", "twitchtv.com", "twitch.tv", "wdtinc.com", "imapweather.com", "facebook.com", "starcrafting.com"], "streamName": "jtv_tBpjfk26PMv7ZD3x", "expiration": 1314466854.9669859, "server": "video81-1"}" --swfUrl "http://www-cdn.justin.tv/widgets/live_site_player.re4f81e801f499ee95df36af93931c8901d2c08bf.swf" -o justintv.flv -V
RTMPDump v2.4
(c) 2010 Andrej Stepanchuk, Howard Chu, The Flvstreamer Team; license: GPL
DEBUG: Protocol : RTMP
DEBUG: Hostname : 199.9.252.15
DEBUG: Port     : 1935
DEBUG: Playpath : jtv_tBpjfk26PMv7ZD3
DEBUG: tcUrl    : rtmp://199.9.252.15:1935/app
DEBUG: swfUrl   : http://www-cdn.justin.tv/widgets/live_site_player.re4f81e801f499ee95df36af93931c8901d2c08bf.swf
DEBUG: app      : app
DEBUG: live     : no
DEBUG: timeout  : 0 sec
DEBUG: Setting buffer time to: 36000000ms
Connecting ...
DEBUG: RTMP_Connect1, ... connected, handshaking
DEBUG: HandShake: Type Answer   : 03
DEBUG: HandShake: Server Uptime : 96850052
DEBUG: HandShake: FMS Version   : 3.0.1.1
DEBUG: HandShake: Handshaking finished....
DEBUG: RTMP_Connect1, handshaked
DEBUG: Invoking connect
INFO: Connected...
DEBUG: HandleServerBW: server BW = 2500000
DEBUG: HandleClientBW: client BW = 2500000 2
DEBUG: HandleCtrl, received ctrl. type: 0, len: 6
DEBUG: HandleCtrl, Stream Begin 0
DEBUG: HandleChangeChunkSize, received: chunk size change to 4096
DEBUG: RTMP_ClientPacket, received: invoke 259 bytes
DEBUG: (object begin)
DEBUG: (object begin)
DEBUG: Property: <Name:             fmsVer, STRING:     FMS/3,5,4,210>
DEBUG: Property: <Name:       capabilities, NUMBER:     31.00>
DEBUG: Property: <Name:               mode, NUMBER:     1.00>
DEBUG: (object end)
DEBUG: (object begin)
DEBUG: Property: <Name:              level, STRING:     status>
DEBUG: Property: <Name:               code, STRING:     NetConnection.Connect.Success>
DEBUG: Property: <Name:        description, STRING:     Connection succeeded.>
DEBUG: Property: <Name:               data, OBJECT>
DEBUG: (object begin)
DEBUG: Property: <Name:            version, STRING:     3,5,4,210>
DEBUG: (object end)
DEBUG: Property: <Name:           clientid, NUMBER:     1176506769.00>
DEBUG: Property: <Name:     objectEncoding, NUMBER:     0.00>
DEBUG: (object end)
DEBUG: (object end)
DEBUG: HandleInvoke, server invoking <_result>
DEBUG: HandleInvoke, received result for method call <connect>
DEBUG: Invoking releaseStream
DEBUG: Invoking FCPublish
DEBUG: Invoking createStream
DEBUG: RTMP_ClientPacket, received: invoke 29 bytes
DEBUG: (object begin)
DEBUG: Property: NULL
DEBUG: (object end)
DEBUG: HandleInvoke, server invoking <_result>
DEBUG: HandleInvoke, received result for method call <createStream>
DEBUG: Invoking publish
DEBUG: Invoking FCUnpublish
DEBUG: Invoking deleteStream
ERROR: RTMP_ReadPacket, failed to read RTMP packet header
DEBUG: Closing connection.



- WildBill - 2011-08-28

http://apiwiki.justin.tv/mediawiki/index.php/Main_Page
http://community.justin.tv/forums/index.php


- tdhz77 - 2011-09-09

http://api.justin.tv/api/channel/archives/USERNAMEHERE.json

The Justin.tv api allows you to pull the VOD's in JSON.

I just grab the VOD that I want and put it in a .STRM file and open it in XBMC.


Could one make a plugin that grabs the VOD's and put them in a strm file for you?


- biGdada - 2011-09-10

tdhz77 Wrote:http://api.justin.tv/api/channel/archives/USERNAMEHERE.json

The Justin.tv api allows you to pull the VOD's in JSON.

who cares about VOD ? we want to watch LIVE streams....


- WildBill - 2011-09-10

biGdada Wrote:who cares about VOD ? we want to watch LIVE streams....

If you change the archive to show that the live feed But I can't get it to work in a .strm


- biGdada - 2011-09-11

WildBill Wrote:If you change the archive to show that the live feed
I'm not sure i understood you ....


- WildBill - 2011-09-11

biGdada Wrote:I'm not sure i understood you ....

http://api.justin.tv/api/channel/show/USERNAMEHERE.json


- biGdada - 2011-09-11

WildBill Wrote:http://api.justin.tv/api/channel/show/USERNAMEHERE.json
there's no stream address there ...


- k1m0s - 2011-09-11

you add channel name to it, Here is Poker247 for example:

http://api.justin.tv/api/channel/show/poker24h7d.json


- biGdada - 2011-09-11

k1m0s Wrote:you add channel name to it, Here is Poker247 for example:

http://api.justin.tv/api/channel/show/poker24h7d.json
i figured that out, but there is no stream address in resulting json file


- tdhz77 - 2011-09-16

biGdada Wrote:who cares about VOD ? we want to watch LIVE streams....


I get that, but a 30 minute delay or no J.TV until RTMP handshaking gets committed, which looks like is going to take a year...


- divingmule - 2011-09-17

I hammered together an add-on that uses the archived api call. Though a lot of the channels return a http:error 403, I have found it useful(watching a race from yesterday now). So I thought I would share it here. Download zip - http://divingmules-repo.googlecode.com/files/plugin.video.jtv.archives.0.1.zip

The listings seem to only show live channels but you can enter a channel name directly and get the archived clips.

Maybe Stacked can use some of this when he updates the add-on.


- MaxMustermann - 2011-09-17

divingmule Wrote:I hammered together an add-on that uses the archived api call. Though a lot of the channels return a http:error 403, I have found it useful(watching a race from yesterday now). So I thought I would share it here. Download zip - http://divingmules-repo.googlecode.com/files/plugin.video.jtv.archives.zip

The listings seem to only show live channels but you can enter a channel name directly and get the archived clips.

Maybe Stacked can use some of this when he updates the add-on.

Is it possible to send a channelname to your plugin, like plugin://plugin.video.jtv.archives/?play=CHANNELNAME ? I could use that for SportsDevil.

Can you use the information from 'http://api.justin.tv/api/channel/show/CHANNELNAME.json' instead of 'http://api.justin.tv/api/channel/archives/CHANNELNAME.json' to resolve stream urls? I don't know the api, it's just a guess.


- divingmule - 2011-09-17

MaxMustermann Wrote:Is it possible to send a channelname to your plugin, like plugin://plugin.video.jtv.archives/?play=CHANNELNAME ? I could use that for SportsDevil.

I'm not really sure but I'm thinking - plugin://plugin.video.jtv.archives/?mode=2&name=CHANNELNAME should add a directory of archived links.

Quote:Can you use the information from 'http://api.justin.tv/api/channel/show/CHANNELNAME.json' instead of 'http://api.justin.tv/api/channel/archives/CHANNELNAME.json' to resolve stream urls? I don't know the api, it's just a guess.

No but you can do - 'http://usher.justin.tv/find/'+channelname+'.xml?type=live'

Here is a little script to get the rtmpdump of a live stream.
Code:
import urllib,urllib2,re,os
from BeautifulSoup import BeautifulStoneSoup

channelname=str(raw_input('Enter a Channel Name: '))
print channelname
req = urllib2.Request('http://justin.tv/')
response = urllib2.urlopen(req)
link=response.read()
response.close()
match = re.compile('swfobject.embedSWF\("(.+?)"').findall(link)
swf = ' --swfUrl "'+str(match[0])+'"'
req = urllib2.Request('http://usher.justin.tv/find/'+channelname+'.xml?type=live')
req.addheaders = ('Referer', 'http://justin.tv/')
response = urllib2.urlopen(req)
link=response.read()
response.close()
soup = BeautifulStoneSoup(link)
token = ' --jtv "'+soup.token.string.replace('"','\\"')+'"'
connect = 'rtmpdump.exe -r "'+soup.connect.string+'/'+soup.play.string+'"'
rtmpdump = connect+token+swf+' -o "jtv.flv" -v'
#rtmpdump = connect+token+swf+' -o - -v | "C:\\Program Files (x86)\\VideoLAN\\VLC\\vlc.exe" -'



- MaxMustermann - 2011-09-17

how can I pass the token in an xbmc strm file? jtv="..."? I have problems with the whitespaces. Do I also have to escape the quotation marks?