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

Save timestamps #15

Open
Doliman100 opened this issue Apr 23, 2021 · 0 comments
Open

Save timestamps #15

Doliman100 opened this issue Apr 23, 2021 · 0 comments

Comments

@Doliman100
Copy link
Contributor

Imgur API returns image upload time. It can be used as the last modified time of the file. You can add an option like --timestamps for it.
To do this, you need to add a line to this. Where datetime is image['datetime'] located in download_account_images, passed to parse_id.

with open(os.path.join(path, filename), 'wb') as image_file:
    req.raw.decode_content = True
    shutil.copyfileobj(req.raw, image_file)
os.utime(image_file.name, (datetime, datetime))
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