A tool to maintain an archive/mirror of your Google Photos library for backup purposes.

Overview

Google Photos Archiver

Updated Instructions 8/9/2021 Version 2.0.6

Instructions:

  1. Download the script (exe or python script listed below)
  2. Follow the instructions in the Google Slides Presentation
  3. Reference the command guide below to learn the different commands available to you.

If you need assistance or want to report an issue fill out an Issue Report or email me nick (at) ndawson.me

Downloads

Windows 10 (64-bit) Executable

If you are unfamiliar with python or computers in general I recommend you download the Win10 64bit Executable as it will not require any special installation.

Python Script

If you are familiar with python, just download the source code

Install pipenv pip install pipenv

Install dependencies using pipenv pipenv install

Commands

This guide assumes you have downloaded Google API Credentials and have them saved in some location on your computer, if you have no idea what this is please follow the Google Slides Presentation

Usage:

usage: gparch_cli.py [-h] [-c CREDENTIALS] [-t THREADS] [-a] [-s] [-f] [directory]

- If no directory arg is provided the program will default to the current working directory.
- If no credentials are provided the program will search for 'credentials.json' in the directory.
- If no download options are provided, the program will download everything.
- The program automatically skips downloading existing files so running the program with any download option after downloading items already will update everything without re-downloading or deleting existing media. It will only ensure everything is downloaded from Google Photos.

positional arguments:
  directory             directory where your photo library is saved

optional arguments:
  -h, --help            show this help message and exit
  -c CREDENTIALS, --credentials CREDENTIALS
                        path to Google Cloud OAuth2 Credentials (default: {CURRENT_DIR}/credentials.json)
  -t THREADS, --threads THREADS
                        amount of threads to use when downloading media items (default: 8)
  -d, --debug           enables debugging mode
  -a, --albums          download all albums YOU have created
  -s, --shared          download all shared albums (with you/from you)
  -f, --favorites       download all media from your library that is marked as favorite

Important Note:

In the following examples I will be using gparch_cli to run the program for readability. I am listing below all the different ways you may have to run the program to get it to work on your system.

Executable (in the same directory or in PATH)

Command Prompt: gparch_cli PowerShell: ./gparch_cli

Python Script (in the same directory or in PATH)

Windows: py gparch_cli.py Linux/Mac: python3 gpararch_cli.py

Examples

Get Help gparch_cli --help

Download everything from your library in the current directory with the credentials file in the current directory named credentials.json gparch_cli

Download everything from your library to a specific directory gparch_cli example_directory/google_photos_folder

Download everything from your library to a specific directory and specify where your credentials file is gparch_cli example_directory/google_photos_folder -c example_directory/creds.json

Download just your albums gparch_cli -a

Download just your shared albums gparch_cli -s

Download just your favorited items gparch_cli -f

Specify the amount of threads you want to download with to be 12: gparch_cli -t 12

You can combine any of the following commands to do what you specifically want.

  • If no directory arg is provided the program will default to the current working directory.
  • If no credentials are provided the program will search for 'credentials.json' in the directory.
  • If no download options are provided, the program will download everything.
  • The program automatically skips downloading existing files so running the program with any download option after downloading items already will update everything without re-downloading or deleting existing media. It will only ensure everything is downloaded from Google Photos.
