Kodi Community Forum
[SUPPORT] Hulu Video Plugin - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Support (https://forum.kodi.tv/forumdisplay.php?fid=33)
+--- Forum: Add-on Support (https://forum.kodi.tv/forumdisplay.php?fid=27)
+---- Forum: Video Add-ons (https://forum.kodi.tv/forumdisplay.php?fid=154)
+---- Thread: [SUPPORT] Hulu Video Plugin (/showthread.php?tid=121023)



RE: [SUPPORT] Hulu Video Plugin - locomot1f - 2013-10-15

unfortunately, it doesn't work that way with the linux builds... Sad

there's no true "monthly builds"... you get what's in the ppa's.


RE: [SUPPORT] Hulu Video Plugin - locomot1f - 2013-10-15

FYI:

in the upcoming Gotham build 13 alpha 9:
CryptoPy
demjson
coveapi

seem to be broken.


RE: [SUPPORT] Hulu Video Plugin - locomot1f - 2013-10-15

http://forum.xbmc.org/showthread.php?tid=173943&pid=1527263#pid1527263


RE: [SUPPORT] Hulu Video Plugin - moneymaker - 2013-10-15

(2013-10-15, 16:33)locomot1f Wrote: http://forum.xbmc.org/showthread.php?tid=173943&pid=1527263#pid1527263
Thank you! Just let me time to handle it. Smile


RE: [SUPPORT] Hulu Video Plugin - andrew0404 - 2013-10-17

Hey guys,

First post here. Just got into XBMC a few weeks ago and was fiddling with the hulu plugin over the last few days. Found that Marvel's program did not import correctly and started looking into it. Ive never used python before, but it was pretty self explanatory. I figured it would just be a regex issue or something but Hulu actually returns 0 episodes when queried for the show. I did manage to use the same method that browsing the plugin via subscriptions does, which works.

I don't know if this will work for every show that doesn't import, but it seems to work for SHIELD. I had a second problem, which was that I was using the hulu library over a smb share for multiple xbmc boxes. The title of the show was too long for SMB and was keeping XBMC from scraping it correctly. So I modified the code again to remove periods (.) from the directory names. It seems to work fine.

I don't know if anyone is keeping up development on this, the last update to the hulu project was april 10, 2012, but here is the patch I made for the xbmclibrary.py file:

Code:
--- xbmclibrary.py.orig    2013-10-17 11:40:37.915328039 -0500
+++ xbmclibrary.py    2013-10-17 11:17:21.208402149 -0500
@@ -95,6 +95,10 @@
         if not os.path.exists(dir_path):
             os.makedirs(dir_path)
    
+    def cleandirectoryname(self, name):    
+        valid_chars = "-_() %s%s" % (string.ascii_letters, string.digits)
+        return ''.join(c for c in name if c in valid_chars)
+    
     def cleanfilename(self, name):    
         valid_chars = "-_.() %s%s" % (string.ascii_letters, string.digits)
         return ''.join(c for c in name if c in valid_chars)
@@ -180,22 +184,43 @@
    
     def ExportShow(self, show):
         data = show.find('data')
+        items_url = show.findtext('items_url')
         #show_name = data.findtext('name')
         #directory = os.path.join(TV_SHOWS_PATH,self.cleanfilename(show_name))
         #self.CreateDirectory(directory)
         show_id = data.findtext('show_id')
         url = 'http://m.hulu.com/menu/11674?show_id='+show_id+'&dp_id=hulu&limit=2000&package_id='+package_id
+    print "Getting " + data.findtext('name')
         xml=common.getFEED(url)
         tree = ElementTree.XML(xml)
         episodes = tree.findall('item')        
         del tree
-        for episode in episodes:
-            self.ExportVideo(episode)
+        if episodes:
+              for episode in episodes:
+                self.ExportVideo(episode)
+        else:
+              print "Getting " + data.findtext('name')+ "-Alternate Method"
+              url = 'http://m.hulu.com'+items_url+'&dp_id=hulu&limit=2000&package_id='+package_id
+              xml = common.getFEED(url)
+              tree = ElementTree.XML(xml)
+              items = tree.findall('item')
+              del tree
+              for item in items:
+                     if item.findtext('display').strip() == "Episodes":
+                            real_items_url = item.findtext('items_url')
+                            url = 'http://m.hulu.com'+real_items_url+'&dp_id=hulu&limit=2000&package_id='+package_id
+                            xml = common.getFEED(url)
+                            tree = ElementTree.XML(xml)
+                            episodes = tree.findall('item')
+                            for episode in episodes:
+                                   self.ExportVideo(episode)
+
         #self.Notification('Added Subscription',show_name)

     def ExportVideo(self, episode):
         data = episode.find('data')
         if data:
+            print "Adding Episode: " + data.findtext('title').encode('utf-8')
             content_id = data.findtext('content_id')
             video_id = data.findtext('video_id')
             eid = data.findtext('eid')
@@ -210,7 +235,7 @@
                 episode = data.findtext('episode_number').encode('utf-8')
                 show_name = data.findtext('show_name').encode('utf-8').strip()
                 filename = self.cleanfilename('S%sE%s - %s' % (season,episode,title))
-                directory = os.path.join(TV_SHOWS_PATH,self.cleanfilename(show_name))
+                directory = os.path.join(TV_SHOWS_PATH,self.cleandirectoryname(show_name))
                 self.CreateDirectory(directory)
                 self.SaveFile( filename+'.strm', strm, directory)
                 if common.settings['episodenfo'] == 'true':

What this does is try to get the episodes the way the plugin already did, but if it doesn't find any episodes, it tries a new alternate method. I added some debugging statements to the log printout as well so you can see which shows and episodes are being found.

I hope this works for everyone. If you can't use the patch file, let me know and I will try to link the whole file.


RE: [SUPPORT] Hulu Video Plugin - Gatecrasher - 2013-10-17

New member to the forums and first time attempting to work with XBMC. I am not a programmer, so I have been moving slowly and taking baby steps to attempt to understand how some of the options work for this awesome program as I attempt to build a media server off of my old gaming CPU now that I have upgraded to a new custom rig. With that said, I need some help in very plain and basic language Smile

I will skip a lot of my questions that are better posted in other areas and concentrate on HULU for this thread. Can anyone post a simple walkthrough for which add-on should be used for HULU and the process of adding it and getting it up and running? I have read through post of this thread and am still a bit confused.

I have installed the BlueCop plugin, and am working on the force refresh since no add-ons show up under it on the menu.

I currently do not have a HULU Plus subscription and usually use the free version online to watch recent episodes of shows that I enjoy.

I am honestly very confused on how to get this add-on to work and actually start streaming HULU content to XBMC.

Can anyone link a very dumbed down step by step process for doing this?

Thanks in advance for any assistance.


RE: [SUPPORT] Hulu Video Plugin - LastChoice - 2013-10-17

(2013-02-16, 22:52)rflores2323 Wrote:
(2013-02-15, 19:00)tknorris Wrote:
(2013-02-15, 18:50)rflores2323 Wrote: any help?

I suspect that the problem is the hulu plugin stores the Hulu authentication token in the addon directory rather than the profile directory. That means all instances of the plugin would share the same token, and thus the same login. If I'm correct, it would require a code change to fix it.

The code in question would be below in common.py under <plugin dir>/resouces/lib.

Code:
COOKIEFILE = os.path.join(pluginpath,'resources','cache','hulu-cookies.lwp')
QUEUETOKEN = os.path.join(pluginpath,'resources','cache','token.xml')

Notice the Hulu cookie and the authentication token are both stored in the <addon directory>/resouces/cache itself rather than in a profile directory. That means they are shared across all profiles. So, once you logon to Hulu, all profiles will be logged on w/ the same id. Unfortunately, I don't know enough about XBMC addon programming to fix it.

Thank you for the response. Ill check with bluecop to see if he can fix or another developer. Appreciate the help


From what I've been able to observe this still appears to be an issue in version 3.4.8. I understand from a previous post that this plug-in has changed hands and that BlueCop is no longer supporting it. Is someone else still actively updating this plug-in? If so, is there a preferred mechanism for entering bugs and feature requests?

Thanks!


RE: [SUPPORT] Hulu Video Plugin - locomot1f - 2013-10-17

yes... MoneyMaker is working on this plugin...
all it takes is to read the last couple of pages in this thread.


RE: [SUPPORT] Hulu Video Plugin - moneymaker - 2013-10-17

To-do-list:

- new support thread
- fixes (includes cookie/token, xbmclibrary, gotham support)

sounds quiet good, ha?


RE: [SUPPORT] Hulu Video Plugin - andrew0404 - 2013-10-17

Sounds awesome. Do you have a repo where I can grab source?


RE: [SUPPORT] Hulu Video Plugin - moneymaker - 2013-10-17

@andrew0404

Sure, plugin.video.hulu-beta

I have to upload stuff on github.


RE: [SUPPORT] Hulu Video Plugin - locomot1f - 2013-10-18

sounds really good!
thanks for all your efforts to keep this plugin working! Smile


RE: [SUPPORT] Hulu Video Plugin - locomot1f - 2013-10-18

@moneymaker,

would you like for us to post bugs if we find them?


RE: [SUPPORT] Hulu Video Plugin - moneymaker - 2013-10-18

(2013-10-18, 18:07)locomot1f Wrote: @moneymaker,

would you like for us to post bugs if we find them?
Huh


RE: [SUPPORT] Hulu Video Plugin - locomot1f - 2013-10-18

bugs in the beta version.

first one i found was this line in addoncompat.py:
Code:
__plugin_handle__ = int(sys.argv[1])
if __has_addons__:
    __addon__ = xbmcaddon.Addon('plugin.video.hulu')

should be:
Code:
__plugin_handle__ = int(sys.argv[1])
if __has_addons__:
    __addon__ = xbmcaddon.Addon('plugin.video.hulu-beta')

i'm still getting this error:
Code:
12:25:45 T:139972345751296  NOTICE: -->Python Interpreter Initialized<--
12:25:45 T:139972345751296   ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
                                             - NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
                                            Error Type: <type 'exceptions.ImportError'>
                                            Error Contents: No module named crypto.cipher.cbc
                                            Traceback (most recent call last):
                                              File "/home/xbmc/.xbmc/addons/plugin.video.hulu-beta/default.py", line 12, in <module>
                                                import resources.lib.common as common
                                              File "/home/xbmc/.xbmc/addons/plugin.video.hulu-beta/resources/lib/common.py", line 16, in <module>
                                                from crypto.cipher.cbc      import CBC
                                            ImportError: No module named crypto.cipher.cbc
                                            -->End of Python script error report<--
12:25:45 T:139974207313792   ERROR: GetDirectory - Error getting plugin://plugin.video.hulu-beta/
12:25:45 T:139974207313792   ERROR: CGUIMediaWindow::GetDirectory(plugin://plugin.video.hulu-beta/) failed