This tool, written in Rust, implements enough of the Amazon Photos API to perform the following operations:
- Create an album or get a reference to an existing one, proceeding by name.
- Upload the contents of a directory to an Amazon Photos instance, note down all the pictures' IDs.
- Add all these pictures to the album.
To create your configuration file for the first time, use the config_setup.py script:
- Open Amazon Photos in your web browser and log in
- Open Developer Tools (F12 or Right-click → Inspect)
- Go to the Console tab and run:
document.cookie
- Copy the entire cookie string
- Run the setup script:
python3 config_setup.py 'session-id=123; x-acbfr=abc; ...'
The script will:
- Automatically detect your country from the cookie names
- Create the configuration file with default values
- Display the configuration file location
- Provide instructions for updating the zone if needed
The configuration file is stored in:
- macOS:
~/Library/Application Support/amzn_photos_uploader/config.toml - Linux:
~/.config/amzn_photos_uploader/config.toml - Windows:
%APPDATA%\amzn_photos_uploader\config.toml
To update your cookies (e.g., after session expiration), use the config_update.py script:
python3 config_update.py 'session-id=123; x-acbfr=abc; ...'This will update the cookie values while preserving your other settings (country, zone, user agent).
If photo uploads fail, you may need to update the zone parameter:
- Open Amazon Photos in your browser
- Open Developer Tools → Network tab
- Upload a photo through the web interface
- Look for a request to:
https://content-XX.drive.amazonaws.com/v2/upload - Note the
XXvalue (e.g.,eu,na,fe) - Edit your config file and update:
zone = "XX"