SmugMug Download from API

https://github.com/pstitalia0603/DOWNLOAD_SMUGMUG/blob/main/download_smugmug_photos_GH.py

Download your Smugmug photos from the API!

πŸ” Replace with your credentials

πŸ“Έ SmugMug Photo Downloader

A Python script to authenticate with the SmugMug API via OAuth 1.0a, retrieve all albums and images for a user, and download the images organized by album folder.

πŸš€ Features

πŸ“ Folder Structure
All images are downloaded to a local folder called smugmug_photos, which is automatically created in the same directory as the script. Inside that folder, each album is saved in its own subfolder named after the album title.

Example layout:

your_project_directory/
β”œβ”€β”€ download_smugmug_photos.py
β”œβ”€β”€ smugmug_photos/
β”‚ β”œβ”€β”€ Summer Vacation 2023/
β”‚ β”‚ β”œβ”€β”€ IMG_001.jpg
β”‚ β”‚ β”œβ”€β”€ IMG_002.jpg
β”‚ β”‚ └── ...
β”‚ β”œβ”€β”€ Family Reunion/
β”‚ β”‚ β”œβ”€β”€ photo1.jpg
β”‚ β”‚ β”œβ”€β”€ photo2.jpg
β”‚ β”‚ └── ...
β”‚ └── ...

πŸ› οΈ Requirements

Install requirements:

pip install requests requests_oauthlib

πŸ” Configuration

Update your script with your SmugMug API credentials:

πŸ§ͺ Usage

Run the script:

python download_smugmug_photos.py

You'll be prompted to visit a SmugMug authorization URL and enter a PIN.

Once authenticated, the script will:

Fetch your SmugMug albums

Fetch all images from each album

Download images into a folder named smugmug_photos

🧠 Notes

SmugMug paginates API responses; this script handles pagination automatically.

SmugMug imposes a rate limit on API usage. If you hit the limit (status code 429), the script will pause and retry automatically.

Album names are sanitized for safe folder creation.

Duplicate images will not be re-downloaded if they already exist locally.

πŸ“ To-Do

Add support for incremental syncing (skip albums that haven’t changed)

Add progress bar

Add logging or summary report

πŸ“„ License

MIT License. Use freely and modify as needed.