Comments
  • Instructions on how to generate the .exe file

    Instructions on how to generate the .exe file

    What tool did you use to generate the .exe file? I tried pyinstaller but seems to require some extra configuration. If you used the same tool, did you have to add anything to the .spec file for resolving dependencies?

    opened by patrickjrs 4
  • RAW Images stored in Google Photos cannot be downloaded

    RAW Images stored in Google Photos cannot be downloaded

    It seems that raw photos from dedicated cameras that are stored in Google Photos won't be able to be downloaded as Python's pillow library doesn't seem to support them. As this is an upstream issue it might be difficult to find a fix, but it seems that most RAW formats aren't supported by Pillow and instead rawpy is usually used.

    I have thousands of .arw images stored in my Google Photos which is a raw image format used by almost all Sony cameras.

    Upstream Issue: https://github.com/python-pillow/Pillow/issues/3124

    ✔ Finished Downloading Shared Albums.
    
    Reading Entire Library From Server...
    
    Downloading Library:  16%|████████████████████████████████████████████▉  | 3539/22777 [00:04<00:09, 1956.83 media items/s]
    ERROR: media item could not be downloaded because: unknown file extension: .arw
    ERROR: media item could not be downloaded because: unknown file extension: .arw
    ERROR: media item could not be downloaded because: unknown file extension: .arw
    ERROR: media item could not be downloaded because: unknown file extension: .arw
    ERROR: media item could not be downloaded because: unknown file extension: .arw
    
    opened by Snuggle 3
  • Move google docs instruction file into git to be more permanent and easier to access

    Move google docs instruction file into git to be more permanent and easier to access

    Google docs tend to vanish over time. If someone finds this in a few years, after the project is long abandoned, you may have already cleaned up your docs. Or you accidentally move the file and the link will become invalid, making the project near-unusable. I recreated the instructions in an .md file right in the repo.

    opened by JuliusJacobsohn 2
  • Duplicate Name Issue

    Duplicate Name Issue

    I have a ton of duplicate named photos in my Google Photos account and it looks like the app just skips them. Happy to help troubleshoot this if needed.

    I have attached an example.

    Screenshot 2022-06-29 112855 Screenshot 2022-06-29 113016

    opened by safewithyou247 2
  • Download loses exif data and considerable size

    Download loses exif data and considerable size

    Image files downloaded from a Shared album

    1. file are severely compressed eg 2M instead of 8M
    2. EXIFdata - specifically GPS data - has been removed

    The same file downloaded through the web has all data intact

    Why is this? Can it be easily avoided?

    wontfix 
    opened by blacktav 2
  • 🐛 Fix issue where 'mediaItems' is missing from request

    🐛 Fix issue where 'mediaItems' is missing from request

    Very small fix, only add mediaItems to the list if they actually exist.

    This exception is caused by a request looking like below, missing the mediaItems but still having a nextPageToken:

    >>> print(request)
    {'nextPageToken': 'abcabc'}
    >>> media_items_list += request["mediaItems"]
    
    Traceback (most recent call last):
      File "/Volumes/Homesweet/GooglePhotoArchiver/gparch_cli.py", line 127, in <module>
        account.download_library()
      File "/Volumes/Homesweet/GooglePhotoArchiver/gparch.py", line 281, in download_library
        items = self.process_media_items(self.list_media_items(), self.lib_dir)
      File "/Volumes/Homesweet/GooglePhotoArchiver/gparch.py", line 356, in list_media_items
        media_items_list += request["mediaItems"]
    KeyError: 'mediaItems'
    

    Fixes #6

    opened by Snuggle 2
  • Program closes before making folder

    Program closes before making folder

    After following the google slides pages, everything goes through successfully. However, after seeing the confirmation page of the authentication flow working, the program closes and no folder is made. The "photoslibrary_token.pickle" is in the directory, but nothing else is created.

    opened by rw377 2
  • PhotosAccount.list_albums(): KeyError: 'albums'

    PhotosAccount.list_albums(): KeyError: 'albums'

    7f581a5b-3138-46bb-bc6e-ab968adef98d This was submitted by a user and needs to be investigated as to why this could be happening.

    Some possible fixes would be to add better debugging and add exceptions for this type of error to find the cause.

    opened by nmd2117 1
  • Unable to Run to get all Albums or Photos

    Unable to Run to get all Albums or Photos

    Hello,

    I have no problem downloading favorites or shared albums, however when I attempt to download albums or photos I encounter: KerError: 'albums' for Albums, or gparch_cli: error: unrecognized arguments: Photos.

    Otherwise this is a fantastic tool that does exactly what I've been looking for as Google Takeout is completely broken for me.

    opened by cobra88king8 1
  • Exe stops right after starting

    Exe stops right after starting

    Followed the instructions, everything seemed fine, but the exe doesn't start downloading. Managed to time this screenshot just right, before it quits.

    image image

    opened by BalazsAdorjan 1
  • fix googleapiclient.errors.UnknownApiNameOrVersion: name: photoslibrary  version: v1

    fix googleapiclient.errors.UnknownApiNameOrVersion: name: photoslibrary version: v1

    I was getting the following error running this on my mac:

    Getting API Service...
    Traceback (most recent call last):
      File "/Users/gligoran/dev/GooglePhotosArchiver/google_photos_archiver.py", line 50, in <module>
        service = get_service()
      File "/Users/gligoran/dev/GooglePhotosArchiver/google_photos_archiver.py", line 32, in get_service
        return build('photoslibrary', 'v1', credentials=creds)
      File "/usr/local/lib/python3.9/site-packages/googleapiclient/_helpers.py", line 134, in positional_wrapper
        return wrapped(*args, **kwargs)
      File "/usr/local/lib/python3.9/site-packages/googleapiclient/discovery.py", line 291, in build
        content = _retrieve_discovery_doc(
      File "/usr/local/lib/python3.9/site-packages/googleapiclient/discovery.py", line 405, in _retrieve_discovery_doc
        raise UnknownApiNameOrVersion("name: %s  version: %s" % (serviceName, version))
    googleapiclient.errors.UnknownApiNameOrVersion: name: photoslibrary  version: v1
    

    This addition fixed it for me.

    opened by gligoran 1
  • Bump certifi from 2021.10.8 to 2022.12.7

    Bump certifi from 2021.10.8 to 2022.12.7

    Bumps certifi from 2021.10.8 to 2022.12.7.

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 0
  • Bump pillow from 9.0.1 to 9.3.0

    Bump pillow from 9.0.1 to 9.3.0

    Bumps pillow from 9.0.1 to 9.3.0.

    Release notes

    Sourced from pillow's releases.

    9.3.0

    https://pillow.readthedocs.io/en/stable/releasenotes/9.3.0.html

    Changes

    ... (truncated)

    Changelog

    Sourced from pillow's changelog.

    9.3.0 (2022-10-29)

    • Limit SAMPLESPERPIXEL to avoid runtime DOS #6700 [wiredfool]

    • Initialize libtiff buffer when saving #6699 [radarhere]

    • Inline fname2char to fix memory leak #6329 [nulano]

    • Fix memory leaks related to text features #6330 [nulano]

    • Use double quotes for version check on old CPython on Windows #6695 [hugovk]

    • Remove backup implementation of Round for Windows platforms #6693 [cgohlke]

    • Fixed set_variation_by_name offset #6445 [radarhere]

    • Fix malloc in _imagingft.c:font_setvaraxes #6690 [cgohlke]

    • Release Python GIL when converting images using matrix operations #6418 [hmaarrfk]

    • Added ExifTags enums #6630 [radarhere]

    • Do not modify previous frame when calculating delta in PNG #6683 [radarhere]

    • Added support for reading BMP images with RLE4 compression #6674 [npjg, radarhere]

    • Decode JPEG compressed BLP1 data in original mode #6678 [radarhere]

    • Added GPS TIFF tag info #6661 [radarhere]

    • Added conversion between RGB/RGBA/RGBX and LAB #6647 [radarhere]

    • Do not attempt normalization if mode is already normal #6644 [radarhere]

    ... (truncated)

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 0
  • Photos not downloading

    Photos not downloading

    I have about 62k photos in my Google Photos, after downloading all my favourites, albums and shared albums, the app downloaded about 3800 photos from my library and then stopped downloading. The progress bar suddenly started flying up very quickly but no new photos are being saved to my device and the available storage on my hard drive isn’t changing at all - it runs until completion with no errors but no additional photos are downloaded. This happened yesterday, tried again today with the same result. Happy to provide any info that might be helpful! Thanks

    opened by nathbullen 0
  • Bump oauthlib from 3.2.0 to 3.2.1

    Bump oauthlib from 3.2.0 to 3.2.1

    Bumps oauthlib from 3.2.0 to 3.2.1.

    Release notes

    Sourced from oauthlib's releases.

    3.2.1

    In short

    OAuth2.0 Provider:

    • #803 : Metadata endpoint support of non-HTTPS
    • CVE-2022-36087

    OAuth1.0:

    • #818 : Allow IPv6 being parsed by signature

    General:

    • Improved and fixed documentation warnings.
    • Cosmetic changes based on isort

    What's Changed

    New Contributors

    Full Changelog: https://github.com/oauthlib/oauthlib/compare/v3.2.0...v3.2.1

    Changelog

    Sourced from oauthlib's changelog.

    3.2.1 (2022-09-09)

    OAuth2.0 Provider:

    • #803: Metadata endpoint support of non-HTTPS
    • CVE-2022-36087

    OAuth1.0:

    • #818: Allow IPv6 being parsed by signature

    General:

    • Improved and fixed documentation warnings.
    • Cosmetic changes based on isort
    Commits
    • 88bb156 Updated date and authors
    • 1a45d97 Prepare 3.2.1 release
    • 0adbbe1 docs: fix typos
    • 6569ec3 docs: Fix a few typos
    • bdc486e Fixed isort imports
    • 7db45bd Fix typo in server.rst
    • b14ad85 chore: s/bode_code_verifier/body_code_verifier/g
    • b123283 Allow non-HTTPS issuer when OAUTHLIB_INSECURE_TRANSPORT. (#803)
    • 2f887b5 Docs: fix Sphinx warnings for better ReadTheDocs generation (#807)
    • d4bafd9 Merge pull request #797 from cclauss/patch-2
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 0
  • Feature: Add media metadata after download

    Feature: Add media metadata after download

    Hi, just recently installed the archiver. Thanks for this usefull tool. Could it be possible to add geolocation metadata to the file downloaded (in fact all metadata available in json file from the library. I saw you have already exif tools (from issue#16 comments), do you think it is possible ? Thanks.

    opened by patxixi 0
  • Down

    Down

    Hi, I managed to download everything and it seems (judging by the size) the photos have been added to the SQLite Photo library, however, when I open Photos I see no photos. I'm using Mac Catalina (iMac).

    Downloading Library: 100%|████| 56569/56569 [1:01:12<00:00, 15.40 media items/s] ✔ Finished Downloading Everything.

    opened by ccjcan 0
Releases(2.2.0)
Owner
Nick Dawson
SE Student at Rochester Institute of Technology that has a passion for learning, coding, and automation. I'm pursuing a career as a Software Engineer.
Nick Dawson
starfish is a Python library for processing images of image-based spatial transcriptomics.

starfish: scalable pipelines for image-based transcriptomics starfish is a Python library for processing images of image-based spatial transcriptomics

199 Dec 08, 2022
An add to make adding screenshots and copied images to the scene easy

Blender Clipboard to Scene It doesn't work with version 2.93 and higher (I tested it on 2.91 and 2.83) There is an issue with importing the Pillow mod

Mohammad Mehdi Afkhami 3 Dec 29, 2021
Python library for ascii graphics

Python library for ascii graphics

Anton 6 Oct 20, 2021
Tools for making image cutouts from sets of TESS full frame images

Cutout tools for astronomical images Astrocut provides tools for making cutouts from sets of astronomical images with shared footprints. It is under a

Space Telescope Science Institute 20 Dec 16, 2022
Program for analyzing shadows from Cassini images

Moons: An Analysis Module for Vicar Files General This packages/program was created for my bachelor's thesis for the Astronomy department at Universit

Joni 1 Jul 16, 2021
Nutrify - take a photo of food and learn about it

Nutrify - take a photo of food and learn about it Work in progress. To make this a thing, we're going to need lots of food images... Start uploading y

Daniel Bourke 93 Dec 30, 2022
MikuMikuRig是一款集生成控制器,自动导入动画,自动布料为一体的blender插件

Miku_Miku_Rig MikuMikuRig是一款集生成控制器,自动导入动画,自动布料为一体的blender插件。 MikumiKurig is a Blender plugin that can generates rig, automatically imports animations

小威廉伯爵 342 Dec 29, 2022
A drop-in replacement for django's ImageField that provides a flexible, intuitive and easily-extensible interface for quickly creating new images from the one assigned to the field.

django-versatileimagefield A drop-in replacement for django's ImageField that provides a flexible, intuitive and easily-extensible interface for creat

Jonathan Ellenberger 490 Dec 13, 2022
missing-pixel-filler is a python package that, given images that may contain missing data regions (like satellite imagery with swath gaps), returns these images with the regions filled.

Missing Pixel Filler This is the official code repository for the Missing Pixel Filler by SpaceML. missing-pixel-filler is a python package that, give

SpaceML 11 Jul 19, 2022
Random collage/montage generator with drop-shadow

Random Collage Example Usage These are the sample input files in $PWD for the below examples: 1.png 2.png 3.png 4.png 5.png 6.png 7.png 8.png 9.png 10

M B 1 Dec 07, 2021
SimpleITK is an image analysis toolkit with a large number of components supporting general filtering operations, image segmentation and registration

SimpleITK is an image analysis toolkit with a large number of components supporting general filtering operations, image segmentation and registration

672 Jan 05, 2023
Computer art based on quadtrees.

Quads Computer art based on quadtrees. The program targets an input image. The input image is split into four quadrants. Each quadrant is assigned an

Michael Fogleman 1.1k Dec 23, 2022
Open source software for image correlation, distance and analysis

Douglas-Quaid Project Open source software for image correlation, distance and analysis. Strongly related to : Carl-Hauser Problem statement (@CIRCL)

Dominik Dancs 2 May 01, 2022
Fill holes in binary 2D & 3D images fast.

Fill holes in binary 2D & 3D images fast.

11 Dec 09, 2022
📷 Python package and CLI utility to create photo mosaics.

📷 Python package and CLI utility to create photo mosaics.

Loic Coyle 7 Oct 29, 2022
The InvGears workbench for FreeCAD allows the creation of gear systems

FreeCAD InvGears workbench Current version 0.1.1 Overview The InvGears workbench allows the creation of gear systems. The gear generation algorithm is

Sebastian Ernesto Garcia 8 Dec 10, 2021
Optimize/Compress images using python

Image Optimization Using Python steps to run the script run the command to install the required libraries pip install -r requirements.txt create a dir

Shekhar Gupta 1 Oct 15, 2021
Image2scan - a python program that can be applied on an image in order to get a scan of it back

image2scan Purpose image2scan is a python program that can be applied on an image in order to get a scan of it back. For this purpose, it searches for

Kushal Shingote 2 Feb 13, 2022
A simple Streamlit Component to compare images in Streamlit apps. It integrates Knightlab's JuxtaposeJS

streamlit-image-juxtapose A simple Streamlit Component to compare images in Streamlit apps using Knightlab's JuxtaposeJS. The images are saved to the

Robin 30 Dec 31, 2022
Polyfoto - Create image mosaics.

Polyfoto Create image mosaics. Showcase "Before and After Science" by Brian Eno "Scott 3" by Scott Walker Installation Clone this repository to your l

Shane Drabing 149 Dec 25, 2022