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

Feature request: option to specify the timezone of upload date #4523

Closed
zmwangx opened this issue Dec 20, 2014 · 2 comments
Closed

Feature request: option to specify the timezone of upload date #4523

zmwangx opened this issue Dec 20, 2014 · 2 comments

Comments

@zmwangx
Copy link

@zmwangx zmwangx commented Dec 20, 2014

Several options in youtube-dl pertain to upload dates: --date, --datebefore, --dateafter, and --output (the %(upload_date)s template). I didn't inspect the source, but I have the impression that the upload dates are calculated either in UTC or the user's local timezone, and there seems to be no way to change the behavior (actually I tried to inspect the source, but it seems that I need to dig through multiple files, so I gave up). However, sometimes it makes more sense to calculate the upload date in another timezone, e.g., the uploader's timezone. (Of course, youtube-dl usually has no way to tell the uploader's timezone, but the user might know.)

Therefore, I propose a --timezone OFFSET option to modify upload dates, and this option would affect the aforementioned options --date, --datebefore, --dateafter, and %(upload_date)s. For instance, --timezone -8 would calculate the upload date in UTC-8:00.

I'm not sure if this will lead to an overhaul to youtube-dl's existing datetime system, but this option is at least possible with YouTube in theory, since YouTube videos' publishedAt property YYYY-MM-DDThh:mm:ss.sZ includes timezone information.

Use case

Here's an example use case. I usually name my downloaded YouTube videos as such: %(upload_date)s__%(title)s__%(id)s.%(ext)s, and I prefer to have %(upload_date)s in the uploader's timezone, provided that I already have that knowledge. Note that post-processing is hard: say the uploader is in UTC+9:00 and I'm in UTC-8:00, then sometimes the uploader is ahead of me by one day and sometimes not, and there's no way to tell just from a YYYYMMDD date. I can hack up a post-processor based on the video ID, but querying the API again is wasteful if youtube-dl can get it right for the first time. (Moreover, I certainly don't want to write a separate post-processor for each service that I download from.)

@zmwangx zmwangx changed the title Feature request: option to specify the timezone for the upload date Feature request: option to specify the timezone of upload date Dec 20, 2014
@zmwangx zmwangx closed this May 16, 2015
@FelixChery
Copy link

@FelixChery FelixChery commented Nov 26, 2019

Did you get a solution to this? I am facing the exact problem.

@zmwangx
Copy link
Author

@zmwangx zmwangx commented Nov 27, 2019

@FelixChery Not really, I closed the issue since apparently no one’s gonna give this any attention amidst the thousands of open issues. Unfortunately it’s something I couldn’t bother to implement myself, so can’t blame others for the lack of enthusiasm.

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
2 participants
You can’t perform that action at this time.