Downloads your entire Google Photos library while preserving original metadata, quality and file order using python and the Google Photos API.
The Google Takeout file/folder structure has some interesting inconsistencies/quirks which make it tricky to work with. i created this script for my personal use.
![Watch the video](/Underemployed/Google-Photos-Downloader/raw/main/img/thumbnail.jpeg)
- Downloads all photos and videos from Google Photos
- Preserves original metadata (date, location, etc)
- Organizes files by year and month (2024/01_January/etc)
- Creates friendly filenames (1st January 2024_time_photo.jpg)
- Tracks folder statistics (file count, total size)
- Skips existing files automatically
- Go to Google Cloud Console.
- Create a new project or select an existing one.
- Search for "Enable APIs and Services".
- Click on "+ ENABLE APIS AND SERVICES".
- Search for "Google Photos Library API".
- Click "Enable".
-
Go to "APIs & Services" > "OAuth consent screen".
-
Select "External" user type.
-
Enter the required fields.
-
Fill in the required application information.
-
Add the following scope:
https://www.googleapis.com/auth/photoslibrary
-
Add your Google account as a test user (the Gmail account in which your photos are stored).
- Follow Google's guide to set up access.
- Go to "Credentials".
- Click "Create Credentials" > "OAuth client ID".
- Choose "Desktop application" as the application type.
- Download the client configuration file.
- Rename the downloaded client configuration file to
secret-token.json
and save it to the project directory.
-
If Python is not installed, download and install it from python.org
-
Install the required Python packages:
pip install -r requirements.txt
-
Run the application:
python app.py
-
log in to your Google account, click continue and start downloading your Google Photos.
-
If you want to transfer it to another account You will lose some metadata, but you will be able to transfer all your photos and videos to another account.
-
Run the application:
python upload_to_another_acc.py
This tool was only written for the purpose of solving my own personal requirements.
I decided to make this public on GitHub because:
- It was useful for me, so maybe it'll be useful for others in the future.
- Future me might be thankful if I ever need to do this again.
With that said, please bear in mind that this tool won't be actively maintained and your mileage may vary. I'm sure it's far from perfect so if you choose to use it please proceed with caution and be careful to verify the results! I hope it's helpful.