A little help on Addon would be appreciated
#1
Hey guys,

So first let me say I'm not familiar how to setup RTMP video addons and I believe that is what this is (coming from my Wireshark output), but here goes nothing.

I just started working on a Futurama Addon for Comedy Central, this is a very rough draft and does not have any fine visual and performance tweaks yet:

https://github.com/jness/plugin.video.fu...default.py

The issue I'm having is pulling on the Stream which I believe to be in this blob of HTML (from Comedy Central site):

[HTML]
<object id="full_ep_video_player" type="application/x-shockwave-flash" classid="clsidBig Grin27CDB6E-AE6D-11cf-96B8-444553540000" width="768" height="432" xmlns:media="http://search.yahoo.com/searchmonkey/media/" rel="media:video" resource="http://media.mtvnservices.com/mgid:cms:fullepisode:comedycentral.com:343175" xmlns:dc="http://purl.org/dc/terms/">
<param name="movie" value="http://media.mtvnservices.com/mgid:cms:fullepisode:comedycentral.com:343175"/>
<param name="wmode" value="opaque"/>
<param name="bgcolor" value="#000000"/>
<param name="seamlesstabbing" value="true"/>
<param name="swliveconnect" value="true"/>
<param name="allowscriptaccess" value="always"/>
<param name="allownetworking" value="all"/>
<param name="allowfullscreen" value="true"/>
<param name="flashvars" value="page not found&amp;autoPlay=true&amp;configParams=site%3Dcomedycentral.com"/>
[/HTML]

I've been able to download the resource (http://media.mtvnservices.com/mgid:cms:f...com:343175) using wget and a proper user-agent and it appears to be a valid Flash content (most likely partial as I did not use rtmp functions):

Code:
$ file tmp.movie
tmp.movie: Macromedia Flash data (compressed), version 10

However when I run this addon I get the following in my xbmc.log:

Code:
09:27:16 T:2957742080 M:651608064  NOTICE: -->Python Interpreter Initialized<--
09:27:16 T:2957742080 M:650354688  NOTICE: Mode: None
09:27:16 T:2957742080 M:650354688  NOTICE: URL: None
09:27:16 T:2957742080 M:650354688  NOTICE: Name: None
09:27:18 T:2957209600 M:649023488  NOTICE: -->Python Interpreter Initialized<--
09:27:18 T:2957209600 M:649007104  NOTICE: Mode: 1
09:27:18 T:2957209600 M:649007104  NOTICE: URL: http://www.comedycentral.com/full-episodes/futurama
09:27:18 T:2957209600 M:649007104  NOTICE: Name: Futurama
09:27:18 T:2957209600 M:649007104  NOTICE: http://www.comedycentral.com/full-episodes/futurama
09:27:20 T:2957209600 M:648720384  NOTICE: -->Python Interpreter Initialized<--
09:27:21 T:2957209600 M:648630272  NOTICE: Mode: 2
09:27:21 T:2957209600 M:648630272  NOTICE: URL: http://www.comedycentral.com/full-episodes/futurama/607-the-late-philip-j--fry
09:27:21 T:2957209600 M:648630272  NOTICE: Name: 607-the-late-philip-j--fry
09:27:21 T:2957209600 M:648630272  NOTICE: http://www.comedycentral.com/full-episodes/futurama/607-the-late-philip-j--fry
09:27:21 T:2957209600 M:648630272   ERROR:  EndOfDirectory - called with an invalid handle.
09:27:21 T:2689963328 M:648695808  NOTICE: DVDPlayer: Opening: http://media.mtvnservices.com/mgid:cms:fullepisode:comedycentral.com:343175
09:27:21 T:2689963328 M:648695808 WARNING: CDVDMessageQueue(player)::Put MSGQ_NOT_INITIALIZED
09:27:21 T:2955046912 M:648687616  NOTICE: Creating InputStream
09:27:22 T:2955046912 M:648302592  NOTICE: Creating Demuxer
09:27:22 T:2955046912 M:647643136   ERROR: Open - Error, could not open file http://media.mtvnservices.com/mgid:cms:fullepisode:comedycentral.com:343175
09:27:22 T:2955046912 M:647643136   ERROR: OpenDemuxStream - Error creating demuxer
09:27:22 T:2955046912 M:647643136  NOTICE: CDVDPlayer::OnExit()
09:27:22 T:2955046912 M:647639040  NOTICE: CDVDPlayer::OnExit() deleting input stream
09:27:22 T:2689963328 M:648077312  NOTICE: CDVDPlayer::CloseFile()
09:27:22 T:2689963328 M:648077312 WARNING: CDVDMessageQueue(player)::Put MSGQ_NOT_INITIALIZED
09:27:22 T:2689963328 M:648077312  NOTICE: DVDPlayer: waiting for threads to exit
09:27:22 T:2689963328 M:648126464  NOTICE: DVDPlayer: finished waiting

