Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/perl
- use LWP::UserAgent;
- use HTTP::Request;
- use HTTP::Cookies;
- use SOAP::Lite;
- my $cookies=HTTP::Cookies->new;
- my $ua=LWP::UserAgent->new(cookie_jar => $cookies);
- $ua->agent("PerlFirm/0.9001 ");
- my $req = HTTP::Request->new(GET => 'https://www.dsut.online.nokia.com/oti/get_params.do?application_id=2');
- my $res = $ua->request($req);
- $cookies->as_string =~ /JSESSIONID=(.*?)\;/;
- my $soap = SOAP::Lite->new(proxy => "https://www.dsut.online.nokia.com/oti/CareSuite");
- my $param = SOAP::Data->new;
- $soap->autotype(0);
- $soap->default_ns('http://www.posti-care_suite.posti.nokia.com/POSTI_CareSuite_Interface.wsdl');
- $param->name("string");
- $param->value($1);
- $param->type("string");
- $param->prefix("");
- my $param2=SOAP::Data->new;
- $param2->name("string0");
- $param2->type("string");
- $param2->value("");
- my $som=$soap->GetProductList($param,$param2);
- foreach my $prod ( @{$som->result}) {
- if ( $prod->{marketName} ne "Nokia N900" ) { next; }
- my $nokn9=$prod->{productID};
- my $param3=SOAP::Data->new;
- $param3->name("longVal");
- $param3->value($nokn9);
- my $som2=$soap->GetReleasesForProduct($param,$param3);
- my $count;
- my %files;
- for ( $count = 0;$count < scalar(@{$som2->result});$count++){
- my $relId=$som2->result->[$count]->{releaseID};
- my $param4=SOAP::Data->new;
- $param4->name("longVal");
- $param4->value($relId);
- my $som3=$soap->GetReleaseVariants($param,$param4);
- for ( $count1 = 0;$count1 < scalar(@{$som3->result});$count1++){
- my $down= $som3->result->[$count1]->{files};
- for ( $count2 = 0;$count2 < scalar(@{$down});$count2++){
- if ( $files{$down->[$count2]->{fileName}} ) { next; }
- if ( $down->[$count2]->{fileName} =~ /.*signature.*/ ) { next; }
- if ( $down->[$count2]->{fileName} =~ /.*bin/ ) {
- for my $filespl(split(/,/,$count2)){
- my $url= $down->[$filespl]->{downloadURL};
- $files{$down->[$count2]->{fileName}} = $url;
- }
- }
- }
- }
- }
- foreach (keys %files) {
- print "Downloading file ", $_, " from ", $files{$_}, "\n";
- `wget -nc $files{$_}`;
- }
- }
Add Comment
Please, Sign In to add comment