• 1
  • 2
  • 3
  • 4(current)
  • 5
  • 6
  • 62
[RELEASE] Hulu (Video) Plugin
#46
how do i get the latest working patch? i don't have the svn address and can't seem to find it
Reply
#47
d4rk Wrote:They're doing a simple user agent check, it's defined in libbase/curl_adaptor.cpp.

Thanks. I got it working around 6:00 EST today where if I ran:

Code:
macbook:Desktop test$ dump-gnash --render-mode 0 --verbose --param FlashVars=pid=f59f3f3cea444f31822baa4430fa4b298c7eddd65d204312649f42cccd2c6f46~5e7f306abe00bb2ee692cb1bb8521bbd119c244eea968997ab8f06cdbe3308f9 DecryptPid.swf

I would get the following results.

Code:
RcInitFile: parsing /usr/local/etc/gnashrc
RcInitFile: couldn't open file: /Users/test/.gnashrc
15560:2691733280] 17:27:52 SECURITY: Checking security of URL 'file:///Users/test/Desktop/DecryptPid.swf'
15560:2691733280] 17:27:52 SECURITY: Load of file /Users/test/Desktop/DecryptPid.swf granted (under local sandbox /Users/test/Desktop/)
15560:2691733280] 17:27:52 UNIMPLEMENTED: SWF9 is not fully supported, trying anyway but don't expect it to work
15560:2691733280] 17:27:52 SECURITY: Checking security of URL 'http://www.hulu.com/sec.swf'
15560:2691733280] 17:27:52 SECURITY: Load from host www.hulu.com granted (default)
15560:2691733280] 17:27:53 UNIMPLEMENTED: SWF9 is not fully supported, trying anyway but don't expect it to work
15560:2953850880] 17:27:53 UNIMPLEMENTED: FileAttributes tag in the SWF requests that network access is not granted to this movie (or application?) when loaded from the filesystem. Anyway Gnash won't care; use white/black listing in your .gnashrc instead
15560:2691733280] 17:27:54 UNIMPLEMENTED: System.security.allowDomain
15560:2691733280] 17:27:54 ERROR: Your locale probably can't convert non-ascii characters to upper case. Using a UTF8 locale may fix this.
15560:2691733280] 17:27:54 TRACE: hulupid=CenhHPToxETiRRlM5hs5_Ing3wWeK6wJ

The above is the correctly decoded PID. When I run "wget http://releasegeo.hulu.com/content.selec...ormat=smil," it gives me the SMIL file for the video.

Now (11:30 EST), however, when I run the same command, I get the following output:

Code:
RcInitFile: parsing /usr/local/etc/gnashrc
RcInitFile: couldn't open file: /Users/test/.gnashrc
16974:2691733280] 23:29:13 SECURITY: Checking security of URL 'file:///Users/test/Desktop/DecryptPid.swf'
16974:2691733280] 23:29:13 SECURITY: Load of file /Users/test/Desktop/DecryptPid.swf granted (under local sandbox /Users/test/Desktop/)
16974:2691733280] 23:29:13 UNIMPLEMENTED: SWF9 is not fully supported, trying anyway but don't expect it to work
16974:2691733280] 23:29:13 SECURITY: Checking security of URL 'http://www.hulu.com/sec.swf'
16974:2691733280] 23:29:13 SECURITY: Load from host www.hulu.com granted (default)
16974:2691733280] 23:29:13 UNIMPLEMENTED: SWF9 is not fully supported, trying anyway but don't expect it to work
16974:2953850880] 23:29:13 UNIMPLEMENTED: FileAttributes tag in the SWF requests that network access is not granted to this movie (or application?) when loaded from the filesystem. Anyway Gnash won't care; use white/black listing in your .gnashrc instead
16974:2691733280] 23:29:14 UNIMPLEMENTED: System.security.allowDomain
16974:2691733280] 23:29:14 UNIMPLEMENTED: Rectangle_equals
16974:2691733280] 23:29:14 TRACE: hulupid=Die unendliche Geschichte

The locale error has gone away, and the Rectangle_equals line has appeared. The hulupid being equal to the german title of The Neverending Story comes up regardless of what encoded PID I feed into gnash (tried with two different videos). Is this something I could have done wrong? Or has Hulu changed the way they do decoding?

