• 1
  • 2
  • 3(current)
  • 4
  • 5
  • 19
Hulu Plugin Development Thread - Developers only!
#31
It still depends on client-side flash
Always read the XBMC online-manual, FAQ and search and search the forum before posting.
For troubleshooting and bug reporting please read how to submit a proper bug report.

If you're interested in writing addons for xbmc, read docs and how-to for plugins and scripts ||| http://code.google.com/p/xbmc-addons/
Reply
#32
jonm42 Wrote:With the above I can get something together over the weekend; I'll skip plot for now and just structure it so I (or some other lucky person) can fold it in based on the existing option. Thanks! This is a hoot.

I got this working for subscriptions; but I need to go directly into assets.hulu.com to grab the fanart (key_art_<showname>.jpg) instead of scraping from the www.hulu.com/<showname> page (as I figure it would not be cool to grab the whole page for just one link). Is there a best practices doc I can review? I've found the how-to, but not any guidelines on constructing something as opposed to scraping it. Next up -- plots and them paying attention to the show plots flags and then doing clips only shows (like Wallace & Gromit) properly.
Reply
#33
angrycamel Wrote:I posted that very solution a while back. It's still sitting out on my site if you want o play with it.

http://forum.xbmc.org/showpost.php?p=286...tcount=576

Any updates on getting it execute the swf file off the hulu web site instead of local ?
Reply
#34
CrashX Wrote:Any updates on getting it execute the swf file off the hulu web site instead of local ?

I don't know of any way to execute an ActionScript class server side.
Integrating with XBMC through the JSON-RPC interface?

Try the JSON-RPC Browser

Image
Reply
#35
angrycamel Wrote:I don't know of any way to execute an ActionScript class server side.

Is that what CrashX is asking? Or is it getting something to run locally thats stored on a remote server (which is what I thought we were doing in the first place...).
Reply
#36
FYI, hulu has changed things around on us.

the smil is now located at
s.hulu.com/select.ashx?pid=KYjk7gOX2fR_iQU1S2P_70eEbUbaX9Or&auth=02a1e4c6b884642627b73ea495bd2448

the pid encryption is the same, but now there is an auth key that also needs to be grabbed. I haven't looked deeply into where this might be generated, but at a glance it isn't obvious.

I've been kind of rolling the idea in my head of just launching an actual webbrowser, and simulating a 'click' on the 'fullscreen' button.

This method has a large number of disadvantages, with the only real pro being that hulu can't easily break it. They could move the fullscreen button around, but that would be bad for the user experience on their site.

A few things that need to be worked out:
I know how to do mouseclicks at x,y coordinates in windows, but I can't find any pythonic way to do it in linux or osx. Surely something exists, I'm just not sure what it is. Perhaps a firefox extension would be the best way to handle this?

I'm also not sure how to figure out when the video is over so we can return to xbmc. Again, this could maybe be done with some sort of firefox extension, but I'm not so sure.

Possible? What do you guys think?
Always read the XBMC online-manual, FAQ and search and search the forum before posting.
For troubleshooting and bug reporting please read how to submit a proper bug report.

If you're interested in writing addons for xbmc, read docs and how-to for plugins and scripts ||| http://code.google.com/p/xbmc-addons/
Reply
#37
Given that Hulu can keep doing arbitrary things to stop direct stream access (as we have been observing lately Sad (altho getting Rick-rolled does show at least a twisted sense of humor)), this seems like a good thing to investigate.

A quick google on "python mouse click" gave me this: http://www.pygame.org/docs/ref/mouse.html, which is LGPL python code -- not sure how much baggage this comes with, but it may be a step down the road.

As to firefox extension idea, I'm reasonably certain that they can "watch" what the browser is doing (a la firebug), so there should be a way to detect when a show is over.
Reply
#38
Once this game of cat & mouse began, I began thinking along the lines of controlling a web browser, although just on the Windows side of things, and using some python code called IEC for controlling an IE session. There is python code available via Google search for simulating mouse clicks.

As far as Firefox extensions go, I would look into the iMacros extension. Among other things, it can simulate mouse clicks, and search for the location of an image in the screen (for example, find the location of the full screen button so that it can be clicked). It already is available on both Windows and Linux. Its code is obfuscated, so do not expect to be able to borrow bits and pieces from it - instead, it is likely best to figure out how to work with it (another idea is that you may be able to call its internal methods directly, as I believe there is no intra-extension protection offered by Firefox). This can also be applied to activate 480p playback. iMacros is more script driven, but perhaps there is a way to open a socket for receiving commands.

It is a pain dealing with the fact that there is usually a commercial in advance of the main video. You will have to, in some automated fashion, keep wiggling the mouse around to keep the icons in the player active, and keep waiting for the fullscreen icon to pop up once the actual video stream is playing.

Running through the browser, the only control you are going to be able to execute over the video is pause and stop. Skipping around in the video, although conceivable, would require a lot of work with mouse simulation and figuring out just where to click to skip the video to the desired location.

Another alternative is doing something along the lines of what Boxee appears to do: write a helper application that hosts the .swf. However, running it through an automated browser session is probably the most robust against various Hulu shenanigans, as it you will be using the same browser-based interface used by a typical user.
Reply
#39
The image recognition part of iMacros does not come in the free edition. Sigh. As to the waiting for the commercial, you can click the full screen button as soon as the video starts; there is no need to wait for the actual show to start, which should simplify things as far as that goes. Good to see some creative thoughts starting to flow around.
Reply
#40
I am in the midst of trying to simplify the plugin by writing some common routines that stuff can call like addEpisodes, etc. Right now I'm looking at the RSS (_rss.py) module and am having some very odd results.

