6

When I click a download button, I get a popup-dialog like this:

enter image description here

If the file is large, I want to download it by wget -c URL.
Right-clicking download button to select Copy Link Location doesn't work.
How to copy the download link to clipboard?

1
  • Good question. In many cases, you can cancel the download and you'll be at "if you have trouble with the download, use this direct link". Then you can copy the link and use it for wget. In many cases this is not an option. Lets see.
    – Paul
    May 21, 2012 at 5:18

4 Answers 4

6

It depends on how the download is set up.

With certain downloads, the download is initiated with a form GET/POST. So if you look at the final download button's form action, you'll see the download URL.

In other cases, the download is initiated by a redirect (e.g. a PRG or a JavaScript redirect that receives the download URL via an XHR request), in which case, you can use Firefox's Tamper Data add-on to find the download URL in the HTTP traffic, or you can just right-click on the download in Firefox's download manager and Copy Download Link.

But there are some sites that use a single-use URL, or a cookie containing a single-use token, that prevent multiple download attempts, so capturing the download URL via the HTTP request is useless. In such cases, you need to look at the page source to see where you can capture the download URL before the download is initiated. Often, you can find the download URL and/or security token in the page's JS. Otherwise, it's typically found in the response from an AJAX service that the JS requests. Or, you may have to analyze the JS source and watch specific variables to capture all the download request components without actually triggering the download.

3

You can install Firefox's FlashGot addon. It will add extra option to this popup-dialog. And you even can customize it - go to FlashGot Options dialog and press "Add" button to add custom "Download Manager", which actually can be any script file to do whatever you want.

Examples:

Windows: select bat-file with single-line command echo %1|clip in it to copy download url to clipboard.

GNU/Linux: this script would do the trick:

#!/bin/bash
echo "$@" | xclip -selection clipboard
1
  • 1
    Not compatible with Firefox Quantum :/
    – AXO
    Sep 15, 2018 at 3:28
1

https://addons.mozilla.org/en-US/firefox/search/?q=wget lists a few extensions that support downloading with wget.

i didn't test them because my own usecase is slightly different: i want to do the actual download on a remote computer. to help with that, i discovered that https://addons.mozilla.org/en-US/firefox/addon/bulk-media-downloader/ will capture downloads at the point when the what to do with this file popup appears. the extension then allows me to pick the urls and copy them to the clipboard without actually initiating a download in the browser.

this enabled me to intercept downloads that where initiated from a javascript call. other extensions i have tried failed in that case.

1
  • Your posts will be easier to read if you use capitalization correctly.
    – JYelton
    Apr 22, 2019 at 16:26
0

The "Download Dialog Tweak" firefox addon does the job and if it's not in AMO anymore, it can be found here : https://github.com/muzuiget/download_dialog_tweak/releases

1
  • Not compatible with Firefox Quantum :/
    – eMBee
    Mar 27, 2019 at 4:19

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .