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

File time stamps incorrect #10303

Closed
ghost opened this issue Aug 12, 2016 · 8 comments
Closed

File time stamps incorrect #10303

ghost opened this issue Aug 12, 2016 · 8 comments

Comments

@ghost
Copy link

@ghost ghost commented Aug 12, 2016

Please follow the guide below

  • You will be asked some questions and requested to provide some information, please read them carefully and answer honestly
  • Put an x into all the boxes [ ] relevant to your issue (like that [x])
  • Use Preview tab to see how your issue will actually look like

Make sure you are using the latest version: run youtube-dl --version and ensure your version is 2016.08.12. If it's not read this FAQ entry and update. Issues with outdated version will be rejected.

  • [x ] I've verified and I assure that I'm running youtube-dl 2016.08.12

Before submitting an issue make sure you have:

  • [ x] At least skimmed through README and most notably FAQ and BUGS sections
  • [ x] Searched the bugtracker for similar issues including closed ones

What is the purpose of your issue?

  • [ x] Bug report (encountered problems with youtube-dl)
  • Site support request (request for adding support for a new site)
  • Feature request (request for a new functionality)
  • Question
  • Other

The following sections concretize particular purposed issues, you can erase any section (the contents between triple ---) not applicable to your issue


If the purpose of this issue is a bug report, site support request or you are not completely sure provide the full verbose output as follows:

Add -v flag to your command line you run youtube-dl with, copy the whole output and insert it here. It should look similar to one below (replace it with your log inserted between triple ```):

$ youtube-dl -v
[debug] System config: []
[debug] User config: []
[debug] Command-line args: [u'-v']
[debug] Encodings: locale UTF-8, fs utf-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2016.08.10
[debug] Python version 2.7.12 - Darwin-15.6.0-x86_64-i386-64bit
[debug] exe versions: ffmpeg 3.1.2, ffprobe 3.1.2
[debug] Proxy map: {}
Usage: youtube-dl [OPTIONS] URL [URL...]

youtube-dl: error: You must provide at least one URL.
Type youtube-dl --help to see a list of all options.

If the purpose of this issue is a site support request please provide all kinds of example URLs support for which should be included (replace following example URLs by yours):


Description of your issue, suggested solution and other information

Running below command to download 300+ videos from a YouTube channel. First 100 or something had the accurate file modified dates. Matching the date the videos were uploaded the channel. But the remaining files are dated today (day of download). Not sure what happened along the day. Any ideas? Running the command on Mac el-Capitan.

youtube-dl --download-archive downloaded.txt -ixv --audio-format mp3 --audio-quality 8 -o "%(title)s.%(ext)s" ytuser:enyay

@dstftw
Copy link
Collaborator

@dstftw dstftw commented Aug 12, 2016

Modify date is not set from video upload date but according to Last-Modified HTTP header. If any final file is dated today than this is what is returned by Last-Modified header.

@dstftw dstftw closed this Aug 12, 2016
@ghost
Copy link
Author

@ghost ghost commented Aug 12, 2016

OK that's good to know but it doesn't really help address the issue. If I re-download the video individually, Last-Modified date is displayed properly. Say a video from Aug 2013. But like I said if I attempt to batch download videos, somewhere in the middle, something happens and Last-Modifed returns the date & time of the download.

@yan12125
Copy link
Collaborator

@yan12125 yan12125 commented Aug 12, 2016

Did you use the timestamp for some sorting tasks? I suggest --xattrs or --add-metadata instead, which is more reliable than file modification time.
By the way, seems there's a bug in --xattrs. According to http://dublincore.org/documents/dces/, it's recommended to use ISO8601 format for the date field:

Recommended best practice is to use an encoding scheme, such as the W3CDTF profile of ISO 8601 [W3CDTF].

However, the current implementation uses upload_date. A change seems necessary. If some video does not have a timestamp field but only upload_date, we can use a fixed time in a day. For example, 2016/08/12 => 2016-08-12T00:00:00.

@ghost
Copy link
Author

@ghost ghost commented Aug 12, 2016

Yes I would like to preserve the time stamps so I can sort and categorize files accordingly. Could you please provide an example on how to do what you suggested with --add-metadata?

@yan12125
Copy link
Collaborator

@yan12125 yan12125 commented Aug 14, 2016

Sorry for the late response. In general the following command should work:

youtube-dl --download-archive downloaded.txt -ixv --audio-format mp3 --audio-quality 8 -o "%(title)s.%(ext)s" ytuser:enyay --add-metadata

However, on my machine the written metadata is overwritten by following format conversions. I'm not sure whether it's a problem of ffmpeg or youtube-dl. Does this command work for you?

@ghost
Copy link
Author

@ghost ghost commented Aug 14, 2016

Doesn't work :( First video gets downloaded is from Aug 1st but the Date Modified of the mp3 file shows today's date unfortunately.

@yan12125
Copy link
Collaborator

@yan12125 yan12125 commented Aug 14, 2016

--add-metadata does not change the modified date, but the metadata of media files, which are part of the file content. Those metadata can be viewed with ffprobe xxx.mp3. It shows nothing for me, though.

@Deses
Copy link

@Deses Deses commented Oct 18, 2020

Four years later and this is still happening. Exact same behaviour. Download first 100 or so files? No problem, after a while it starts putting the current date and if I redownload it it works OK again.

There's something definitely wrong when batch downloading a lot of stuff.

@dstftw this should be reopened, IMHO.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

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