Simple Python application to save Pictures from Google Photos.
Fetching the user's files requires authentication, so you will need to set up OAuth flow.
- Create a new project in Google Cloud Platform.
- Add the "Photos Library API" to your project with ".../auth/photoslibrary.readonly" scope.
- Configure the OAuth consent screen to "External" User Type
- Create a new OAuth credential.
- Add your desired Google account as a test user for your application.
- Save the client secrets JSON file to the root of this repository with the name
client_secrets.json
. - This file is in
.gitignore
so it should not be committed to the repository.
In a terminal, go to the root of this repository.
Create a virtual environment:
python3 -m venv venv
source venv/bin/activate
Install requirements:
pip install -r requirements.txt
Run the program from the root of the repository:
python3 -m photodownloader <backup-directory>
Open the link and accept the authentication request.
The program will save the credential to disk as a file called credentials.pickle
.
This file is in .gitignore
so it should not be committed to the repository.
On future executions of this program, the credentials.pickle
file will be loaded, so you should not need to go through
the OAuth flow again until it expires.