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

Add "download_date" to info.json metadata to record when the video/metadata was downloaded #29374

Open
3 tasks done
jblaufuss opened this issue Jun 23, 2021 · 1 comment
Open
3 tasks done
Labels

Comments

@jblaufuss
Copy link

jblaufuss commented Jun 23, 2021

Checklist

  • I'm reporting a feature request
  • I've verified that I'm running youtube-dl version 2021.06.06
  • I've searched the bugtracker for similar feature requests including closed ones

Description

The .info.json metadata files should include a download_date field that records the date and time the video and metadata was downloaded. I think this is necessary and useful because many of the other fields in the file (such as view_count and rating) can be expected to change over time, so knowing the date and time they were recorded helps interpret them. For instance, if I create a search database and want to sort by view count, I could use the download date to calculate a normalized "views_per_day", so videos that were downloaded soon after their upload aren't unfairly penalized.

Given the download_date would be taken from the clock of the user's system, time zone information should also be recorded.

@opl-
Copy link

opl- commented Jul 22, 2021

Ideally the time would be saved as a UNIX timestamp or use a timezone like UTC to make it easier to parse its value.

Until this is added, the download time can only be guessed based on the creation time of the file (which might not carry over if the file was moved) or, for YouTube, using the expire (minus ~6 hours) and mt (plus ~5 minutes?) query parameters.

Obviously the latter is just a workaround which won't work for most websites, not to mention it relies on an implementation detail, might be inaccurate if Google ever changed the offsets, and some .info.json files will be missing the url property as it contains the downloader's IP address.

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

No branches or pull requests

2 participants