if ( ! $response->is_success ) { use Data::Dumper; print Dumper($response); ... }
Gives (in part)
... The owner of this website (download.fosshub.com) has banned your acces +s based on your browser\'s signature (38250110cd8b5c57-ua22). ...

sub DownloadWebFile { # Download the $Url's file my $IAm = ( caller(0) )[3]; # Incoming: my $Url = $_[0]; my $Timeout = $_[1]; my $Cookies = $_[2]; # 'oraclelicense=accept-securebackup-cookie' my $Referer = $_[3]; # "http://usa.kaspersky.com/windows10"; my $Host = $_[4]; # "download.fosshub.com"; my $FileName = $_[5]; # File name and path to save the file to my $Caller = "$_[6]" . "$IAm"; # Outgoing: my $PageStatus = \$_[7]; $$PageStatus = UPDATE; # 2 = good download my $ua; $ua = LWP::UserAgent->new; $ua->timeout ( MaxTime2 ); $ua->show_progress ( 1 ); # 0 = do not show; 1 = show my $req = new HTTP::Request (GET => $Url ,HTTP::Headers->new( 'Referer' => + 'https://www.fosshub.com/HWiNFO.html', 'User-Agent' => + 'Mozilla/5.0 (Windows NT 5.1; rv:52.0) Gecko/20100101 Firefox/52.0' ) ); my $response = $ua->request ($req); if ( ! $response->is_success ) { $$PageStatus = DOWNLOAD_FAIL; use Data::Dumper; print Dumper($response); print STDERR " ERROR ${Caller}.GetWebPage: unable to read ", $Url, "\n"; print STDERR $response->status_line; return ""; } }
Gives ** GET https://www.fosshub.com/HWiNFO.html/hw64_554.exe ==> 200 OK (4s)


In reply to Re: need help downloading a file by huck
in thread need help downloading a file by Todd Chester

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.