XBMC Community Forum
Hulu Plugin Development Thread - Developers only! - Printable Version

+- XBMC Community Forum (http://forum.xbmc.org)
+-- Forum: Development (/forumdisplay.php?fid=32)
+--- Forum: Python Add-on Development (/forumdisplay.php?fid=26)
+--- Thread: Hulu Plugin Development Thread - Developers only! (/showthread.php?tid=45888)

Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19


- maruchan - 2010-08-09 15:15

What does the URL of a Plus stream look like? Is it possible to guess/create the URL based on information we already have? I ask because, if you look at a series XML listing, there are a couple of nodes that let you know if Plus content is available:

<has_plus_tv>True</has_plus_tv>
<has_plus_mobile>True</has_plus_mobile>

So, even if HuluDesktop hasn't been updated to include Plus content, is it possible, using the PID, EID, or ID, to put together the Plus URL? Obviously you'd still need the proper cookie as well.


- BlueCop - 2010-08-09 15:50

maruchan Wrote:<has_plus_tv>True</has_plus_tv>
<has_plus_mobile>True</has_plus_mobile>

hulu plus has 3 content tiers. Different content available in each tier. Mobile is of course iphone, android etc. TV is PS3 streaming(and i assume 360, wii ect if it comes). Then there is web where everything is available.
those 'has plus' tags just signify which tiers the content is available in.

which url do you mean? pretty much everything is exactly the same except you need to the right cookies to get the hulu plus smil.

I thought you needed the hulu sessionid in the rtmp url but that isn't actually required even though the real hulu client uses it.

I haven't looked closely has the huludesktop feeds yet. I will do that now.

I have an iphone running the hulu plus app that I am setting it up through a proxy today to take a look at what listings it grabs.

Update
found several feeds for hulu plus used by the iphone. They are just different feed numbers.


- thebitjockey - 2010-08-09 20:16

BlueCop Wrote:I am using google code.
http://code.google.com/p/bluecop-xbmc-repo/
zip to install for repo
http://bluecop-xbmc-repo.googlecode.com/files/repository.bluecop.xbmc-plugins.zip

Hope you don't mind, I added this to the Unofficial Repositories Wiki Page.


- sethjvm - 2010-08-10 05:46

I appreciate your work on this BlueCop. I don't know how you stay motivated to do this when it seems like every time you figure out what Hulu is doing, they change what they do and you need to fix it.

Thank you.


- vinaykagarwal - 2010-08-11 14:45

highlandsun Wrote:Unfortunately the rtmpdump command line doesn't accept the same syntax that librtmp uses. You have to use --swfvfy etc., not swfurl= ...

It was my intention to change rtmpdump to use the same unified syntax, but there are a lot of scripts out there using the old rtmpdump syntax so it just hasn't been worth the effort.

Of course, which syntax is valid where is perfectly obvious if you actually read the man pages. That's what they're for, after all...

I read the man page carefully and came up with this command
PHP Code:
rtmpdump -"rtmpe://hulufs.fplive.net/hulu/722/50066722" -"hulu/722/50066722?token=c3RhcnRfdGltZT0yMDEwMDgwMTE2NTAzOCZlbmRfdGltZT0yMDEwMDgwMTE2NTMzO​CZkaWdlc3Q9MDAwMGZmZGM0ZmFiYmUyNzc2Mjk1YTcwZDRjODYzNzM=&mbr=1&hgt=4n-YbUiJKrST3eesorcdbFmJ1ECv1X4shmDE1SFKfkDAaNvuPSVQbpc8iGgyOPl7ejH0qG8gUqXsGoDTrEC​2LiVIZDwjWnLdC8xaqi6J9_N-1VSe4X9oT4Leg6s8_VQ7eJuTNVkHAlvu05o--hiYSftiaPsiZkwB0Xjlgrj9pFjVLi7BD_ZrTW2NDC50O0daPhnoRhPIBVpn0e59hzuh4g==&hgt_ver=331370278" -"http://www.hulu.com/player.swf" -"HuluTranscode_180083_470503_852966_FLV_400" -"http://www.hulu.com/watch/163631/moonbase#http%3A%2F%2Fwww.hulu.com%2Ffeed%2Frecent%2Fmovies%3Frd%3D0" 

But I still get this error
PHP Code:
RTMPDump v2.3
(c2010 Andrej StepanchukHoward ChuThe Flvstreamer TeamlicenseGPL
DEBUG
Parsing...
DEBUGParsed protocol2
DEBUG
Parsed host    hulufs.fplive.net
DEBUG
Parsed app     hulu/722
DEBUG
Protocol RTMPE
DEBUG
Hostname hulufs.fplive.net
DEBUG
Port     1935
DEBUG
Playpath HuluTranscode_180083_470503_852966_FLV_400
DEBUG
tcUrl    rtmpe://hulufs.fplive.net:1935/hulu/722/50066722?token=c3RhcnRfdGltZT0yMDEwMDgwMTE2NTAzOCZlbmRfdGltZT0yMDEwMDgwMTE2NTMzO​CZkaWdlc3Q9MDAwMGZmZGM0ZmFiYmUyNzc2Mjk1YTcwZDRjODYzNzM=&mbr=1&hgt=4n-YbUiJKrST3eesorcdbFmJ1ECv1X4shmDE1SFKfkDAaNvuPSVQbpc8iGgyOPl7ejH0qG8gUqXsGoDTrEC​2LiVIZDwjWnLdC8xaqi6J9_N-1VSe4X9oT4Leg6s8_VQ7eJuTNVkHAlvu05o--hiYSftiaPsiZkwB0Xjlgrj9pFjVLi7BD_ZrTW2NDC50O0daPhnoRhPIBVpn0e59hzuh4g==&hgt_ver=331370278
DEBUGswfUrl   http://www.hulu.com/player.swf
DEBUGpageUrl  http://www.hulu.com/watch/163631/moonbase#http%3A%2F%2Fwww.hulu.com%2Ffeed%2Frecent%2Fmovies%3Frd%3D0
DEBUGapp      hulu/722/50066722?token=c3RhcnRfdGltZT0yMDEwMDgwMTE2NTAzOCZlbmRfdGltZT0yMDEwMDgwMTE2NTMzOCZkaWdlc3Q9MDAw​MGZmZGM0ZmFiYmUyNzc2Mjk1YTcwZDRjODYzNzM=&mbr=1&hgt=4n-YbUiJKrST3eesorcdbFmJ1ECv1X4shmDE1SFKfkDAaNvuPSVQbpc8iGgyOPl7ejH0qG8gUqXsGoDTrEC​2LiVIZDwjWnLdC8xaqi6J9_N-1VSe4X9oT4Leg6s8_VQ7eJuTNVkHAlvu05o--hiYSftiaPsiZkwB0Xjlgrj9pFjVLi7BD_ZrTW2NDC50O0daPhnoRhPIBVpn0e59hzuh4g==&hgt_ver=331370278
DEBUG
live     no
DEBUG
timeout  30 sec
DEBUG
SWFSHA256:
DEBUG24 5b af 56 45 7f 0b 2c 4a da 09 f3 b9 38 de 3d
DEBUG
fb a3 b3 61 6b 43 5a 40 5e 15 e3 69 53 16 6b ef
DEBUG
SWFSize  1347034
DEBUG
Setting buffer time to36000000ms
Connecting 
...
DEBUGRTMP_Connect1, ... connectedhandshaking
DEBUG
HandShakeClient type06
DEBUG
HandShakeDH pubkey position166
DEBUG
HandShakeClient digest offset879
DEBUG
HandShakeInitial client digest
DEBUGd2 65 7f aa f3 96 ab 08 55 39 b7 a4 3b 46 97 99
DEBUG
72 11 93 3d 31 19 a6 29 bb bc 9a 39 cc 85 4c 17
DEBUG
HandShakeType Answer   08
WARNING
HandShakeType mismatchclient sent 6server answered 8
DEBUG
HandShakeServer Uptime 747613669
DEBUG
HandShakeFMS Version   3.5.2.1
DEBUG
HandShakeServer DH public key offset506
DEBUG
HandShakeSecret key
DEBUGa5 8a a6 3c 36 6a 96 6f 9f f6 9f cc 2d 87 cf a4
DEBUG
71 79 af 92 54 ed 95 71 02 91 a7 bb c0 86 d4 b0
DEBUG
51 df 75 36 f0 fb 8c 5b 12 11 40 47 e4 b1 a3 12
DEBUG
1b 96 87 a7 b3 2c 17 dd e0 77 73 d2 7c a3 11 96
DEBUG
7f a1 ff ec f2 69 92 89 50 df d6 c5 69 e3 4e 3d
DEBUG
68 31 2c c8 c4 a6 4d 24 ab ae f7 4d 07 0f 7f 78
DEBUG
11 da 53 b9 ca 57 df 56 1f 39 89 da 85 ce 23 f3
DEBUG
c5 1b a7 af 68 f1 ad bb 42 39 c1 6f d6 38 5d 3a
DEBUG
RC4 Out Key
DEBUGa1 b2 d1 d9 9b 39 8a d4 96 90 c0 b8 e5 06 75 d3
DEBUG
RC4 In Key
DEBUG77 4a 9e 58 a7 1e d2 22 46 32 8f 23 09 c2 ce ee
DEBUG
HandShakeCalculated digest key from secure key and server digest
DEBUG6a 51 2c 3f 73 ef 15 9b 03 99 7e ec d9 74 85 dc
DEBUG
e5 30 08 96 37 b4 c4 20 bd b7 38 e8 c5 5f b2 7e
DEBUG
HandShakeClient signature calculated:
DEBUGb6 8b 90 d3 8a 69 4c 05 d5 a5 10 ea 65 07 d2 77
DEBUG
4f f4 d6 47 63 a2 6e 03 a0 e8 c9 55 9a 5a f7 b6
DEBUG
HandShakeServer sent signature:
DEBUG25 0c 8f 95 32 31 d0 82 ec 2f d5 bb b4 4e 15 b2
DEBUG
19 b7 4d 48 7f 6c 90 0b 7f 32 d1 9f 48 34 a5 12
DEBUG
HandShakeDigest key
DEBUGa2 76 28 c9 bb 3d 7f b9 e1 72 e6 28 6c 14 fd bd
DEBUG
df e9 1f 8f 5a 41 18 31 64 d6 0c 5a be 64 1c 6c
DEBUG
HandShakeSignature calculated:
DEBUG25 0c 8f 95 32 31 d0 82 ec 2f d5 bb b4 4e 15 b2
DEBUG
19 b7 4d 48 7f 6c 90 0b 7f 32 d1 9f 48 34 a5 12
DEBUG
HandShakeGenuine Adobe Flash Media Server
DEBUG
HandShakeHandshaking finished....
DEBUGRTMP_Connect1handshaked
DEBUG
Invoking connect
INFO
Connected...
DEBUGHandleServerBWserver BW 2500000
DEBUG
HandleClientBWclient BW 2500000 2
DEBUG
RTMP_ClientPacketreceivedinvoke 240 bytes
DEBUG
: (object begin)
DEBUG: (object begin)
DEBUGProperty: <Name:             fmsVerSTRING:    FMS/3,5,3,863>
DEBUGProperty: <Name:       capabilitiesNUMBER:    127.00>
DEBUGProperty: <Name:               modeNUMBER:    1.00>
DEBUG: (object end)
DEBUG: (object begin)
DEBUGProperty: <Name:              levelSTRING:    status>
DEBUGProperty: <Name:               codeSTRING:    NetConnection.Connect.Success>
DEBUGProperty: <Name:        descriptionSTRING:    Connection succeeded.>
DEBUGProperty: <Name:     objectEncodingNUMBER:    0.00>
DEBUGProperty: <Name:               dataOBJECT>
DEBUG: (object begin)
DEBUGProperty: <Name:            versionSTRING:    3,5,3,863>
DEBUG: (object end)
DEBUG: (object end)
DEBUG: (object end)
DEBUGHandleInvokeserver invoking <_result>
DEBUGHandleInvokereceived result for method call <connect>
DEBUGsending ctrltype0x0003
DEBUG
Invoking createStream
DEBUG
RTMP_ClientPacketreceivedinvoke 21 bytes
DEBUG
: (object begin)
DEBUGPropertyNULL
DEBUG
: (object end)
DEBUGHandleInvokeserver invoking <onBWDone>
DEBUGInvoking _checkbw
DEBUG
RTMP_ClientPacketreceivedinvoke 29 bytes
DEBUG
: (object begin)
DEBUGPropertyNULL
DEBUG
: (object end)
DEBUGHandleInvokeserver invoking <_result>
DEBUGHandleInvokereceived result for method call <createStream>
DEBUGSendPlayseekTime=0stopTime=0sending playHuluTranscode_180083_470503_852966_FLV_400
DEBUG
Invoking play
DEBUG
sending ctrltype0x0003
DEBUG
RTMP_ClientPacketreceivedinvoke 16419 bytes
DEBUG
: (object begin)
DEBUGPropertyNULL
DEBUG
: (object end)
DEBUGHandleInvokeserver invoking <_onbwcheck>
DEBUGInvoking _result
DEBUG
RTMP_ClientPacketreceivedinvoke 133 bytes
DEBUG
: (object begin)
DEBUGPropertyNULL
DEBUG
: (object begin)
DEBUGProperty: <Name:              levelSTRING:    error>
DEBUGProperty: <Name:               codeSTRING:    NetStream.Failed>
DEBUGProperty: <Name:        descriptionSTRING:    Failed to play  (stream ID1).>
DEBUGProperty: <Name:           clientidSTRING:    IrEwGSaJ>
DEBUG: (object end)
DEBUG: (object end)
DEBUGHandleInvokeserver invoking <onStatus>
DEBUGHandleInvokeonStatusNetStream.Failed
ERROR
Closing connectionNetStream.Failed
DEBUG
Closing connection



- BlueCop - 2010-08-11 15:09

I got full listings for plus content working using the huludesktop feed numbers. I needed to add some new parameters to get complete listings.

I have been mapping out various xml feeds with a couple scripts. I am trying to figure out what they all are. active ranges for the curious (1-4,133-150,6586-10407)
These feeds can be extremely useful for listing content in various ways. I will try to post my feed findings when complete.

sethjvm: don't thank me. thank highlandsun and rwparris2. I just like to tinker. they have done all the heavy lifting for us.

vinaykagarwal: doesn't the get flash videos script already do much of what you are attempting? why not just compare the output from it to what you are getting with your code. also the rtmp urls are time sensitive and will expire after a period of time. so don't store results and try to reuse them.
http://gitorious.org/get-flash-videos-plugins/gfv-plugins


- highlandsun - 2010-08-13 01:51

BlueCop Wrote:Thanks maruchan!

would anyone be offended or mind if I hosted this on a beta repository I have been working on? It contains several US centric plug-ins I have been trying to get updated and fixed.(mostly working, nbc is partly broken)

I am using google code.
http://code.google.com/p/bluecop-xbmc-repo/
zip to install for repo
http://bluecop-xbmc-repo.googlecode.com/files/repository.bluecop.xbmc-plugins.zip

would anyone mind moving to the svn for the repo? Users could update directly from XBMC. I can add anyone who wants access to commit.

I got the cookies working correctly for hulu plus. I was manually adding the needed cookies to the header which was ugly. So you can play the 720p for the videos you can list. The problem now is to update the listings to include all the hulu plus content.

No objection from me. I've got no further interest in hulu now, anything I used to watch there is available sooner on other sites.


- thebitjockey - 2010-08-13 18:37

highlandsun Wrote:anything I used to watch there is available sooner on other sites.

Oh come on, you can't say that without shareing Wink


- highlandsun - 2010-08-14 00:56

sidereel.com is a pretty good tv episode search site. Most of the videos they list are from megavideo.com. megavideo.com is certainly familiar for most folks already, I think.


- vinaykagarwal - 2010-08-14 13:22

highlandsun Wrote:sidereel.com is a pretty good tv episode search site. Most of the videos they list are from megavideo.com. megavideo.com is certainly familiar for most folks already, I think.

Is there a plugin that downloads from megavideo?


- Jopplehead - 2010-08-17 06:27

Deleted.


- BlueCop - 2010-08-28 09:00

I just commit an updated hulu plugin to my repo. It lists all hulu plus content right now. I am working in filtering this out for non plus members. I removed all the old rss feeds and listings. I tried to simplify by using other available feeds. Subtitles don't work right because I am not sure how to assign a list item a subtitle file when returning with setresolveurl. I added Auto quality for 720p streams. Non plus member should be able to play the non plus content listed.

I am working of full subscriptions and queue support integrated in the plugin. Since I removed rss stuff the old subscriptions and queue are missing here. I am adding them back using a different method and will have full access and not the the first 20 items. Sorry for moving slow on this.

Highlandsun: they seem to be adding 1000kbit streams again for a few weeks some shows seemed to only have 650kbit but their new episodes don't seem to suffer from this.


- keeganl - 2010-09-22 16:32

I have to start of by saying WOW. Thank you guys for putting in the time to have this work and work quite well. The video is incredible and doesn't suffer from the stutter issues in Linux that Hulu Desktop and Boxee do, so thank you again. I have a question about control options. As I am unfamiliar with skinning, I'm not sure if this is a plugin control or if it's a skinning control, but when watching a video from Hulu, if you press chapter skip forward or backward, the video locks up. The fast forward and rewind seem to work just fine, but I guess since there are no chapters in these videos, it confuses the video player. My question is this, is there a way to block the chapter forward and chapter back command when watching videos from this plugin?

Another possible suggestion is, Some of the shows are pulled from Hulu as only the episode name. Is it possible to cross-reference the show Title and the episode name in the TVDB and pull all the extra information for that episode? That would be incredible.

Don't let my comments fool you, I greatly appreciate the work being put in to this project and will enjoy it as long as I can.


- BlueCop - 2010-09-22 16:40

keeganl: This is more a development thread and not a support thread. if you wouldn't mind posting to my repo thread because it is easier to manage.

This thread was more used for development talk but I have taken over development myself.

Any problem reports need xbmc version and logs from when the problem is happening is possible. I can't comment on the problem you are experiencing with skip because I don't have that problem.

I need specific examples of what episodes you are talking about. It is most likely a bug in my naming system because most everything has full meta data from the feeds. So please refer to specific examples and not generalities.


- BlueCop - 2011-01-12 20:39

So hulu has rolled out a new system. (I just noticed a new hulu job posting yesterday for a senior security administrator by the way)

I have been working on updates for the new security on the grabbing smil files. They are now signing requests with code in sec_as3.swf
I have it mostly figured out but I can't get a look at the signing code in sec_as3.swf

video_id = content id of video
v = sec_as3.swf version
ts = ? (seems to be a constant)
np = ? (seems to always be 1)
vp = ? (seems to always be 1)
device_id = computerGUID
pp = distroPlatform
dp_id = partner
bcs= signature generated by generateSignatureToCSEL in sec_as3.swf. It uses a sorted list of parameters to generate this signature.

So I have tried to steward the plug-in and keep it functional but I am at a wall here.

My only option I know to move forward right now is to attempt to guess the signing method because if I decompress the sec_as3.swf with flasm then I can see some keys in the clear in a hex editor. I also can get many function names so know the standards used. I am pretty sure they use http://code.google.com/p/as3crypto/ for their crypto so that limits the possible algorithms. attempting to load any of the action script from sec_as3.swf crashes everything I have tried so far. I tried various trials for commercial flash decompilers too.

any input or help is greatly appreciated.

Update: just did some testing and the smil encryption is still the same. So really the only thing missing is the generateSignatureToCSEL way to make signatures. (which I think means generate signature to content selection)

Update 2: Success!! after some guidance I was able to replicate the signing. I just have to implement the changes in hulu addon now and we should be set.