4

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!

3
  • Maybe check out the "cliget" Firefox extension. It doesn't do what you ask but could be interesting nonetheless.
    – Daniel B
    Commented Jul 30, 2022 at 9:24
  • If the file is zipped, although the zip file itself is not the correct date, the content inside is.
    – LPChip
    Commented Jul 30, 2022 at 11:33
  • @DanielB Thanks a lot!!! I tried this extension, it works, at least let me downloaded successfully a file from Nvidia develop site with wget!
    – Leon
    Commented Jul 31, 2022 at 1:39

1 Answer 1

2

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.

3
  • OP wants a browser-based solution.
    – Daniel B
    Commented Jul 30, 2022 at 20:21
  • But many web sites doesn't allow us to use wget, they enforce us to login before we can download anything.
    – Leon
    Commented Jul 31, 2022 at 1:37
  • I extended my answer. Wget is finally the only option.
    – harrymc
    Commented Jul 31, 2022 at 9:31

You must log in to answer this question.

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