Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problems with automatically setting the video's mtime to the server's modification time #1709

Open
epitron opened this issue Nov 3, 2013 · 15 comments
Labels

Comments

@epitron
Copy link
Contributor

@epitron epitron commented Nov 3, 2013

Youtube-DL recently changed its behaviour in a way that broke how I was using it. It used to set the mtime to when the file was downloaded; now it's set to when the file was uploaded to the video site.

This means that I can't sort my videos by download time anymore. It's problematic when you have a large download directory, or multiple collections, which you slowly process over time.

The only other downloader I've found with this default behaviour is wget. All the other downloaders -- browsers, torrent programs, curl, scp -- set the mtime to the time that you downloaded the file. (This is the the definition of mtime.)

I can see how people would want to save the video creation date. Luckily, there's a pull request in the pipeline (#1708) that writes this information -- and more -- to the file's xattrs.

So, you can have it all: files sorted by download date, and their creation date!

How 'bout it?

@jaimeMF
Copy link
Collaborator

@jaimeMF jaimeMF commented Nov 3, 2013

Using the --no-mtime option disables this behaviour, does it work for you?

@epitron
Copy link
Contributor Author

@epitron epitron commented Nov 3, 2013

Yeah, it works.

It seems like it would be better if the default was --no-mtime, and that there was an --mtime option instead.

@SS64
Copy link

@SS64 SS64 commented Jun 28, 2015

I think you can argue this either way, but it confused me at first having the download file's date/time appear to be wrong, in most cases the date always seems to be about 23 hours ago for some reason - would be nice if the --no-mtime option was a little more prominent in the docs/online help.

@epitron
Copy link
Contributor Author

@epitron epitron commented Jun 28, 2015

I think the strongest argument is that every other program (except wget) sets the mtime to the current time, and the ctime to the remote file's time.

Knowing the order you downloaded files in a directory helps you process them more easily.

@dsoprea
Copy link

@dsoprea dsoprea commented Mar 6, 2017

+1 on all (changing the default, setting the ctime to this value instead of the ctime, setting the xattrs).

What's it going to take to move forward? This conversation has been stalled for a couple of years.

@yan12125
Copy link
Collaborator

@yan12125 yan12125 commented Mar 6, 2017

+1 for making --no-mtime as the default. IMO youtube-dl is a video/audio downloader. All other actions besides downloading the contents of video/audio streams shouldn't be there unless explicitly requested.

setting the xattrs

-1 on this. xattrs shouldn't be added without --xattrs

@yan12125 yan12125 added the request label Mar 6, 2017
@dsoprea
Copy link

@dsoprea dsoprea commented Mar 6, 2017

@untotren
Copy link

@untotren untotren commented Jun 20, 2017

+1

@allanlaal
Copy link

@allanlaal allanlaal commented Jul 5, 2017

+1

I was expecting this behaviour and completely lost track of what I've downloaded because it was using random mtime dates for files

@dstftw dstftw mentioned this issue Dec 13, 2017
4 of 8 tasks complete
@NickSto
Copy link

@NickSto NickSto commented Dec 13, 2017

+1 million

I think having the default date modified be the upload date violates the principle of least astonishment, since most tools set it to the current time. People will assume it operates like most other tools, as I did, and it can cause real problems.

I went years without realizing what it was actually doing. I really like to have a record of when I first found and downloaded a video, and now there's years of videos I've saved where I have no idea what period of my life they're from. The worst part is, it effectively poisoned the date modifieds on all the videos downloaded before that as well. If I see a video with a date from before that period, I don't know if it's actually from then, or if it's one downloaded with youtube-dl with a date that artificially put it back then.

It wasn't until I was trawling through the list of options and saw --no-mtime that I realized what happened. At the very least, I'd recommend putting a note somewhere prominent about what the default date modified will be.

@polonskiy
Copy link

@polonskiy polonskiy commented Mar 26, 2018

--no-mtime definitely should be default.
I have almost deleted new videos with find /youtube -type f -mtime +7 -delete.

@SS64
Copy link

@SS64 SS64 commented Mar 26, 2018

The current behaviour would make sense if the server time related to the original video's creation date, but it's not. I'm not even sure that it is reliably related to the upload date?

@graywolf
Copy link

@graywolf graywolf commented Mar 29, 2018

I'm not sure if you are counting votes or anything, but +1 for this. I've just out of habit tried ls -rtl to find the downloaded video from youtube and was bit confused it was nowhere to be find.

While --mtime could be possible handy, I think vast majority of people would expect --no-mtime to be the default, same way as other downloaders work.

But that's just, like, my opinion ^_^

@shivdhar
Copy link

@shivdhar shivdhar commented Jun 10, 2019

+1 for --no-mtime to be the default, and --xattrs and, in fact, --add-metadata too.

These are flags that add information without breaking anything AFAIK, which is a good thing and definitely should be on by default.

--mtime by default is just plain confusing.

@yomajo
Copy link

@yomajo yomajo commented Jan 4, 2020

Problem: music folder is arranged by last modified, so latest downloaded songs are at the top. Currently youtube-dl messes this up using last modified which is ~5days off.

Suggestion: use scrape timestamp instead of headers.

@ytdl-org ytdl-org locked and limited conversation to collaborators Jan 4, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
You can’t perform that action at this time.