Looking into this more, the function Rectangle_equals in the file "libcore/asobj/flash/geom/Rectangle_as.cpp" is:

Code:
static as_value
Rectangle_equals(const fn_call& fn)
{
        boost::intrusive_ptr<Rectangle_as> ptr = ensureType<Rectangle_as>(fn.this_ptr);
        UNUSED(ptr);
        LOG_ONCE( log_unimpl (__FUNCTION__) );
        return as_value();
}

I'm guessing that this code means that the function doesn't work and it looks like Hulu is testing to see if the function exists to see if gnash is being used. Sorry I can't say more, I don't know anything about C or Flash.
Reply
#48
Yeah I edited my user agent and recompiled to find this little pid waiting for me
11317:3057023296] 02:45:33 TRACE: hulupid=http://bit.ly/YVCsQ
At least their developers have a sense of humor.

Here's the code if it helps:

Code:
root@boxee-box:~# gnash --render-mode 0 --once --verbose --param FlashVars=pid=dd4e9942974869f0cac12ab9ce815da9af6f8486a433a84bda842dae193457f9~16aa98d95559f7db192bb69972ffc6578e87c22f6bc8eafc8a4c76b924b9800f /home/boxee/.xbmc/plugins/video/Hulu/resources/lib/DecryptPid.swf
RcInitFile: parsing /usr/local/etc/gnashrc
RcInitFile: parsing /home/boxee/.gnashrc
11317:3057023296] 02:45:28 SECURITY: Checking security of URL 'file:///home/boxee/.xbmc/plugins/video/Hulu/resources/lib/DecryptPid.swf'
11317:3057023296] 02:45:28 SECURITY: Load of file /home/boxee/.xbmc/plugins/video/Hulu/resources/lib/DecryptPid.swf granted (under local sandbox /home/boxee/.xbmc/plugins/video/Hulu/resources/lib/)
11317:3057023296] 02:45:28 UNIMPLEMENTED: SWF9 is not fully supported, trying anyway but don't expect it to work
11317:3057023296] 02:45:28 SECURITY: Checking security of URL 'http://www.hulu.com/sec.swf'
11317:3057023296] 02:45:28 SECURITY: Load from host www.hulu.com granted (default)
11317:3057023296] 02:45:28 UNIMPLEMENTED: SWF9 is not fully supported, trying anyway but don't expect it to work
11317:3047279504] 02:45:28 UNIMPLEMENTED: FileAttributes tag in the SWF requests that network access is not granted to this movie (or application?) when loaded from the filesystem. Anyway Gnash won't care; use white/black listing in your .gnashrc instead
11317:3057023296] 02:45:33 UNIMPLEMENTED: System.security.allowDomain
11317:3057023296] 02:45:33 UNIMPLEMENTED: Rectangle_intersection
11317:3057023296] 02:45:33 TRACE: hulupid=http://bit.ly/YVCsQ
Main loop ended, cleaning up
Any segfault past this message is likely due to improper threads cleanup.
Reply
#49
oncomouse Wrote:Thanks. I got it working around 6:00 EST today where if I ran:

Code:
macbook:Desktop test$ dump-gnash --render-mode 0 --verbose --param FlashVars=pid=f59f3f3cea444f31822baa4430fa4b298c7eddd65d204312649f42cccd2c6f46~5e7f306abe00bb2ee692cb1bb8521bbd119c244eea968997ab8f06cdbe3308f9 DecryptPid.swf

I would get the following results.

