rockdaboot / wget2

The successor of GNU Wget. Contributions preferred at https://gitlab.com/gnuwget/wget2. But accepted here as well 😍
GNU Lesser General Public License v3.0
544 stars 74 forks source link

Option to download favicon.ico #139

Closed daleworley closed 7 years ago

daleworley commented 7 years ago

Павел Серегов requested on the wget mailing list:

Often not exist code for favicon (in index.html), but site have.

My suggestion: If use wget -m, need make download http://example.com/favicon.ico

How do you like the idea?

Based on the documentation of -m, viz:

   -m
   --mirror
       Turn on options suitable for mirroring.  This option turns on
       recursion and time-stamping, sets infinite recursion depth and
       keeps FTP directory listings.  It is currently equivalent to -r
       -N -l inf --no-remove-listing.

I suggest defining "--favicon" specifically to download http(s)://xxxx/favicon.ico, and then add --favicon to the specification of --mirror.

I have not considered what are the proper valu(es) of "http(s)://xxxx".

juaristi commented 7 years ago

I edited the comment to remove the e-mail address.

rockdaboot commented 7 years ago

Answer on the Savannah wget issue tracker:

The favicon will be loaded when you mirror a site and this site advertises it, e.g.:
<link rel="shortcut icon" href="/images/favicon.ico" />

As you can see, the site may have the favicon in some different place then in the server's root directory.

So, basically I am against automatic loading of the favicon (guessing the right URL).

If you want guessing, you could take a tool like 'nikto' and parse it's hits to wget. I mean instead of adding a 'guess' mode for wget.