Skip to content

Instantly share code, notes, and snippets.

@paul2048
paul2048 / google_photos_date_corrector.py
Created July 20, 2021 19:24
When this script is executed in a directory that includes a "Google Photos" folder (which can be exported from here: https://takeout.google.com/settings/takeout/custom/photos), the images will have the correct creation date, rather than the date you downloaded the images. The code works only on Windows machines.
import os
import time
import json
from win32_setctime import setctime
ORIGINAL_FOLDER = 'Google Photos'
# Iterate through each album of your Google Photos
for album in os.listdir(ORIGINAL_FOLDER):
album_path = f'{ORIGINAL_FOLDER}/{album}'