I was trying to write a perl script to grap a mov file for me. I know it worked when I used the same script to grap images. But when I tried to get the .mov file, quicktime viewer says there's something wrong with it.
the code is as follows
require LWP::UserAgent;
require HTTP::Request;
use HTTP::Request::Common;
$ua = new LWP::UserAgent;
writeFile('http://a496.g.akamai.net/5/496/51/36707eff03de83/1a1a1aaa2198c627970773d80669d84574a8d80d3cb12453c02589f25382f668c9329e0375e8177ae955ca3799026392f861 cf309cfb61c230a40578 f1/finalfantasy_480.mov');
sub writeFile
{
my ($site) = @_;
print "Getting $site...n";
print "Saving Filen";
$request = GET "$site";
$response = $ua->request($request);
Thanks. It's working great. But out of curiousity, why didn't my script work? I was getting all the bits and constructing the new file. should work the same why I guess?
>>why didn't my script work?
Because of a missing line:
print "Content-type: text/htmlnn";
But still, it should fetch the *.mov file okay.
Also, your
print "Saving Filen";
line is not in the appropriate position. It should be in the same line as open(outFile, ">final.mov");