Jump to content

Download problem with InetGet()


agivx3
 Share

Recommended Posts

Hi all,

i am now for longer trying to download a file with InetGet() or other options but i dont get it working with Autoit. There is no more Internet Explorer on the system so _IECreate is no option.
I use different urls which have similar syntax.  When using the url in a browser the download just starts.

Here is the actual line i am trying:

$Download = InetGet("https://chromeenterprise.google/browser/download/?platform=WIN_MSI&channel=stable&usagestats=0","C:\TEMP\googlechromestandaloneenterprise.msi")

Any idea how to download this without using installed browsers ?

Thx for help

 

Link to comment
Share on other sites

This URL is returning an HTML document, not an MSI file:

<!DOCTYPE html>
<html lang="en">
  <head>
<meta charset="utf-8">
<meta name="no_page_title" value="true"/>
<meta name="description" content="Get the essential tools to deploy Chrome Browser for your enterprise. Explore bundles, MSI, policy templates and beta downloads."/>
<meta name="hide_page_heading" value="true"/>
<meta name="hide_ratings_widget" value="true"/>
<meta name="full_width" value="true"/>
<meta name="page_type" value="marketing"/>
<meta name="viewport" content="initial-scale=1, minimum-scale=1, width=device-width">
<meta name="google-site-verification" content="gwHFvn8KvnGBckW4HT6zBS68-ToiJWaWRzxZapEjYAw" />
      <link rel="preconnect" href="https://www.google-analytics.com" crossorigin>
      <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
      <link rel="preconnect" href="https://www.gstatic.com" crossorigin>
      <link rel="preconnect" href="https://omahaproxy.appspot.com" crossorigin>
      <link rel="preconnect" href="https://www.googletagmanager.com" crossorigin>
    <link rel="canonical" href="https://chromeenterprise.google/browser/download/">
<script nonce="sRzDOq5FmbsvN-eU5xSUYw">
  if (window.trustedTypes && window.trustedTypes.createPolicy) {
    ttp = trustedTypes.createPolicy('default', {
      createScriptURL: (string) => {
        const url = new URL(string, document.baseURI);
        if(url.origin = window.location.origin || url.origin === "www.googletagmanager.com" || url.origin === "www.google-analytics.com") return url.href
        throw new TypeError('createScriptURL: invalid URL')
      }
    });
  }
  [snip]

when putting this into your browser, that page redirects to...

https://dl.google.com/tag/s/appguid%3D%7B8A69D345-D564-463C-AFF1-A69D9E530F96%7D%26iid%3D%7B61FD9C8E-3593-993D-C216-4DAC2E21AFA1%7D%26lang%3Den%26browser%3D4%26usagestats%3D0%26appname%3DGoogle%2520Chrome%26needsadmin%3Dtrue%26ap%3Dstable-arch_x86-statsdef_0%26brand%3DGCEA/dl/chrome/install/googlechromestandaloneenterprise.msi

... that propably is an URL, that will change frequently

 

when modifying that URL a bit it looks quite nice, giving you a MSI file of ~80MB size:

https://dl.google.com/dl/chrome/install/googlechromestandaloneenterprise.msi

Edited by rudi

Earth is flat, pigs can fly, and Nuclear Power is SAFE!

Link to comment
Share on other sites

Thx a lot for analyzing the problem. Great job !! Seems my http knowledge is to low...

How did you get the redirected url ? And just for interest - why does the modified url work ?

And i assume there is no autoit possibility for redirection urls  ?

I have also a few urls like this one i would need:  https://go.microsoft.com/fwlink/?LinkID=2093505 

Link to comment
Share on other sites

Hi

Q: How to get the URL?

A: I downloaded the file, went to the browser download history (CTRL+j) and picked up the origin URL from there

Q: why does the modified URL work?

A: Many web sites offer download URLs that expire pretty soon or sometimes allow just one single download to be done. To make these URLs unique, so that they cannot be bookmarked, forwarded, stored for later use, they are padded with stuff like the string parts I removed to guess the modified URL, that works.

Earth is flat, pigs can fly, and Nuclear Power is SAFE!

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...