This snippet works for each and every RSS feed I give it:

Code:
xmlsoup = BeautifulStoneSoup(common.getHTML( common.args.url ))

and this one only works for highest rated, and just waits for a while and then returns nothing at all:

Code:
content=common.getHTML(common.args.url)

This particular snippet has been used elsewhere to grab non-RSS pages and works like a champ.

I've tried working with different URLs to get to the feed (see examples in common.py for the various forms) but no luck. I've tried wrapping the second form as an argument to another call. No luck. Nothing in the log. It just terminates the python thread as being idle, and nothing comes back.

Ideas, debugging thoughts, etc. quite welcome. Thanks.
Reply
#41
rwparris2 Wrote:I've been kind of rolling the idea in my head of just launching an actual webbrowser, and simulating a 'click' on the 'fullscreen' button.

Yeah, I had been working on that too. Using AIR since it contains WebKit and is scriptable via Flash.

Sometimes the video loads and plays, sometimes it gets "this video can only be watched at Hulu". Also the fake mouse event doesn't work yet. Hulu player is also supposed to go fullscreen when you type "F" but that doesn't seem to work either.

Here's the code if anyone wants to play more.

HuluTV.mxml
Code:
<!-- Compile ~/flex-3.2.0/bin/amxmlc HuluTV.mxml -->

<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" xmlns="*"
    applicationComplete="stage.displayState = StageDisplayState.FULL_SCREEN_INTERACTIVE">

<mx:Script><![CDATA[
    import flash.events.Event;
    import flash.events.MouseEvent;
    private function onPageLoad(event:Event):void {
       var player:Object = html.domWindow.document.getElementById('player');
       trace(player.offsetTop)
       trace(dispatchEvent(new MouseEvent(MouseEvent.CLICK, true, false, 828, 250)))
    }
]]></mx:Script>

<mx:HTML id="html" width="100%" height="100%" complete="onPageLoad(event)" location="http://www.hulu.com/watch/58602/my-name-is-earl-my-name-is-alias"/>

</mx:Application>

Run via ~/air-1.5.1/bin/adl HuluTV.xml

HuluTV.xml
Code:
<?xml version='1.0' encoding='utf-8'?>
<application xmlns="http://ns.adobe.com/air/application/1.5">
    <id>com.rectalogic.HuluTV</id>
    <filename>HuluTV</filename>
    <initialWindow>
        <content>HuluTV.swf</content>
        <visible>true</visible>
        <width>500</width>
        <height>400</height>
    </initialWindow>
</application>
Reply
#42
For anyone else who wants to jump in on the coding side of things, I've been working on this in parallel over with the get_iplayer / rtmpdump authors.

http://linuxcentre.net/author/admin/

My code for loading sec.swf in gnash is available here:
http://www.highlandsun.com/hyc/huludif.txt

The above is compiled with haxe.

I've also used swfdec, that code is here:
http://highlandsun.com/hyc/decswf.c

Unfortunately I haven't yet figured out the new auth key yet; there's a new decs function in sec.swf and it takes 3 parameters. Pretty sure one is the PID, but I don't know what the other two are.

By the way, here's code in perl that the rtmpdump author wrote for decrypting the PIDs. It's a lot more efficient than the python translation of sec.swf:

my @data = split(/\~/, $encpid);

# strip off server session encryption
my $ecb = new Crypt::Rijndael pack("H*", @data[1]);
my $tmp = $ecb->decrypt(pack("H*", @data[0]));

foreach(@keys) {
my $ecb = new Crypt::Rijndael pack("H*", $_);
$unpid = $ecb->decrypt($tmp);

if ($unpid =~ /[0-9A-Za-z_-]{32}/) {
return $unpid;
}
}

The keys array has to be pasted in from the sec.swf file, ASCII hex. There are 3 keys in plaintext in sec.swf, and two more that are semi-obfuscated / generated by the ActionScript.
Reply
#43
Has anyone checked out the Front Row plug in (appliance) called Understudy? May have some potential. Go see http://code.google.com/p/understudy/sour...trunk/Hulu ...
Reply
#44
rwparris2 Wrote:FYI, hulu has changed things around on us.

the smil is now located at
s.hulu.com/select.ashx?pid=KYjk7gOX2fR_iQU1S2P_70eEbUbaX9Or&auth=02a1e4c6b884642627b73ea495bd2448

the pid encryption is the same, but now there is an auth key that also needs to be grabbed. I haven't looked deeply into where this might be generated, but at a glance it isn't obvious.

I used flare to decompile the express_player.swf; if you search for "auth=" in the code you'll find that it's an MD5 hash of (decrypted pid + a long string in the source). I won't paste the secret string here, but it's easy enough to find it yourself.
Reply
#45
Here’s a simple PERL script to get auth parameter from the decrypted pid
Code:
#!/usr/bin/perl
#
use Digest::MD5 qw(md5_hex);
$pid=”@ARGV”;
$pid_suffix=’****************************************************************’;
$extended_pid=”$pid$pid_suffix”;
$auth=md5_hex($extended_pid);
print $auth;
The asterisks has to be changed with a “secret string” that is embedded in http://www.hulu.com/player.swf
As highlandsun said Flare is a useful tool to decompile swf files and getting stuff…
Reply
  • 1
  • 2
  • 3(current)
  • 4
  • 5
  • 19

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