$response = $ua->get( $ClickHere, ':content_file' => './java.exe', 'Cookie' => 'oraclelicense=accept-securebackup-cookie' ); #### # this on is "misdirection" (very funny guys!) # my $ClickHere = "http://download.oracle.com/otn-pub/java/jdk/7u80-b15/jre-7u80-windows-i586.exe"; # This is the real one my $ClickHere = "https://edelivery.oracle.com/otn-pub/java/jdk/7u80-b15/jre-7u80-windows-i586.exe"; #### #!/usr/bin/perl # Test java wget style download of Java # wget --header "Cookie: # oraclelicense=accept-securebackup-cookie" # http://download.oracle.com/otn-pub/java/jdk/7u80-b15/jre-7u80-windows-i586.exe # Notes: # This is going in a sub. Do not use "die" # Dependancy (cpan fails here) # yum install perl-LWP-Protocol-https use strict; use warnings; use diagnostics; use Term::ANSIColor qw( BOLD RED RESET ); use LWP::UserAgent; use HTTP::Cookies qw ( extract_cookies ); use LWP::Protocol qw ( https ); use HTTP::Request qw ( request ); use constant MaxTime3 => scalar 3300; # Seconds # Indent here is so I don't have to put it back when it goes back into a sub my $ua; my $response; my $content; my $request; my $cookie_jar; # my $ClickHere = "http://download.oracle.com/otn-pub/java/jdk/7u80-b15/jre-7u80-windows-i586.exe"; my $ClickHere = "https://edelivery.oracle.com/otn-pub/java/jdk/7u80-b15/jre-7u80-windows-i586.exe"; my $RevAddr = "http://www.oracle.com/technetwork/java/javase/downloads/jre7-downloads-1880261.html"; $ua = LWP::UserAgent->new; $ua->timeout ( MaxTime3 ); $ua->show_progress ( 1 ); $response = $ua->get( $ClickHere, ':content_file' => './java.exe', 'Cookie' => 'oraclelicense=accept-securebackup-cookie' );