Here is something to hold us over...
Using rectalogic's ActionScript as a starting point and compiling with mtasc, I created an SWF that will decrypt the passed in encrypted pid and redirect to a PHP that puts it into an easily consumable xml format.
Here is how it works:
Here is the test data I used while putting it together:
Code:
Heroes PID Conversion Test
URL: http://www.hulu.com/watch/56972/heroes-trust-and-blood
Content_ID: 14083985
Encrypted PID: 183442a1469fe64906e11e4ccde6f550ae33747d7f27dddc3fef0d4369c19665~fc3f25e17f446c6d6d5f4d35b407b1f90e157cbc68a409838b1968d345cd040b
Decrypted PID: Y_jW38tecJlXH6n77uxR4osxRM6qCagy
The modified version of rectalogic's code. I had it outputting to a text field in the swf for testing, but as you can see, that gets commented out so that you don't even see the swf... just an auto redirect to the output xml.
Code:
import mx.controls.*;
class DecryptPid {
var pid:String;
function DecryptPid() {
System.security.allowDomain("www.angrycamel.com");
System.security.allowDomain("www.hulu.com");
System.security.allowDomain("www.qa.hulu.com");
System.security.allowDomain("static.hulu.com");
System.security.allowDomain("assets.hulu.com");
System.security.allowDomain("ads.hulu.com");
System.security.allowDomain("localhost");
}
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);
//_root.output.text = "Encrypted Pid:\n " + this.pid + "\n\n" +
// "Decrypted Pid:\n " + s;
getURL("http://angrycamel.com/huluPidDecryptor.php?encrypted=" + this.pid + "&decrypted=" + s);
}
function createOutput() {
_root.createTextField("output", _root.getNextHighestDepth(), 0, 0, 750, 200);
_root.output.multiline = true;
_root.output.wordWrap = true;
}
static function main(mc) {
var dpid = new DecryptPid();
//dpid.createOutput();
dpid.decrypt(_level0.pid);
//dpid.decrypt("183442a1469fe64906e11e4ccde6f550ae33747d7f27dddc3fef0d4369c19665~fc3f25e17f446c6d6d5f4d35b407b1f90e157cbc68a409838b1968d345cd040b");
}
}
The PHP that outputs the XML is about as simple as it get's, but here it is anyways.
PHP Code:
<?php
function genOutput() {
$output = header("Content-type: text/xml");
$output .= "<?xml version=\"1.0\" standalone=\"no\"?>\r\n";
$output .= "<!-- XBMC Hulu Plugin | PID Decrypter -->\r\n";
$output .= "<Pid>\r\n";
$output .= " <encrypted>".$_REQUEST["encrypted"]."</encrypted>\r\n";
$output .= " <decrypted>".$_REQUEST["decrypted"]."</decrypted>\r\n";
$output .= "</Pid>\r\n";
return $output;
}
echo genOutput();
?>
Try it yourself... (replace the pid in the url with whatever pid you want to test out)
http://angrycamel.com/DecryptPid.swf?pid...d345cd040b
Let me know if you run into any problems, and test as many PID's as you can.
I had trouble getting the SWF to reference the sec.swf directly from hulu.com, so I have it looking at a copy on my site right now. If anyone can offer any suggestions, please do.