🚨 This is a work in progress
Google Takeout allows you to generate zip files of your google data. The problem is that it will generate hundreds of zip files of your data, all with this information loosely connected
I made this script to download all of my google photos so I can back it up onto a harddrive
Before you begin, export all of your google photos to google drive using Google Takeout
-
Follow the quickstart to setup the google cloud project. This is needed so you can generate a token via Oauth2 with Google. Store the
credentials.json
file at root level. Skip the part of setting up a golang project. Ensure the following scopes are includedhttps://www.googleapis.com/auth/drive.readonly https://www.googleapis.com/auth/drive.metadata.readonly
-
Copy the directory ID of the google takeout folder in google drive. This can be found in the URL when viewing the Takeout folder in google drive.
drive.google.com/drive/folders/{really long id....}
-
Run the
download
script withgo run cmd/download/main.go -directoryId=abc123
. By default,dryRun
is set to true. You should see your files appear in the console
Error and info logs are written to a file and stored in tmp/*.log
when running a script
Run the following command locally after setting up the project. When you are confident everything is setup correctly, set dryRun
to false.
go run cmd/download/*.go -directoryId={GoogleTakeout Directory ID} -dryRun=true -outDir={/absolute/path/to/destination/directory}
After downloading all of your files, you can unzip them all. When you are confident everything is setup correctly, set dryRun
to false.
go run cmd/unzip/*.go -source=/absolute/path/to/directory/with/zipfiles -out=/absolute/path/for/unizpped/files -dryRun=true