Skip to content

Tommaso6468/GoogleTakeoutMetadataFix

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Google Photos & Drive Takeout Metadata Fix

Python Platform License

Overview

This simple Python script helps you clean up your Google Photos/Drive export by updating the creation time of your files to the original creation time from the JSON files. Tt removes the JSON files after processing. Additionally, the script can search all directories within the given directory if you want. Other information in the JSON files is now discarded, maybe in the future I'll implement all the other data.

Issues with Google Drive cleaning

If you pass a Google Drive takeout directory, it sometimes doesn't work for all of the files. This is because sometimes the filenames of the JSON files are quite different compared to the original file. You can try to add some specific patterns to the process_file function in the array json_paths.

Prerequisites

  • Python 3 or higher
  • pywin32 library for Windows file time modification (Windows only)

Installation

Step 1: Clone the repository

git clone https://github.com/Tommaso6468/GoogleTakeoutMetadataFix.git
cd GoogleTakeoutMetadataFix

Step 2: Install dependencies (Windows only)

pip install pywin32

Usage

Command line arguments

The script accepts multiple directories as arguments. Use directories given by Google Takeout, you can give a small directory or the entire takeout directory.

Example command

python windows.py "/path/to/your/directory" "/path/to/your/directory"

Script execution

  1. Open a terminal or command prompt
  2. Navigate to the directory where you cloned the repository
  3. Run the script for your OS with the desired directories as arguments
  4. Choose if you want to search all subdirectories. This way, if you pass the entire Takeout directory, it can search all the directories inside and the directories inside those

Contributing

Contributions are welcome! Please fork the repository and submit a pull request.

License

This project is licensed under the MIT License. See the LICENSE file for details.