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

+- Kodi Community Forum (http://forum.kodi.tv)
+-- 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


- CrashX - 2010-07-01 15:04

highlandsun Wrote:That was your mistake. Read the pycrypto README, don't just extract directories willy-nilly. You'll never get anywhere if you don't follow directions.

k sorry when I read the forum I assumed it was straight forward copy and didn't realize you have compile the library.

Code:
python setup.py test

I run it on python 2.6 and it gave error but I then again xbmc is using python 2.4 so I should compile with that right ?


- highlandsun - 2010-07-01 15:39

If you're using xbmc's bundled python 2.4, then you should probably just use cryptopy instead. It's pure python and doesn't need to be compiled. *That* one you can simply copy into place.

By the way, please note this wiki http://gitorious.org/xbmc-hulu/pages/Home

We can expand it as needed based on user questions. But since this is the Developers Only thread, I'm not going to address any more user questions here.


- CrashX - 2010-07-01 16:10

highlandsun Wrote:If you're using xbmc's bundled python 2.4, then you should probably just use cryptopy instead. It's pure python and doesn't need to be compiled. *That* one you can simply copy into place.

By the way, please note this wiki http://gitorious.org/xbmc-hulu/pages/Home

We can expand it as needed based on user questions. But since this is the Developers Only thread, I'm not going to address any more user questions here.

Thanks for creating the wiki. Just what we need a clear instructions on how to get xbmc hulu plugin to work .


- jmarshall - 2010-07-05 06:29

@highlandsun: Is there any pros and cons with pycrypto versus cryptopy, other than the obvious (cryptopy being pure python). Just wondering which one XBMC should bundle.

Cheers,
Jonathan


- BrokenCodes - 2010-07-05 22:34

PyCrypto does not work very well with Python Version < 2.6


- highlandsun - 2010-07-05 22:53

And the opposite is also true, CryptoPy needs a bunch of non-functional edits to work with python > 2.4. (It has ISO8859-1 Copyright symbol in its comments, and python 2.6 barfs on them.)

Probably CryptoPy is the easiest, since it requires no target-specific compilation. Somebody just needs to go through and clean up the header comment in every single file. kreach already did this in his first build of xbmc-hulu, but he didn't split it out into its own package. It's not a big deal to fix.


- jmarshall - 2010-07-05 23:39

Thanks - I presume that there's no speed issue at all with cryptopy either way (or at least nothing that really makes a big enough difference in practice.)

If so, I agree cryptopy is the easier way to go as we can just pop it in the repo and not bother having more stuff cluttering up SVN Smile

Cheers,
Jonathan


- theuni - 2010-07-06 03:50

Committed to the addons repo. Any addon needing CryptoPy may now add it as a requirement, and it will be fetched automatically.

Code:
<import addon="script.module.cryptopy" version="1.2.5" />

TheUni


- highlandsun - 2010-07-06 08:17

theuni Wrote:Committed to the addons repo. Any addon needing CryptoPy may now add it as a requirement, and it will be fetched automatically.

Code:
<import addon="script.module.cryptopy" version="1.2.5" />

TheUni

That's very cool. Is there a a particular place in addon.xml that the above line needs to be?


- highlandsun - 2010-07-06 08:21

On a completely different note, for folks wanting to watch Hulu on their Android phones, there's no need to wait for Adobe to give you Flash 10.1. See this youtube video for the demo

http://www.youtube.com/watch?v=F7lWLjtrbR0

The scripts it uses are posted here

http://forum.xda-developers.com/showpost.php?p=7056836&postcount=34

It uses the same core as the get-flash-videos Hulu plugin, but uses ffmpeg to fetch the video instead of rtmpdump, and feeds it in to ffserver which converts rtmp to rtsp, and every Android phone can play the resulting rtsp stream.

I've been thinking of converting the xbmc hulu plugin into a CGI instead, it can work as a standalone script for navigating the Hulu videos without all the slowness of the actual Hulu web site.


- jmarshall - 2010-07-06 08:22

It goes in the <requires> tag. There's a bit of info here:

http://wiki.xbmc.org/index.php?title=Addons_for_XBMC#The_.3Crequires.3E_element

Cheers,
Jonathan


- highlandsun - 2010-07-06 08:24

jmarshall Wrote:Thanks - I presume that there's no speed issue at all with cryptopy either way (or at least nothing that really makes a big enough difference in practice.)

If so, I agree cryptopy is the easier way to go as we can just pop it in the repo and not bother having more stuff cluttering up SVN Smile

Cheers,
Jonathan

Right, there's no speed issue in the context of the Hulu plugin. The crypto stuff is only needed to decode one or two keys and one XML file. The bulk crypto stuff (e.g. rtmpe) is handled by librtmp.


- linuxluemmel - 2010-07-12 09:29

Today I found this
http://lifehacker.com/5583515/access-hulu-from-outside-the-us-without-a-proxy-server
This may could help to make a better plugin.


- schmoko - 2010-07-22 07:37

I've started to update this plugin to handle Hulu's website redesign. It seems like things are actually laid out much better now, but my experience with scrapers is nil and python is new to me. its not going super smooth. I've gotten categories going so far.

I havent seen any check-ins on gitorious-- is anyone else working on this? I'm sure it's much less work for someone with experience. I don't want to be reinventing the wheel.


Porting to PS3 Media Server - vinaykagarwal - 2010-08-01 18:56

Hello,
Thanks to all for this wonderful plugin. I am attempting to port it to PS3 Media Server (in Java). I can get the url of the rtmp just fine (newUrl of stream_hulu.py) but I can't seem to get the stream to download using rtmpdump (version dated 2010-06-30 on Windows Vista 32 bit). For example, for the following url

PHP Code:
rtmpe://hulufs.fplive.net/hulu/722/50066722 app=hulu/722/50066722?token=c3RhcnRfdGltZT0yMDEwMDgwMTE2NTAzOCZlbmRfdGltZT0yMDEwMDgwMTE2NTMzO​CZkaWdlc3Q9MDAwMGZmZGM0ZmFiYmUyNzc2Mjk1YTcwZDRjODYzNzM=&mbr=1&hgt=4n-YbUiJKrST3eesorcdbFmJ1ECv1X4shmDE1SFKfkDAaNvuPSVQbpc8iGgyOPl7ejH0qG8gUqXsGoDTrEC​2LiVIZDwjWnLdC8xaqi6J9_N-1VSe4X9oT4Leg6s8_VQ7eJuTNVkHAlvu05o--hiYSftiaPsiZkwB0Xjlgrj9pFjVLi7BD_ZrTW2NDC50O0daPhnoRhPIBVpn0e59hzuh4g==&hgt_ver=331370278 swfurl=http://www.hulu.com/player.swf playpath=HuluTranscode_180083_470503_852966_FLV_400 pageurl=http://www.hulu.com/watch/163631/moonbase#http%3A%2F%2Fwww.hulu.com%2Ffeed%2Frecent%2Fmovies%3Frd%3D0 

I get the following errors (verbose log below, debug log was too large to attach)
PHP Code:
WARNINGHandShakeType mismatchclient sent 6server answered 8
INFO
Connected...
ERRORClosing connectionNetStream.Failed 

Any help would be really appreciated.
Vinay Agarwal

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 50066722 app=hulu/722/50066722?token=c3RhcnRfdGltZT0yMDEwMDgwMTE2NTAzOCZlbmRfdGltZT0yMDEwMDgwMTE2NTMzOCZkaWdlc3Q9MDAw​MGZmZGM0ZmFiYmUyNzc2Mjk1YTcwZDRjODYzNzM=&mbr=1&hgt=4n-YbUiJKrST3eesorcdbFmJ1ECv1X4shmDE1SFKfkDAaNvuPSVQbpc8iGgyOPl7ejH0qG8gUqXsGoDTrEC​2LiVIZDwjWnLdC8xaqi6J9_N-1VSe4X9oT4Leg6s8_VQ7eJuTNVkHAlvu05o--hiYSftiaPsiZkwB0Xjlgrj9pFjVLi7BD_ZrTW2NDC50O0daPhnoRhPIBVpn0e59hzuh4g==&hgt_ver=331370278 swfurl=http://www.hulu.com/player.swf playpath=HuluTranscode_180083_470503_852966_FLV_400 pageurl=http://www.hulu.com/watch/163631/moonbase#http://www.hulu.com/feed/recent/movies?rd=0
DEBUGtcUrl    rtmpe://hulufs.fplive.net:1935/hulu/722
DEBUGapp      hulu/722
DEBUG
live     no
DEBUG
timeout  30 sec
DEBUG
Setting buffer time to36000000ms
Connecting 
...
DEBUGRTMP_Connect1, ... connectedhandshaking
DEBUG
HandShakeClient type06
DEBUG
HandShakeDH pubkey position166
DEBUG
HandShakeClient digest offset879
DEBUG
HandShakeInitial client digest
DEBUG3f ac 18 9f 08 3e e3 90 00 a6 97 8a 7d 39 4d 67
DEBUG
b7 d9 31 82 b8 14 a3 13 5e 0d 68 da 3d ad 26 74
DEBUG
HandShakeType Answer   08
WARNING
HandShakeType mismatchclient sent 6server answered 8
DEBUG
HandShakeServer Uptime 2041132833
DEBUG
HandShakeFMS Version   3.5.2.1
DEBUG
HandShakeServer DH public key offset71
DEBUG
HandShakeSecret key
DEBUG61 7d 09 ef c2 a0 23 0a 19 67 5c 2b e6 c4 6b 0a
DEBUG
1a aa 29 dc a8 00 c9 b9 ac 5b e8 22 79 29 d0 22
DEBUG
fb 0f 97 30 18 62 57 11 2f f9 d7 b6 dc f3 10 b3
DEBUG
1e dc c4 5f 0f 3d 4f e5 03 34 42 da 06 aa bc 4f
DEBUG
32 26 7e cc d8 60 da eb 15 52 55 63 46 34 92 56
DEBUG
8d a5 1b 06 a9 6c 7d 4c ea 9a ca 44 53 01 4b 5b
DEBUG
c1 90 71 0e 09 6d 75 a5 31 70 ed 36 c8 49 2e cb
DEBUG
89 d6 3b a2 f3 35 45 8b 07 06 4b 49 1d c6 4a 9a
DEBUG
RC4 Out Key
DEBUG9d 74 60 30 15 0b 76 a4 e3 17 2a c1 9d 62 df 10
DEBUG
RC4 In Key
DEBUG46 14 ed ff 8d c6 fa b8 dd f3 0d 42 6e 04 eb 1b
DEBUG
HandShakeCalculated digest key from secure key and server digest
DEBUGd1 b9 bc 97 61 a4 19 1c 75 fe 32 6a ca 2f ab 8f
DEBUG
a2 ed 67 b2 9e c9 67 23 89 dc 00 0b 39 33 3a 72
DEBUG
HandShakeClient signature calculated:
DEBUG3e 12 4c 40 ee 83 cd c8 1b 2e 8a 82 47 eb df bb
DEBUG
57 0a 62 03 dd f9 32 64 23 0a 91 12 b9 34 3c 6d
DEBUG
HandShakeServer sent signature:
DEBUGd3 39 31 3a 6f a0 82 97 49 c8 cb 92 25 b0 9f e2
DEBUG
06 41 70 66 06 47 02 55 d5 01 2a 5f ab 0e 53 1b
DEBUG
HandShakeDigest key
DEBUG07 40 7e c3 71 bb 21 10 f6 fc 7a b5 e6 0e d0 b6
DEBUG
da 0b db b6 11 a6 cd e1 60 cd 42 ef 63 b5 2a 7f
DEBUG
HandShakeSignature calculated:
DEBUGd3 39 31 3a 6f a0 82 97 49 c8 cb 92 25 b0 9f e2
DEBUG
06 41 70 66 06 47 02 55 d5 01 2a 5f ab 0e 53 1b
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 play50066722 app=hulu/722/50066722?token=c3RhcnRfdGltZT0yMDEwMDgwMTE2NTAzOCZlbmRfdGltZT0yMDEwMDgwMTE2NTMzOCZkaWdlc3Q9MDAw​MGZmZGM0ZmFiYmUyNzc2Mjk1YTcwZDRjODYzNzM=&mbr=1&hgt=4n-YbUiJKrST3eesorcdbFmJ1ECv1X4shmDE1SFKfkDAaNvuPSVQbpc8iGgyOPl7ejH0qG8gUqXsGoDTrEC​2LiVIZDwjWnLdC8xaqi6J9_N-1VSe4X9oT4Leg6s8_VQ7eJuTNVkHAlvu05o--hiYSftiaPsiZkwB0Xjlgrj9pFjVLi7BD_ZrTW2NDC50O0daPhnoRhPIBVpn0e59hzuh4g==&hgt_ver=331370278 swfurl=http://www.hulu.com/player.swf playpath=HuluTranscode_180083_470503_852966_FLV_400 pageurl=http://www.hulu.com/watch/163631/moonbase#http://www.hulu.com/feed/recent/movies?rd=0
DEBUGInvoking 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:    dlMAW1Wa>
DEBUG: (object end)
DEBUG: (object end)
DEBUGHandleInvokeserver invoking <onStatus>
DEBUGHandleInvokeonStatusNetStream.Failed
ERROR
Closing connectionNetStream.Failed
DEBUG
Closing connection