Anyone got thoughts?
Reply
#2
You have a little more work to do, it's not gonna be that easy Wink

The comedy central site uses RTMP streaming. At some point your browser will make a request to this url:

Code:
http://www.comedycentral.com/global/feeds/entertainment/media/mediaGenEntertainment.jhtml?uri=mgid%3Acms%3Afullepisode%3Acomedycentral.com%3A389806

It should return an XML document like this:

Code:
<package version="1.4">

<video>    
<item startTime="0">

<rendition cdn="akamai" duration="521" width="512" height="288" type="video/mp4" bitrate="450">
<src>rtmpe://cp9950.edgefcs.net/ondemand/mtvnorigin/gsp.comedystor/com/futurama/full_episodes/futurama_607_act2_rev_512x288_450.mp4</src>
</rendition>

<rendition cdn="akamai" duration="521" width="768" height="432" type="video/mp4" bitrate="640">
<src>rtmpe://cp9950.edgefcs.net/ondemand/mtvnorigin/gsp.comedystor/com/futurama/full_episodes/futurama_607_act2_rev_768x432_640.mp4</src>
</rendition>

<rendition cdn="akamai" duration="521" width="768" height="432" type="video/mp4" bitrate="960">
<src>rtmpe://cp9950.edgefcs.net/ondemand/mtvnorigin/gsp.comedystor/com/futurama/full_episodes/futurama_607_act2_rev_768x432_960.mp4</src>
</rendition>

<rendition cdn="akamai" duration="521" width="768" height="432" type="video/mp4" bitrate="1300">
<src>rtmpe://cp9950.edgefcs.net/ondemand/mtvnorigin/gsp.comedystor/com/futurama/full_episodes/futurama_607_act2_rev_768x432_1300.mp4</src>
</rendition>

<rendition cdn="akamai" duration="521" width="768" height="432" type="video/mp4" bitrate="1720">
<src>rtmpe://cp9950.edgefcs.net/ondemand/mtvnorigin/gsp.comedystor/com/futurama/full_episodes/futurama_607_act2_rev_768x432_1720.mp4</src>
</rendition>

<beacons>

<beacon url="http://imx.comedycentral.com/sitewide/droplets/view_gen.jhtml?itemUrl=cms_item%3A%2F%2Fwww.comedycentral.com%2F389806&amp;tagParams=tag_action%3Dviewed%26" startTime="0" />

</beacons>

<action onEvent="viewed">    
<makeRequest url="http://t.flux.com/tracking.gif?CMU=4CFAFFFF009922C10002FFFFFA4C&amp;CUR=mgid:cms:fullepisode:comedycentral.com:389806&amp;WN=MTVNVideoPlayer&amp;ftg=1"/>
</action>    

</item>

</video>
</package>

You'll have to then pass the RTMP parameters to XBMC to play it. Hope this points you in the right direction.
Reply
#3
Wow jbel,

This certainly helps out!, only question I have is where did you happen to find the URL to that XML (cant seem to find it from the source):

Code:
http://www.comedycentral.com/global/feeds/entertainment/media/mediaGenEntertainment.jhtml?uri=mgid%3Acms%3Afullepisode%3Acomedycentral.com%3A389806

Thanks for the help, and going easy on some of my lacking XBMC knowledge.
Reply
#4
flip387 Wrote:Wow jbel,

This certainly helps out!, only question I have is where did you happen to find the URL to that XML (cant seem to find it from the source):

Code:
http://www.comedycentral.com/global/feeds/entertainment/media/mediaGenEntertainment.jhtml?uri=mgid%3Acms%3Afullepisode%3Acomedycentral.com%3A389806

