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

Twitter - Setting UTC offset to match local time in filename #2736

Closed
ready2r opened this issue Jul 6, 2022 · 4 comments
Closed

Twitter - Setting UTC offset to match local time in filename #2736

ready2r opened this issue Jul 6, 2022 · 4 comments

Comments

@ready2r
Copy link

ready2r commented Jul 6, 2022

Is there a way to add an offset to the twitter created date? Ive been using another program to download twitter media and it was set to use local time in the filename. I want to transition into using a CLI method of downloading images. How can i set Gallery-DL to use local time (or an offset) so i can pick up where i left off with my last program?

mikf added a commit that referenced this issue Jul 8, 2022
to apply a UTC offset to 'date' values and other datetime objects
@mikf
Copy link
Owner

mikf commented Jul 8, 2022

Is there a way to add an offset to the twitter created date?

Not with the current release.

I've added a new format string option in 90ae48c, with which you can apply the local UTC offset ({date:Olocal} or just {date:O}) or any offset ({date:O+12:34}) to a datetime value.

@ready2r
Copy link
Author

ready2r commented Jul 8, 2022

Thanks a ton for the addition! I tested it and it works great, but is there a way to use your own date format? Something like %Y%m%d_%I%M%S?

Im getting:

[twitter][error] FilenameFormatError: Applying filename format string failed (ValueError: invalid literal for int() with base 10: ', %Y%m%d_%I%M%S')

@mikf
Copy link
Owner

mikf commented Jul 9, 2022

You use a forward slash / to separate custom format specifiers from one another or native ones, so you'd do O... + / + %Y%m%d_%I%M%S: {date:O+12:34/%Y%m%d_%I%M%S}

@ready2r
Copy link
Author

ready2r commented Jul 10, 2022

You are awesome! Thanks for all the work you have put into Gallery-DL!

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

No branches or pull requests

2 participants