7

Many web sites ask us to login before downloading real contents files, and restrict us to download files from it with a cli program such as wget or curl.

So we must download files with a browser, instead of wget/curl. But this way, the modified time of files are the time of the downloading action, not the real modified time.

I want to get the real modified time. Is there a easy way to do it? or a add-on/extension of browsers( Chromium / FireFox )?

Thanks!

Leon
  • 281

1 Answers1

6

See Time-Stamping Usage.

Basically, if the web-server returns a Last-Modified header for wget, then to set the local last-modified time to the origin's date-time, use:

wget -S URL

This will work for both HTTP(S) and FTP.


As far as Firefox is concerned, this was discussed since 20 years ago and during many years in the post save original last-modified date on file downloads.

Finally, this was rejected and the following workaround was proposed:

This combination is the last one that will preserve the last-modified time.


As regarding Chrome, this was also discussed in the long-running post Issue 4574: Feature request: preserve timestamps on downloaded files, but nothing ever came out of it.

Conclusion : Seems like wget is the only one, the browsers won't do it, by design.

harrymc
  • 498,455