Thanks for the help, and going easy on some of my lacking XBMC knowledge.

Ah ok, I see this is an example not related to the above. I'll do some more digging and find some sort of XML (maybe this one):

Code:
http://repo.comedycentral.com/feeds/init/comedycentral.com?url=/full-episodes/futurama/610-the-prisoner-of-benda&cmsPageId=
Reply
#5
Think I'm making a bit of progress.

I've found Bluecop's Python source which pulls the same XML from media.mtvnservices.com:

Code:
def PLAYEPISODE(name,url):
        data = getURL(url)
        uri=re.compile('<param name="movie" value="http://media.mtvnservices.com/(.+?)"').findall(data)[0]
        url = 'http://media.mtvnservices.com/player/config.jhtml?uri='+uri+'&group=entertainment&type=network&site=thedailyshow.com'
        data = getURL(url)
        uris=re.compile('<guid isPermaLink="false">(.+?)</guid>').findall(data)
        playlist = xbmc.PlayList(1)
        playlist.clear()
        for uri in uris:
            rtmp = GRAB_RTMP(uri)
            item = xbmcgui.ListItem(name)
            playlist.add(rtmp, item)
        xbmc.Player().play(playlist)
        xbmc.executebuiltin('XBMC.ActivateWindow(fullscreenvideo)')

The URL he is building looks something like:

Code:
http://media.mtvnservices.com/player/config.jhtml?uri=mgid:cms:fullepisode:comedycentral.com:359623&group=entertainment&type=network&site=thedailyshow.com

Seems I'm having issues generating a similar URL.....

I've been trying links similar to the below:

Code:
http://media.mtvnservices.com/player/config.jhtml?uri=mgid:cms:fullepisode:comedycentral.com:351726&group=entertainment&type=normal&site=comedycentral.com
Reply
#6
Getting a bit closer:

Code:
http://media.mtvnservices.com/pmt/e1/players/mgid:cms:fullepisode:comedycentral.com:/context4/config.xml?uri=mgid:cms:fullepisode:comedycentral.com:351726&type=normal&ref=None&geo=US&group=entertainment&
Reply
#7
Bam!! I tracked it down:

http://www.comedycentral.com/global/feed...com:388022

Now just to reproduce these number of steps haha
Reply
#8
Think I got it working:

https://github.com/jness/plugin.video.futurama

I'll have to wait till I get home to test it as it does not seem my Mac XBMC install likes RTMP streams...

If anyone wants to try it out and give some feedback I would appreciate it.
Reply
#9
Ok, so I've done some testing from my home XBMC box and everything works great... Until RTMP tries to communicate:

Code:
17:24:29 T:3079337856 M:1266855936  NOTICE: Created m_glPixmapTexture (49)
17:25:29 T:2911894384 M:1264631808   ERROR: RTMP_ReadPacket, failed to read RTMP packet header
17:25:34 T:2791660400 M:1264275456 WARNING: CDVDMessageQueue(audio)::Get - asked for new data packet, with nothing available
17:25:34 T:2802150256 M:1264332800 WARNING: CDVDMessageQueue(video)::Get - asked for new data packet, with nothing available
17:25:34 T:2911894384 M:1264332800  NOTICE: CDVDPlayer::OnExit()
17:25:34 T:2911894384 M:1264332800  NOTICE: DVDPlayer: eof, waiting for queues to empty

I'm going to do some research on this, but if anyone has some quick answers I would appreciate it Smile

A little more to go on, I was replacing rtmpe to rtmp, but when reverting back to rtmpe I receive:

Code:
17:29:44 T:3079337856 M:1283801088 WARNING: HandShake: Type mismatch: client sent 6, server answered 9
17:29:44 T:3079337856 M:1283903488 WARNING: HandShake: Server not genuine Adobe!
17:29:44 T:3079337856 M:1283903488   ERROR: RTMP_Connect1, handshake failed.

Found this.... http://forum.xbmc.org/showpost.php?p=735...stcount=88
Reply
#10
Tried rebuilding the latest librtmp trunk but still getting an error:

