2

I'd like to mirror a site with wget and convert all the links to the local copies I've downloaded. So far that's easy all I have to do is wget -mk http://site.com

However all of the static media is located in a different domain, if I follow all of the foreign hosts using the -H option it will download that static media files, but it will also download anything else externally linked.

Is there a way to specify 'only download foreign hosts specified in list X'?

mountainswhim
  • 121
  • 1
  • 2

2 Answers2

2

Add -Dwww.domain.com,static.domain.com with your equivalent domains.

1

See the section in the wget manpage after the --page-requisites option, it has an example:

Links from that page to external documents will not be followed. Actually, to download a single page and all its requisites (even if they exist on separate websites), and make sure the lot displays properly locally, this author likes to use a few options in addition to -p:

wget -E -H -k -K -p http://<site>/<document>
Justin
  • 3,856
  • 18
  • 21
  • I tried the `-p` option, but still no luck – mountainswhim Feb 25 '10 at 03:37
  • should I take that to mean that you tried the -p option but ignored the section I quoted that tells you that you need a few more options and gives you an example? – Justin Feb 25 '10 at 04:41
  • exactly, I'm already using `-k`. `-K` does nothing more but backup files before converting them and `-E` just renames extensions if needed. As for `-H`, you can see my problem with that in my initial question. – mountainswhim Feb 25 '10 at 05:08