I'm using wget -A to download images from a page.
This works fine, when images are hosted on the same domain as the page.
But this won't download images hotlinked from other pages (e.g. imageshack)

How can I download the external images as well using wget or similar tool?

3 Answers 3


You need the -H (resp. --span-hosts) parameter. It enables downloading of linked resources that are hosted at different hosts/domains.

In addition you may block specific domains with --exclude-domains (Example: --exclude-domains=example.com,example.org)

  • The first sentence solves the problem as per the post, in my opinion. Someone should mark this answer as correct. Apr 22, 2014 at 3:24

You have to specify the domain you allow wget to follow using -D [domain list] or --domains=[domain list] (coma separated)

Note: I don't know if it handles wildcards.


Some adminsys (me included) block the wget user-agent on some files to avoid hotlinking (for example).

There are also other tools like wget: cURL, httpie, etc.. but they also can be blocked by their user-agent.

So it might not be a problem from you, but from domain you are querying.

Not the answer you're looking for? Browse other questions tagged or ask your own question.