• 1
  • 9
  • 10
  • 11(current)
  • 12
  • 13
  • 19
Hulu Plugin Development Thread - Developers only!
Based on the New Addons thread info I created a dummy description.xml file and fixed the getSetting invocations, so this plugin works with current SVN HEAD. Haven't committed the changes yet, but they're pretty trivial so far. Hopefully when things settle down there'll be a clean way to detect the XBMC revision number so we can support everything without needing two different versions of the plugin.
Reply
mighty_bombero Wrote:Maruchan,

well not really. I can stream from rtmpgw with vlc, xbmc runs into a timeout when trying to stream via http, though. I would need to investigate how the timeout for http connections can be increased.
All the hard work was done by highlandsun though and he has proposed patches to the rtmp part of xbmc. Once those land in the real build it should work and if the patch is ported to xbox it might even work there.

My patch for librtmp http://trac.xbmc.org/ticket/8971 has been ported to Xbox by exobuzz http://trac.xbmc.org/ticket/9146 and you can get a working Xbox build from his web site.

http://forum.xbmc.org/showpost.php?p=533...tcount=581

Of course you still need python with Crypto support to be able to use the Hulu plugin, but all of the RTMPE support works fine.
Reply
I have some patches to get the plugin working without installing PyCrypto. I'm having trouble understanding how git works, so I'll post them here.
First, for the crypto support needed use CryptoPy from http://sourceforge.net/projects/cryptopy/. However, all the python files need "#coding: utf-8" prepended to them. After you do that, extract the crypto folder to Hulu/resources/lib . Next patch stream_hulu.py with this diff:
PHP Code:
--- Hulu/resources/lib/stream_hulu.py    2010-04-10 14:46:26.000000000 -0400
+++ Hulu2/resources/lib/stream_hulu.py    2010-05-19 15:18:49.000000000 -0400
@@ -6,+6,14 @@
 
import sys
 import binascii
 import struct
-from Crypto.Cipher import AES
-from Crypto.Hash import MD5
+#if struct module does not contain class Struct, use wrapper provided instead
+if not 'Struct' in dir(struct):
+    
import pystruct as struct
+from aes import AES #wrapper around PyCrypto and pure python CryptoPy
+try:
+    
from Crypto.Hash import MD5
+except ImportError:
+    
import md5 as MD5
 from BeautifulSoup import BeautifulSoup
BeautifulStoneSoup
 
 
class Main:
@@ -
29,11 +35,11 @@
         
v3a binascii.unhexlify(v3[0])
         
v3b binascii.unhexlify(v3[1])
 
-        
ecb AES.new(v3bAES.MODE_ECB)
+        
ecb AES(v3b)
         
tmp ecb.decrypt(v3a)
 
         for 
v1 in cp_strings[:]:
-            
ecb AES.new(binascii.unhexlify(v1), AES.MODE_ECB)
+            
ecb AES(binascii.unhexlify(v1))
             
v2 ecb.decrypt(tmp)
             if (
re.match("[0-9A-Za-z_-]{32}"v2)):
                 return 
v2
@@ -63,+69,@@
         for 
key in xmldeckeys[:]:
             
smil=""
             
out=[0,0,0,0]
-            
ecb AES.new(binascii.unhexlify(key[0]), AES.MODE_ECB)
+            
ecb AES(binascii.unhexlify(key[0]))
             
unaes ecb.decrypt(encdata)
 
             
packer struct.Struct("iiii"
And also add pystruct.py and aes.py to Hulu/resources/lib. pystruct.py is needed because the struct module included with xbmc does not have the Struct class and aes.py just unifies the api between the PyCrypto and CrytoPy.
Reply
kreach Wrote:I have some patches to get the plugin working on xbox with an updated librtmp. I'm having trouble understanding how git works, so I'll post them here.
First, for the crypto support needed use CryptoPy from http://sourceforge.net/projects/cryptopy/. However, all the python files need "#coding: utf-8" prepended to them. After you do that, extract the crypto folder to Hulu/resources/lib . Next patch stream_hulu.py with this diff:
PHP Code:
--- Hulu/resources/lib/stream_hulu.py    2010-04-10 14:46:26.000000000 -0400
+++ Hulu2/resources/lib/stream_hulu.py    2010-05-19 15:18:49.000000000 -0400
@@ -6,+6,14 @@
 
import sys
 import binascii
 import struct
-from Crypto.Cipher import AES
-from Crypto.Hash import MD5
+#if struct module does not contain class Struct, use wrapper provided instead
+if not 'Struct' in dir(struct):
+    
import pystruct as struct
+from aes import AES #wrapper around PyCrypto and pure python CryptoPy
+try:
+    
from Crypto.Hash import MD5
+except ImportError:
+    
import md5 as MD5
 from BeautifulSoup import BeautifulSoup
BeautifulStoneSoup
 
 
class Main:
@@ -
29,11 +35,11 @@
         
v3a binascii.unhexlify(v3[0])
         
v3b binascii.unhexlify(v3[1])
 
-        
ecb AES.new(v3bAES.MODE_ECB)
+        
ecb AES(v3b)
         
tmp ecb.decrypt(v3a)
 
         for 
v1 in cp_strings[:]:
-            
ecb AES.new(binascii.unhexlify(v1), AES.MODE_ECB)
+            
ecb AES(binascii.unhexlify(v1))
             
v2 ecb.decrypt(tmp)
             if (
re.match("[0-9A-Za-z_-]{32}"v2)):
                 return 
v2
@@ -63,+69,@@
         for 
key in xmldeckeys[:]:
             
smil=""
             
out=[0,0,0,0]
-            
ecb AES.new(binascii.unhexlify(key[0]), AES.MODE_ECB)
+            
ecb AES(binascii.unhexlify(key[0]))
             
unaes ecb.decrypt(encdata)
 
             
packer struct.Struct("iiii"
And also add pystruct.py and aes.py to Hulu/resources/lib. pystruct.py is needed because the struct module included with xbmc does not have the Struct class and aes.py just unifies the api between the PyCrypto and CrytoPy.

Thanks for posting this, when you said all files need "#coding: utf-8" prepended, you mean all the .py files as below:

__init__.py ==> #coding: utf-8__init__.py
filecrypt.py ==> #coding: utf-8filecrypt.py
...
...
...

Or do you mean add that in the content as a first line of each *.py file? I assume you mean the second one above?
Reply
I mean add the contents as the first line of each *.py file.
Reply
kreach Wrote:I mean add the contents as the first line of each *.py file.

You are great man. Thanks. It worked Smile Nod
Reply
For some reasons I only get the movies to play, and when playing Videos or Shows, it goes into this Library Mode and errors out...

Anyone has any idea?
Reply
I've been playing around with some files to fix an issue listed here http://forum.xbmc.org/showpost.php?p=542...tcount=202

The only way (as I'm not familiar with the plugin really AT ALL) is to make my own shortcuts on the home menu as listed here http://forum.xbmc.org/showpost.php?p=542...tcount=201

Its more a work-around than a fix, but it does work... I don't know if anyone else could see or figure out why its not pulling show info/season lists when a show is selected from the TV Shows menu.
Reply
On line 138 of _tv.py, change
PHP Code:
p=re.compile('"(http://.+?)"'
to
PHP Code:
p=re.compile('(?:"|")(http://.+?)(?:"|")'
Also, if you're on xbox, check to see if you get an error when the episodes list.
Reply
I'll have to give it a shot when I get home, and yes I am using an XBox. Off work in 2 hours... ugh.
Reply
To further clarify, I'm getting a nonsensical error "TypeError: an integer is required " in _tv.addEpisodeList( ) at the line "for item in eps". If you try to print item, it loops once and then the same error occurs, but this time the stack trace points to beautiful soup's _str_ function. However, if you wrap the for loop in a try/except block, even though the error is raised, everything loads fine.
Reply
Not the best way to fix a problem, but if it works who's going to complain?
Reply
hope you can fine tune this plugin for xbox, it works great except for movies and tv shows. any of the recently added, most viewed shows work fine...
Reply
kreach Wrote:I have some patches to get the plugin working without installing PyCrypto. I'm having trouble understanding how git works, so I'll post them here.
First, for the crypto support needed use CryptoPy from http://sourceforge.net/projects/cryptopy/. However, all the python files need "#coding: utf-8" prepended to them. After you do that, extract the crypto folder to Hulu/resources/lib .

And also add pystruct.py and aes.py to Hulu/resources/lib. pystruct.py is needed because the struct module included with xbmc does not have the Struct class and aes.py just unifies the api between the PyCrypto and CrytoPy.

I've pulled the aes patch into my repo. I've also removed the use of the struct module, so that bit can go away. I recommend installing CryptoPy in the XBMC system/python/Lib directory instead of just in the Hulu plugin, it will probably come in handy for other plugins. (E.g. for this one http://forum.xbmc.org/showthread.php?tid=74089 )
Reply
Posted some more fixes on the repo.
Reply
  • 1
  • 9
  • 10
  • 11(current)
  • 12
  • 13
  • 19

Logout Mark Read Team Forum Stats Members Help
Hulu Plugin Development Thread - Developers only!1