Code:
RcInitFile: parsing /usr/local/etc/gnashrc
RcInitFile: couldn't open file: /Users/test/.gnashrc
15560:2691733280] 17:27:52 SECURITY: Checking security of URL 'file:///Users/test/Desktop/DecryptPid.swf'
15560:2691733280] 17:27:52 SECURITY: Load of file /Users/test/Desktop/DecryptPid.swf granted (under local sandbox /Users/test/Desktop/)
15560:2691733280] 17:27:52 UNIMPLEMENTED: SWF9 is not fully supported, trying anyway but don't expect it to work
15560:2691733280] 17:27:52 SECURITY: Checking security of URL 'http://www.hulu.com/sec.swf'
15560:2691733280] 17:27:52 SECURITY: Load from host www.hulu.com granted (default)
15560:2691733280] 17:27:53 UNIMPLEMENTED: SWF9 is not fully supported, trying anyway but don't expect it to work
15560:2953850880] 17:27:53 UNIMPLEMENTED: FileAttributes tag in the SWF requests that network access is not granted to this movie (or application?) when loaded from the filesystem. Anyway Gnash won't care; use white/black listing in your .gnashrc instead
15560:2691733280] 17:27:54 UNIMPLEMENTED: System.security.allowDomain
15560:2691733280] 17:27:54 ERROR: Your locale probably can't convert non-ascii characters to upper case. Using a UTF8 locale may fix this.
15560:2691733280] 17:27:54 TRACE: hulupid=CenhHPToxETiRRlM5hs5_Ing3wWeK6wJ

The above is the correctly decoded PID. When I run "wget http://releasegeo.hulu.com/content.selec...ormat=smil," it gives me the SMIL file for the video.

Now (11:30 EST), however, when I run the same command, I get the following output:

Code:
RcInitFile: parsing /usr/local/etc/gnashrc
RcInitFile: couldn't open file: /Users/test/.gnashrc
16974:2691733280] 23:29:13 SECURITY: Checking security of URL 'file:///Users/test/Desktop/DecryptPid.swf'
16974:2691733280] 23:29:13 SECURITY: Load of file /Users/test/Desktop/DecryptPid.swf granted (under local sandbox /Users/test/Desktop/)
16974:2691733280] 23:29:13 UNIMPLEMENTED: SWF9 is not fully supported, trying anyway but don't expect it to work
16974:2691733280] 23:29:13 SECURITY: Checking security of URL 'http://www.hulu.com/sec.swf'
16974:2691733280] 23:29:13 SECURITY: Load from host www.hulu.com granted (default)
16974:2691733280] 23:29:13 UNIMPLEMENTED: SWF9 is not fully supported, trying anyway but don't expect it to work
16974:2953850880] 23:29:13 UNIMPLEMENTED: FileAttributes tag in the SWF requests that network access is not granted to this movie (or application?) when loaded from the filesystem. Anyway Gnash won't care; use white/black listing in your .gnashrc instead
16974:2691733280] 23:29:14 UNIMPLEMENTED: System.security.allowDomain
16974:2691733280] 23:29:14 UNIMPLEMENTED: Rectangle_equals
16974:2691733280] 23:29:14 TRACE: hulupid=Die unendliche Geschichte

The locale error has gone away, and the Rectangle_equals line has appeared. The hulupid being equal to the german title of The Neverending Story comes up regardless of what encoded PID I feed into gnash (tried with two different videos). Is this something I could have done wrong? Or has Hulu changed the way they do decoding?

Looking into this more, the function Rectangle_equals in the file "libcore/asobj/flash/geom/Rectangle_as.cpp" is:

Code:
static as_value
Rectangle_equals(const fn_call& fn)
{
        boost::intrusive_ptr<Rectangle_as> ptr = ensureType<Rectangle_as>(fn.this_ptr);
        UNUSED(ptr);
        LOG_ONCE( log_unimpl (__FUNCTION__) );
        return as_value();
}

I'm guessing that this code means that the function doesn't work and it looks like Hulu is testing to see if the function exists to see if gnash is being used. Sorry I can't say more, I don't know anything about C or Flash.

I was having the same problem, and it looks like as long as gnash returns any value at all it'll work (I'm watching Family Guy in Boxee with the plugin now). I just copied a different function and pasted it in for Rectangle_equals:

Code:
static as_value
Rectangle_equals(const fn_call& fn)
{
    boost::intrusive_ptr<Rectangle_as> ptr = ensureType<Rectangle_as>(fn.this_ptr);

    as_value x, y, w, h;

    ptr->get_member(NSV::PROP_X, &x);
    ptr->get_member(NSV::PROP_Y, &y);
    ptr->get_member(NSV::PROP_WIDTH, &w);
    ptr->get_member(NSV::PROP_HEIGHT, &h);

    std::stringstream ss;
    ss << "(x=" << x.to_string()
        << ", y=" << y.to_string()
        << ", w=" << w.to_string()
        << ", h=" << h.to_string()
         << ")";

    return as_value(ss.str());
}

