4

I was looking at youtube-dl documentation and it says - -

-no-mtime                       Do not use the Last-modified header to set
                                 the file modification time

Can anybody tell/share what does that mean in plain english. Does it mean it will respect the time when uploader or youtube has put it or what else does it mean ?

1 Answer 1

3

mtime is a filesystem field which stores last modified time for file.

When youtube-dl downloads a file, it tries to set file mtime to same as in HTTP Last-Modified header. When --no-mtime is used file mtime is not modified manually.

If you are interested in details, you can browse youtube-dl source code in github. Some relevant lines:

2
  • what I'm looking for is to have the original time-stamp i.e. when the video is uploaded. Last few days I'm getting the time-stamp of 'now' rather than the date when it was published on youtube. I have no idea whether that's a bug in youtube-dl or something else.
    – shirish
    Commented Aug 19, 2017 at 14:40
  • 1
    youtube-dl uses Last Modified header. If you want to manually verify, you can use -v flag for verbose output for youtube-dl. Probably the easiest way to check Last-Modified for urls in youtube-dl output is by using curl -I. However youtube-dl documentation allows naming output file with upload date using -o 'video_%(upload_date)s.flv' as described by documentation. If you really need to set ctime and/or mtime to match you likely need to patch youtube-dl yourself to add such feature.
    – sebasth
    Commented Aug 20, 2017 at 10:57

You must log in to answer this question.

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