-
Notifications
You must be signed in to change notification settings - Fork 10.2k
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
set mtime to video publish date #18384
Comments
I just tested and it appears that all DASH segments indeed had the same/proper mtime when fetched via http.py. However when the segments are stitched together, the mtime is lost. |
Not a pull request yet, because I'm new to the code in this project and haven't run the unit tests. But this seems to do the job!
In summary, it leverages the fact that every fragment/segment already has an mtime set from the last-modified header. So it just re-sets the mtime of the working/temp file from the fragment file. Which in turn, seems to be preserved in the finalized file of all fragments. Feedback? |
Has this been addressed? I'm running latest version and it seems |
PR #27138 addresses this via trivial patch proposed above last year. |
By the way, fragmented videos are not the only ones to have inconsistent mtimes. I have encountered youtube videos that had Last-Modified/mtime many years off from their upload date (I assume because they have been re-encoded since) As an example:
|
@codl so maybe the .upload_date is the first date the upload was attempted. But the mtime of each fragment is the last time that fragment was uploaded. This seems to be what I've observed. Therefore setting the download mtime to the last fragment is most logical. I agree the json/metadata is missing info such as re-encoding... |
…nt's Last-Modified header (closes ytdl-org#11718, closes ytdl-org#18384, closes ytdl-org#27138)
Make sure you are using the latest version: run
youtube-dl --version
and ensure your version is 2018.12.03. If it's not, read this FAQ entry and update. Issues with outdated version will be rejected.Before submitting an issue make sure you have:
What is the purpose of your issue?
Description of your issue, suggested solution and other information
this is a followup to #18383 in which I found out that the mtime is only set according to the
Last-Modified
HTTP headers, and doesn't work for videos downloaded with DASH. I find this counter-intuitive: having downloaded videos and seen that the mtime was set to — as far as I could tell — the upload date, I expected this to happen all the time until it randomly didn't work for some videos.I think that, whenever the upload time is available, it should be used for the final file's mtime in place of
Last-Modified
.The text was updated successfully, but these errors were encountered: