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)
- fvfv - 2010-06-10 22:24
Can you give me simple instructions as to where Am I supposed to place your plugin, but using the AddON Framework ?
Before, with plugins, it would be ~/.xbmc/plugins/video/hulu
Now, I assume is /usr/local/share/xbmc/addons
But what exactly do I put in those folders ?
By looking at how skins and other addons are organized it looks something like
What should I name the folder (com.myhuluplugin.hulu ??)
- peepsalot - 2010-06-15 05:10
I submitted a merge request for adding support of categorical videos. Any questions or comments on my changes?
Also, I just noticed this error on some videos:
Quote:21:43:09 M: 24723456 NOTICE: rtmpe://hulufs.fplive.net/hulu/376/50031376/mp4:HuluTranscode_145696_382108_383977_16x9_24fps_H264_400K.mp4?token=c3RhcnRfdGltZT0yMDEwMDYxNTAyNDMwNSZlbmRfdGltZT0yMDEwMDYxNTAyNDYwNSZkaWdlc3Q9MjQ0ZjQ3NDFkZGEzOTc0NTUyNDM4NjcyY2YxMDRkNTY=
In stream_hulu.py, line 168 the "len" function is being called incorrectly as an attribute of pathSplit
I didn't think it was worth creating another repo and merge request for that fix.
This error occurs for example when trying to view this video:
However, even after fixing that python error, I get a 500 Internal Server Error. I'm not sure if there is something wrong with Hulu, or if the request being sent is bad. I have been getting these 500 errors on a lot of videos lately.
I tried viewing them directly in my desktop browser at hulu.com, and even then I can't view the video, so I guess something is wrong on their end?
- highlandsun - 2010-06-15 06:13
Thanks, I've merged your fixes. Dunno about that American Dad episode, but since it's getting 500 server error that pretty clearly says it's a problem on their end.
- hellguide - 2010-06-17 04:57
I've been trying to get this to compile on OSX for my AppleTV, has anyone made a port yet? I also just bought the Broadcom Crystal HD card to install inside of it to see if it works with doing HD on Hulu. I figure it would work since it provides .H264 acceleration that hulus videos are encoded in. Any help or binary would help me out a ton! Thanks!
- highlandsun - 2010-06-19 09:30
So it looks like they've rolled out yet another new set of scripts for obfuscating their info. Time for someone else to step in and run with this. I've got other things to do...
- BlueCop - 2010-06-20 08:36
Thanks for all your work highlandsun! having a full featured rtmp library is amazing.
anyone actively working on this?
The cat seems to be winning. We need more clever mice.
I have been digging through the action script in the current swfs and I can see what is going on but I have zero experience in hashing or ciphers. I think I can handle all the other changes but I am not sure how to implement what is being done in the getContentId function in loadplayer.swf
I guess I have reading to do.
- BlueCop - 2010-06-20 12:13
I found a way to bypass the need for cid to eid conversion but it is only because they expose the eid in a stupid way. They give the eid in a fail safe embed url. It is just a hack and not really the proper way to fix things. I am also not even sure if the fail safe urls are ubiquitous. anyway hulu could easily remove them.
My understanding how things currently work.
1. Get Content ID or cid flash variables passed to loadplayer.swf
2. Process the cid in function getContentId in loadplayer to get real cid.
3. Convert the cid to eid. This is done with a base64 md5 of the cid + salt key
4. Use eid to build url to grab pid
the rest seems to be the same as it was.
We might be able to grab the pid directly with the proper cid but the way the site seems to always use eid now in my proxy logs. Before we used the cid to build a url that would we could grab the pid directly.
I went through and compared the keys used previously and the ones used now and everything seems to be the same. There is a new key in loadplayer.swf used in the getContentid function though. Also we will need the salt key they attach to the cid for converting to eid. This is present in IVideoMetadata.as in a few of the swfs.
So in summary I think we can get this working again if someone can get the cids processed properly. It is similar to the decrypt pid code and I tried to modify dec.py to work but I am doing something wrong.
Edit: I decided to take a break and watch a little hulu using the method to bypass the cid to eid.
I think there might be more going on now. On several episodes I seem to get 500 internal server errors when retrieving the smil. Other episodes work great and grab the smil fine. There might be more going on then I thought.
- kreach - 2010-06-20 15:40
The 500 issue is known. If you try to watch the same videos in a browser, you will also get the same error.
- BlueCop - 2010-06-20 16:42
kreach I think I was having a different problem because they worked fine in a browser.
I think I found the problem actually. the smil urls need more parameters in order to not get 500 errors. I have done some checking and can confirm that adding some extra parameters seems to fix the 500.
Adding "&np=1&pp=hulu&dp_id=hulu" to the end of the smil url fixed the 500 errors I was having.
after more investigation adding the "&np=1&pp=hulu&dp_id=hulu" will change the format of all smils to a new format. for some reason the server will give you the old format smil when you pass the smil url to server without the extra parameters but not all videos work.
I am working on updating the rtmp code for the new smil format. Once we have that I think all we need is a way to get the proper cid and and using it to build the eid.
I got all the videos working from akamai with the new smils. They added mirrors of almost all videos on akamai to level3 as well. So we now have choices of which server to use really. I can't seem to build the rtmp parameters correctly for level3. I am not sure how to handle the tokens. Normally I would just dump the browser memory to grab the parameters but I can't seem to find a video that will use the level3 servers by default.
Does anyone know any videos that use exclusively level3 or limelight providers? I would like to get the code working correctly with them. I think the easiest way is to dump browser memory and then build the urls to match how they are done.
I searched through the action script for clues but I can only seem to find the old code for smils. I might just need to look harder and not just grep through it.
Edit 2: I got the CID processing working correctly but still having trouble getting the eid from this. I do an md5 of the cid + cidkey and convert the value to base64 but it isn't the value I expected.
Also looking into level3 more and I am seeing sessionids being passed in the rtmp url along with the auth token so we are going to need some more code to get level3 provider working. I think this might be because they are launching pay service and might need session verification.
I have a working play function for stream_hulu but only akamia servers work correctly. It also just grabs the eid from embed failsafe url. I wanted to post a proper version but if I can't figure this out I will just post the hackish code.
Edit 3: I think I got it. I need to remove the leading 'm' from the cid and xor with 3735928559(0xDEADBEEF) before calculating the the md5. I need look into how parseint() works in actionscript.
- BlueCop - 2010-06-22 13:45
I finally got it working. it builds the eid from the cid correctly now
Just so everyone knows there are Doubles of almost all videos. In the Quality selection I added the provider so you can see which stream is from who. only akamai plays now. level3 does not work right because the rtmp parameters are not built right. I have not been able to figure this out. It is failing sending the playpath to the server. it might be a problem in the rtmp url or the playpath.
Never found any limelight videos to try. So i can't comment on that. I included some code that I think handles them but till I find one I won't know.
Also because they are serving these level3 mirrors the auto quality selection might not work as expected because the duplicate qualities and it might choose the wrong provider. I plan to add priority of one provider over another to the settings.
here is my current stream_hulu.py
You should be able to replace the current stream_hulu.py
If anyone can look at the level3 and limelight to try to get those working that would be great.
I am unfamiliar with git or I would have tried to submit something. Also I am tired and going to go roll one up and take a nap.