Code:
17:56:18 T:2911894384 M:1250398208   ERROR: WriteN, RTMP send error 32 (42 bytes)
17:56:18 T:2911894384 M:1250398208   ERROR: RTMP_ReadPacket, failed to read RTMP packet header
17:56:26 T:2812640112 M:1250635776 WARNING: CDVDMessageQueue(audio)::Get - asked for new data packet, with nothing available
17:56:26 T:2802150256 M:1250635776 WARNING: CDVDMessageQueue(video)::Get - asked for new data packet, with nothing available

Rebuilding was suggested http://code.google.com/p/bluecop-xbmc-re...?id=28#c13
Reply
#11
great work.

I have written a comedy central add-in to my free cable plug-in. I haven't posted it yet because I was just planning a big release once I get all the planned sites done. I was playing some futurama episodes yesterday without much issue though. are you sure you installed the new librtmp in the correct place?
Reply
#12
BlueCop Wrote:great work.

I have written a comedy central add-in to my free cable plug-in. I haven't posted it yet because I was just planning a big release once I get all the planned sites done. I was playing some futurama episodes yesterday without much issue though. are you sure you installed the new librtmp in the correct place?

I'm pretty sure I did as the error message went from:

Code:
17:29:44 T:3079337856 M:1283801088 WARNING: HandShake: Type mismatch: client sent 6, server answered 9

to:

Code:
17:56:18 T:2911894384 M:1250398208   ERROR: WriteN, RTMP send error 32 (42 bytes)
17:56:18 T:2911894384 M:1250398208   ERROR: RTMP_ReadPacket, failed to read RTMP packet header

However I would expect some link breakage (shared libs) as XBMC was compiled against the base librtmp, but I just threw in a new one without recompiling XBMC (this is XBMC Live)

I followed the steps mentioned in http://code.google.com/p/bluecop-xbmc-re...?id=28#c13 to download the source deb pkg and merge it with the latest svn trunk (using rsync)

I'm sure I must be missing something as you are not running in to problems..
Reply
#13
Also as mentioned early in the thread I've never worked with the RTMP protocol so I may be missing a step where I initiate RTMP or something. (I'm not sure if its some time of three way handshake where I need to provide a key or communicate option).
Reply
#14
I had not looked at your code yet but it seems you aren't enabling swf verify.

my final stacked url for an episode looks like
Quote:stack://rtmpe://cp9950.edgefcs.net/ondemand/mtvnorigin/gsp.comedystor/com/futurama/full_episodes/futurama_607_act1_rev_768x432_1720.mp4 swfurl=http://media.mtvnservices.com/player/prime/mediaplayerprime.1.6.0.swf swfvfy=true , rtmpe://cp9950.edgefcs.net/ondemand/mtvnorigin/gsp.comedystor/com/futurama/full_episodes/futurama_607_act2_rev_768x432_1720.mp4 swfurl=http://media.mtvnservices.com/player/prime/mediaplayerprime.1.6.0.swf swfvfy=true , rtmpe://cp9950.edgefcs.net/ondemand/mtvnorigin/gsp.comedystor/com/futurama/full_episodes/futurama_607_act3_rev_768x432_1720.mp4 swfurl=http://media.mtvnservices.com/player/prime/mediaplayerprime.1.6.0.swf swfvfy=true , rtmpe://cp9950.edgefcs.net/ondemand/mtvnorigin/gsp.comedystor/com/futurama/full_episodes/futurama_607_act4_rev_768x432_1720.mp4 swfurl=http://media.mtvnservices.com/player/prime/mediaplayerprime.1.6.0.swf swfvfy=true

It plays without issue.

edit: also it isn't needed to replace rtmpe to rtmp. librtmp supports rtmpe is almost all cases. The CDNs used to be very loose on how they would let you connect to the server but they are limiting it much more. some won't allow unencrypted connections or older handshakes even if encrypted.
Reply
#15
BlueCop Wrote:I had not looked at your code yet but it seems you aren't enabling swf verify.

my final stacked url for an episode looks like


It plays without issue.

edit: also it isn't needed to replace rtmpe to rtmp. librtmp supports rtmpe is almost all cases. The CDNs used to be very loose on how they would let you connect to the server but they are limiting it much more. some won't allow unencrypted connections or older handshakes even if encrypted.

I knew you would be the guys to talk to Wink

I'll let you know how this goes.

Thanks a lot!
Reply

Logout Mark Read Team Forum Stats Members Help
A little help on Addon would be appreciated0