...and it works fine. Also, don't forget to tell the plugin to use gnash-dump instead of just gnash, because that was stupidly kind of a roadblock for me.
Reply
#50
I changed one function that they were using as a check and just got hit with another one. it seems to be The Never Ending Story indeed. I don't know what they're actually using to return that check now though.

Edit: Found it in System_as.cpp

Code:
15231:3056527680] 03:02:11 UNIMPLEMENTED: System.security.allowDomain
15231:3056527680] 03:02:11 TRACE: hulupid=http://bit.ly/YVCsQ

They could change up the unimplemented functions for quite a while without any distress to regular users. :mad:

I've now weeded all the unimplemented functions out and I'm not getting anything in the log about it, but I'm still getting the rick roll pid. Dunno, I'm done for the night though.
Reply
#51
Avoni Wrote:I changed one function that they were using as a check and just got hit with another one. it seems to be The Never Ending Story indeed. I don't know what they're actually using to return that check now though.

Edit: Found it in System_as.cpp

Code:
15231:3056527680] 03:02:11 UNIMPLEMENTED: System.security.allowDomain
15231:3056527680] 03:02:11 TRACE: hulupid=http://bit.ly/YVCsQ

They could change up the unimplemented functions for quite a while without any distress to regular users. :mad:

I've now weeded all the unimplemented functions out and I'm not getting anything in the log about it, but I'm still getting the rick roll pid. Dunno, I'm done for the night though.

Yeah, I'm getting the same thing. Shame, it was working so well for about an hour there Oo
Reply
#52
Perhaps working more on the Adobe AIR/adl solution is a better approach (at least for Linux, Windows and Mac). That way sec.swf is running in real Flash, and the AS3 can control the user-agent headers.

I did some work with swfdec too which isn't quite working right yet, but here it is. swfdec doesn't support networking out of the box, so this requires local sec.swf.

DecryptPid.as
Code:
class DecryptPid {
    var pid:String;
    var mainmc:MovieClip;

    function DecryptPid(mc:MovieClip) {
        this.mainmc = mc;
    }

    function decrypt(pid:String) {
        this.pid = pid;
        var loader:MovieClipLoader = new MovieClipLoader();
        loader.addListener(this);
        var sec:MovieClip = _root.createEmptyMovieClip("sec", 10)
        sec._lockroot = true;
        //loader.loadClip("http://www.hulu.com/sec.swf", sec);
        loader.loadClip("sec.swf", sec);
    }

    function onLoadInit(sec:MovieClip) {
        var s:String = sec.dec(this.pid);
        trace(this.pid + "  =  " + s)
    }

    static function main(mc) {
        (new DecryptPid(mc)).decrypt(_root.pid);
    }
}


decrypt-pid.c
Code:
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif

#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <cairo.h>
#include <swfdec/swfdec.h>
#include <swfdec/swfdec_url.h>
#include <swfdec/swfdec_player.h>

static void trace(SwfdecPlayer *player, const char *message, void *data)
{
    fprintf(stdout, "%s\n", message);
}

int main (int argc, char *argv[])
{
    int ret = 0;
    SwfdecPlayer *player;
    SwfdecURL *url;

    swfdec_init();

    if (argc != 3) {
        fprintf(stderr, "Usage: %s <swf> pid=<pid>\n", argv[0]);
        return 1;
    }

    player = swfdec_player_new(NULL);
    swfdec_player_set_variables(player, argv[2]);
    g_signal_connect(player, "trace", G_CALLBACK(trace), NULL);
    url = swfdec_url_new_from_input(argv[1]);
    swfdec_player_set_url(player, url);
    swfdec_url_free(url);

    //while (!swfdec_player_is_initialized(player)) {
    while (1) {
        long next = swfdec_player_get_next_event(player);
        if (next < 0)
            return 1;
        swfdec_player_advance(player, next);
    }

    g_object_unref(player);
    player = NULL;

    return ret;
}

To compile, I used dependencies from MacPorts and compiled like:

Code:
$ gcc -o decrypt-pid -I/opt/local/include -I/opt/local/include/glib-2.0 -I/opt/local/lib/glib-2.0/include -I/opt/local/include/cairo -I~/swfdec-0.8.4/installed/include/swfdec-0.8 -L~/swfdec-0.8.4/installed/lib -L/opt/local/lib -lswfdec-0.8 -lgobject-2.0 decrypt-pid.c

(swfdec is also in MacPorts, but I had built a local copy independent)

The above app runs forever, need a way to exit when finished - maybe in the trace print?

To run, need to compile DecryptPid.swf and curl sec.swf local then:

Code:
$ ./decrypt-pid ../DecryptPid.swf pid=f59f3f3cea444f31822baa4430fa4b298c7eddd65d204312649f42cccd2c6f46~5e7f306abe00bb2ee692cb1bb8521bbd119c244eea968997ab8f06cdbe3308f9
f59f3f3cea444f31822baa4430fa4b298c7eddd65d204312649f42cccd2c6f46~5e7f306abe00bb2ee692cb1bb8521bbd119c244eea968997ab8f06cdbe3308f9  =  CenhHPToxETiRRlM5hs5_Ing3wWeK6wJ
Reply
#53
rectalogic Wrote:Perhaps working more on the Adobe AIR/adl solution is a better approach (at least for Linux, Windows and Mac).

(AIR also works on AppleTV)

Titanium is another possibility, it's basically an open source implementation of something like AIR, based on WebKit, and supports Python scripting. Integrating this with XBMC could bring some of the capabilities of the closed source Plex Media Server to XBMC.
http://titaniumapp.com/
Reply
#54
rectalogic Wrote:(AIR also works on AppleTV)

Titanium is another possibility, it's basically an open source implementation of something like AIR, based on WebKit, and supports Python scripting. Integrating this with XBMC could bring some of the capabilities of the closed source Plex Media Server to XBMC.
http://titaniumapp.com/

Took a quick walk through of this and while it appears to have some potential, there's not a whole lot there yet...
Reply
#55
jonm42 Wrote:Took a quick walk through of this and while it appears to have some potential, there's not a whole lot there yet...

It's cross platform, fully scriptable WebKit with Flash support - seems like enough to load and control a Hulu fullscreen player.

e.g. similar to their YouTube video player demo Playtanium app
http://titaniumapp.com/demos

But it is kind of early alpha and buggy.
Reply
#56
rectalogic Wrote:It's cross platform, fully scriptable WebKit with Flash support - seems like enough to load and control a Hulu fullscreen player.

e.g. similar to their YouTube video player demo Playtanium app
http://titaniumapp.com/demos

But it is kind of early alpha and buggy.

why not just use webkit? what would xbmc get from the rest of titanium?

I think the real story that too many people are ignoring is that hulu devs are rickrolling us. THIS WILL NOT STAND. Rofl
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
#57
webkit, then?
Reply
#58
jonm42 Wrote:webkit, then?

What would be nice is a new WebKit based player core that exposed WebKit DOM APIs thru to python plugins, so now the Hulu plugin can "play" the actual HTML web page that contains the flash player. e.g.

Code:
xbmc.Player(xbmc.PLAYER_CORE_WEBKITPLAYER).play("http://www.hulu.com/watch/58602/my-name-is-earl-my-name-is-alias")

Then dive into the DOM of the loaded page to e.g. find document.player (the Flash player instance) and trigger it to go fullscreen or whatever. Possibly could be done by executing JavaScript in a non-sandboxed context inside the loaded page, e.g.

Code:
xbmc.Player(xbmc.PLAYER_CORE_WEBKITPLAYER).executeJS("""
  player = document.getElementById('player');
  player.parentNode.removeChild(player);
  document.body.innerHTML = '';
  document.body.appendChild(player);
  // do something to trigger fullscreen or resize etc...
""")
Reply
#59
So gtk+ or qt? Xbox users will not be able to utilize it without some porting either way, but they couldn't use gnash either.
Reply
#60
gt is cross-platform. might poke around and see if there is an opengl port
Reply
  • 1
  • 2
  • 3
  • 4(current)
  • 5
  • 6
  • 62

Logout Mark Read Team Forum Stats Members Help
[RELEASE] Hulu (Video) Plugin1