curl / Mailing Lists / curl-users / Single Mail

curl-users

Re: How do I download this guy?

From: Jeremy Nicoll <jn.ml.crlu.36_at_letterboxes.org>
Date: Mon, 24 Dec 2018 07:20:07 -0500

On Sun, 23 Dec 2018, at 21:53, ToddAndMargo wrote:
> Hi All,
>
> How do I download this guy with cURL?
>
> https://filehippo.com/download_app_manager/
>
> Firefox's web developer Network says this is what
> is happening:
>
> curl
> 'https://dl2.filehippo.com/38a1ec2fe5e54644a0744ba893a253e5/appmanagersetup_2.0_b4_292.exe?ttl=1545569599&token=7251eca83bfcc48ccc6ff7c1bae0c5b8'
> -H 'User-Agent: Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:64.0)
> Gecko/20100101 Firefox/64.0' -H 'Accept:
> text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8' -H
> 'Accept-Language: en-US,en;q=0.5' --compressed -H 'Referer:
> https://filehippo.com/download_app_manager/download/0f8b52f33a37a84c54f747e6294aa708/'
> -H 'Connection: keep-alive' -H 'Upgrade-Insecure-Requests: 1'
>
> But how do I get there with just cURL and not Firefox?

In general the method is you look at what happens on the nominal page - in this case
https://filehippo.com/download_app_manager/ - to find out how that page creates the
curl command, and replicate that process yourself.

It might be impossible... if there's a humungous chunk of Javascript that executes and
builds the token parts of the command in a way that you can't fathom out. You might
be very lucky and be able to plug the token stuff from the fetch you've seen work into
another curl command and have that work.

Also, it's possible that just the process of grabbing the first page might give you a
tailored copy of it, from which you could parse out the details that would need to be
fed into a subsequent curl command.

A good starting place is using curl to grab the first page several times, to find out if
anything on it varies from time to time. Then work out what happens when someone
clicks the download button.

-- 
Jeremy Nicoll - my opinions are my own.
-----------------------------------------------------------
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-users
Etiquette:   https://curl.haxx.se/mail/etiquette.html
Received on 2018-12-24