Home » Questions » Computers [ Ask a new question ]

How to find out the real download URL on download sites that use redirects

How to find out the real download URL on download sites that use redirects

Let's say I want to download something with wget but the website that has the files I need redirects to a site which automatically chooses a mirror for me (and there's no static file URL provided).

Asked by: Guest | Views: 516
Total answers/comments: 5
bert [Entry]

"When you've started the transfer in Firefox, cancel it, and right click the download and hit ""Copy download link"". If you're using an older version, right click it and click on ""Properties"", and the link will be in the window which opens.

In Chrome - run download as normal - then go to Menu - Downloads - and you should see the direct link which was used. Or press Ctrl + J to open the window."
bert [Entry]

"While I like wget too, I use another similar tool: cURL. cURL specifically has a feature to follow redirects (-L / --location), and it's also free like wget. I suggest keeping both in your toolbelt; they have some complementary features.

Here's an interesting article I came across on how to use either wget or cURL to download from a site that uses cookies for authentication. There's a mention of the cURL --location feature to follow redirects. (In fact, based on no special flag mentioned for wget, it would seem to me that wget may follow redirects implicitly..?)"
bert [Entry]

"I usually use the firefox DownThemAll addon when there are a lot of links to download and I need to select specific URLs.

It shows the full URL and allows you to add in paused mode so you can start the download when you like.

As an additional feature, you can grab the URL and skip the download altogether.
However, if you need to download the file, DownThemAll is quite good as an accelerator."
"I usually use the firefox DownThemAll addon when there are a lot of links to download and I need to select specific URLs.

It shows the full URL and allows you to add in paused mode so you can start the download when you like.

As an additional feature, you can grab the URL and skip the download altogether.
However, if you need to download the file, DownThemAll is quite good as an accelerator."
bert [Entry]

Can't you use wget directly using the --trust-server-name flag ? It will download and save using the filename it redirects to.
bert [Entry]

"Your question is a bit unclear. There are 2 urls here : the one you use, and the one that came back after redirection. The first you should know, since it originated from your machine, while the second is the one that displayed in your browser. If the question pertains to where the file is on the redirected server, then there's no way to know.

If you're trying to debug the calls issued towards the server, you can use the firefox add-on of firebug, older versions of it exist here : addons.mozilladotorg/en-US/firefox/addons/versions/1843."