Giter Site home page Giter Site logo

zaczero / google-photos-takeout.sh Goto Github PK

View Code? Open in Web Editor NEW
11.0 2.0 4.0 39 KB

🔧 Fixes Google Photos Takeout metadata

License: GNU Affero General Public License v3.0

Shell 100.00%
bash exif exiftool google-photos google-takeout jq shell shell-script

google-photos-takeout.sh's Introduction

A script that — just works!

This script fixes the image and video metadata of Google Photos Takeout, so that it can be used with other software. It handles both the DateTimeOriginal and GPS EXIF fields.

No javascript or any other bs.

Dependencies

  • bash
  • exiftool
  • jq

Usage

  1. Download and extract your Google Photos Takeout
  2. Download the script and put it inside the Takeout folder
  3. Run it

Directory guide screenshot

google-photos-takeout.sh's People

Contributors

roblaw0304 avatar zaczero avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

google-photos-takeout.sh's Issues

exiftool fails with too many files

I was hoping to use your script to process google photos takeout of 66215 photos.
The script crashes on Ubuntu 22.04 with jq 1.6 and exiftool 11.88-1ubuntu0.1.

./google-photos-takeout.sh: line 82: /usr/bin/exiftool: Argument list too long

I've looked at exiftool forum and found this thread it suggests that there is a limit, and I guess it's less than 66.2k

Files not found, but they are listed [via git bash on windows]

Hi
thanks for providing the script!

i try to run it via git bash on windows and i am facing this issue:

"$ sh google-photos-takeout.sh
[1/2] ./Google Fotos/Photos from 2021/IMG_2662.JPG.json : ./Google Fotos/Photos from 2021/IMG_2662.JPG
[2/2] ./Google Fotos/Photos from 2021/IMG_2666.JPG.json : ./Google Fotos/Photos from 2021/IMG_2666.JPG
Found 2 unique files to process
Looks correct? [y/N] y
======== ./Google Fotos/Photos from 2021/IMG_2662.JPG [1/2]
Warning: Error opening file - ./Google Fotos/Photos from 2021/IMG_2662.JPG.json
Error: File not found - ./Google Fotos/Photos from 2021/IMG_2662.JPG
======== ./Google Fotos/Photos from 2021/IMG_2666.JPG [2/2]
Warning: Error opening file - ./Google Fotos/Photos from 2021/IMG_2666.JPG.json
Error: File not found - ./Google Fotos/Photos from 2021/IMG_2666.JPG
0 image files updated
2 files weren't updated due to errors
Delete all JSON files? [y/N] n
"

jq.exe and exiftool are installed and available via cmd.

thanks in advance.

Duplicate Name Disambiguation Issue

If you have uploaded multiple files to Google which end up in the same folder in your Google Takeout that had the same original upload name, Google names the jpg and json files differently. This causes the google-photos-takeout.sh script to assign all identically named JSON files to the base jpg instead of a 1:1 mapping you'd expect.

Example:
I have four files named IMG_0484.JPG that I upload to Google Photos.
In my Google Takeout, I end up with four image files, IMG_0484.JPG, IMG_0484(1).JPG, IMG_0484(2).JPG, IMG_0484(3).JPG and four json files IMG_0484.JPG.json, IMG_0484.JPG(1).json, IMG_0484.JPG(2).json, IMG_0484.JPG(3).json,

google-photos-takeout.sh assigns as such:

[14120/129828] ./Photos from 2012/IMG_0484.JPG(1).json : ./Photos from 2012/IMG_0484.JPG
[14121/129828] ./Photos from 2012/IMG_0484.JPG(2).json : ./Photos from 2012/IMG_0484.JPG
[14122/129828] ./Photos from 2012/IMG_0484.JPG(3).json : ./Photos from 2012/IMG_0484.JPG
[14123/129828] ./Photos from 2012/IMG_0484.JPG.json : ./Photos from 2012/IMG_0484.JPG

This is what is expected:

[14120/129828] ./Photos from 2012/IMG_0484.JPG(1).json : ./Photos from 2012/IMG_0484(1).JPG
[14121/129828] ./Photos from 2012/IMG_0484.JPG(2).json : ./Photos from 2012/IMG_0484(2).JPG
[14122/129828] ./Photos from 2012/IMG_0484.JPG(3).json : ./Photos from 2012/IMG_0484(3).JPG
[14123/129828] ./Photos from 2012/IMG_0484.JPG.json : ./Photos from 2012/IMG_0484.JPG

This occurred for a huge number of my files since over the years many cameras from different families have been used which coincidentally had the same naming scheme.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.