About This Project
This project provides a solution to download photos from Google Photos in their original quality and incrementally. It addresses the limitations of the Google Photos API and the slowness of Google Takeout.
How it Works
- Utilizes Playwright to automate the Google Photos web interface in a headless browser.
- Downloads images starting from the last downloaded image to the top, ensuring incremental backups.
- Organizes downloaded images into year and month folders.
- Saves download progress in a .lastdone file to allow resuming interrupted downloads.
Installation
Follow these steps to set up the project:
- Clone the repository:git clone https://github.com/vikas5914/google-photos-backup
- Install dependencies:npm install
npx playwright install --with-deps chrome - Setup login session:
Run node setup.js. This will open a Chrome browser for you to log in to your Google Photos account. After logging in, close the browser or press Ctrl+C. Your session will be saved in the session folder. - Create .lastdone file:
Create a .lastdone file in the root of the project to specify the starting point for the download. You can do this with touch .lastdone. To set a specific starting URL, use:echo -e "$URL" > .lastdone - Run the project:
Execute node index.js to start the backup process. You can also run it without headless mode using node index.js --headless=false to observe the process.
Bugs
- Images without EXIF data may be saved in the download/1970/1 folder.
Credits
- Inspired by perkeep/gphotos-cdp.
License
This project is licensed under the MIT License. See the LICENSE.md file for details.